Beiträge von MrRylisma

    Das is zeile 31

    Lua
    exports['anticheat-system']:changeProtectedElementDataEx(getRootElement(), "account:motd", motdresult["value" ], false )


    Und das is der error:

    Lua
    ERROR: account-systeam/s_main.lua:31: attemp to index local motdresult

    Brauch hilfe bei meinen Punkte systeam ich versuche es seit ca 2 Stunden , ich brauche ein Punkte systeam was erkennt wie viele Spieler auf den server sind und dan Punkte verteilt zb, es sind 8 Spieler auf dem Server,
    ,
    Spieler 1 , 1 Platz , 16 Punkte
    Spieler 2 , 2 Platz , 14 Punkte

    Spieler 3 , 3 Platz , 12 Punkte

    Spieler 4 , 4 Platz , 10 Punkte

    Spieler 5 , 5 Platz , 8 Punkte

    Spieler 6 , 6 Platz , 6 Punkte

    Spieler 7 , 7 Platz , 4 Punkte

    Spieler 8 , 8 Platz , 2 Punkte


    Und es soll im Score Board eine Zeile geben zb,
    Spieler 1 | Rank 1| 16 Punkte|
    Spieler 2 | Rank 2| 14 Punkte|

    Spieler 3 | Rank 3| 12 Punkte|

    Spieler 4 | Rank 4| 10 Punkte|

    Spieler 5 | Rank 5| 8 Punkte|

    Spieler 6 | Rank 6| 6 Punkte|

    Spieler 7 | Rank 7| 4 Punkte|

    Spieler 8 | Rank 8| 2 Punkte|


    Und das hallt, mit Rank,Points das die gespeichert werden, und wen man sich wieder einloggt die Punkte hatt, und Sammeln kann.

    Wie gesagt habe mir ein Sound systeam gedownloaded und möchte jetzt das man die box Sieht , hier ist das script. Normal laut script is die box immer unter dem Auto, aber ich möchte das sie ein Stück über den auto schwebt...

    Client.lua:

    Spoiler anzeigen

    ------------------------------------------
    -- Author: xXMADEXx --
    -- Name: 3D Speakers 2.0 --
    -- File: client.lua --
    -- Copywrite 2013 ( C ) Braydon Davis --
    ------------------------------------------
    -- Decompile Security --
    sec = {{{{{{},{},{},{}}}}}} --
    ------------------------------
    -- Variables --
    ------------------------------
    local subTrackOnSoundDown = 0.1 -- The volume that goes down, when the player clicks "Volume -"
    local subTrackOnSoundUp = 0.1 -- The volume that goes up, when the player clicks "Volume +"

    ------------------------------
    -- The GUI --
    ------------------------------
    local rx, ry = guiGetScreenSize ( )
    button = { }
    window = guiCreateWindow( ( rx - 295 ), ( ry / 2 - 253 / 2 ), 293, 253, "Speakers", false)
    guiWindowSetSizable(window, false)
    guiSetVisible ( window, false )
    CurrentSpeaker = guiCreateLabel(8, 33, 254, 17, "Do you have a currently have a speaker: No", false, window)
    volume = guiCreateLabel(10, 50, 252, 17, "Current Volume: 100%", false, window)
    pos = guiCreateLabel(10, 66, 252, 15, "X: 0 | Y: 0 | Z: 0", false, window)
    guiCreateLabel(11, 81, 251, 15, "URL:", false, window)
    url = guiCreateEdit(11, 96, 272, 23, "", false, window)
    --url = guiCreateEdit(11, 96, 272, 23, "http://roscripts.netau.net/sound.mp3", false, window) -- (This link may not work, by the time you get the script)
    button["place"] = guiCreateButton(9, 129, 274, 20, "Create Speaker", false, window)
    button["remove"] = guiCreateButton(9, 159, 274, 20, "Destroy Speaker", false, window)
    button["v-"] = guiCreateButton(9, 189, 128, 20, "Volume -", false, window)
    button["v+"] = guiCreateButton(155, 189, 128, 20, "Volume +", false, window)
    button["close"] = guiCreateButton(9, 219, 274, 20, "Exit", false, window)

    --------------------------
    -- My sweet codes --
    --------------------------
    local isSound = false
    addEvent ( "onPlayerViewSpeakerManagment", true )
    addEventHandler ( "onPlayerViewSpeakerManagment", root, function ( current )
    local toState = not guiGetVisible ( window )
    guiSetVisible ( window, toState )
    showCursor ( toState )
    if ( toState == true ) then
    guiSetInputMode ( "no_binds_when_editing" )
    local x, y, z = getElementPosition ( localPlayer )
    guiSetText ( pos, "X: "..math.floor ( x ).." | Y: "..math.floor ( y ).." | Z: "..math.floor ( z ) )
    if ( current ) then guiSetText ( CurrentSpeaker, "Do you currently have a speaker: Yes" ) isSound = true
    else guiSetText ( CurrentSpeaker, "Do you currently have a speaker: No" ) end
    end
    end )

    addEventHandler ( "onClientGUIClick", root, function ( )
    if ( source == button["close"] ) then
    guiSetVisible ( window, false )
    showCursor ( false )
    elseif ( source == button["place"] ) then
    if ( isURL ( ) ) then
    triggerServerEvent ( "onPlayerPlaceSpeakerBox", localPlayer, guiGetText ( url ), isPedInVehicle ( localPlayer ) )
    guiSetText ( CurrentSpeaker, "Do you currently have a speaker: Yes" )
    isSound = true
    guiSetText ( volume, "Current Volume: 100%" )
    else
    outputChatBox ( "You need to enter a URL.", 255, 0, 0 )
    end
    elseif ( source == button["remove"] ) then
    triggerServerEvent ( "onPlayerDestroySpeakerBox", localPlayer )
    guiSetText ( CurrentSpeaker, "Do you currently have a speaker: No" )
    isSound = false
    guiSetText ( volume, "Current Volume: 100%" )
    elseif ( source == button["v-"] ) then
    if ( isSound ) then
    local toVol = math.round ( getSoundVolume ( speakerSound [ localPlayer ] ) - subTrackOnSoundDown, 2 )
    if ( toVol > 0.0 ) then
    outputChatBox ( "Volume set to "..math.floor ( toVol * 100 ).."%!", 0, 255, 0 )
    triggerServerEvent ( "onPlayerChangeSpeakerBoxVolume", localPlayer, toVol )
    guiSetText ( volume, "Current Volume: "..math.floor ( toVol * 100 ).."%" )
    else
    outputChatBox ( "The volume cannot go any lower.", 255, 0, 0 )
    end
    end
    elseif ( source == button["v+"] ) then
    if ( isSound ) then
    local toVol = math.round ( getSoundVolume ( speakerSound [ localPlayer ] ) + subTrackOnSoundUp, 2 )
    if ( toVol < 1.1 ) then
    outputChatBox ( "Volume set to "..math.floor ( toVol * 100 ).."%!", 0, 255, 0 )
    triggerServerEvent ( "onPlayerChangeSpeakerBoxVolume", localPlayer, toVol )
    guiSetText ( volume, "Current Volume: "..math.floor ( toVol * 100 ).."%" )
    else
    outputChatBox ( "The volume cannot go any higher.", 255, 0, 0 )
    end
    end
    end
    end )

    speakerSound = { }
    addEvent ( "onPlayerStartSpeakerBoxSound", true )
    addEventHandler ( "onPlayerStartSpeakerBoxSound", root, function ( who, url, isCar )
    if ( isElement ( speakerSound [ who ] ) ) then destroyElement ( speakerSound [ who ] ) end
    local x, y, z = getElementPosition ( who )
    speakerSound [ who ] = playSound3D ( url, x, y, z, true )
    setSoundVolume ( speakerSound [ who ], 1 )
    setSoundMinDistance ( speakerSound [ who ], 13 )
    setSoundMaxDistance ( speakerSound [ who ], 18 )
    local int = getElementInterior ( who )
    setElementInterior ( speakerSound [ who ], int )
    setElementDimension ( speakerSound [ who ], getElementDimension ( who ) )
    if ( isCar ) then
    local car = getPedOccupiedVehicle ( who )
    attachElements ( speakerSound [ who ], car, 0, 5, 1 )
    end
    end )

    addEvent ( "onPlayerDestroySpeakerBox", true )
    addEventHandler ( "onPlayerDestroySpeakerBox", root, function ( who )
    if ( isElement ( speakerSound [ who ] ) ) then
    destroyElement ( speakerSound [ who ] )
    end
    end )

    --------------------------
    -- Volume --
    --------------------------
    addEvent ( "onPlayerChangeSpeakerBoxVolumeC", true )
    addEventHandler ( "onPlayerChangeSpeakerBoxVolumeC", root, function ( who, vol )
    if ( isElement ( speakerSound [ who ] ) ) then
    setSoundVolume ( speakerSound [ who ], tonumber ( vol ) )
    end
    end )

    function isURL ( )
    if ( guiGetText ( url ) ~= "" ) then
    return true
    else
    return false
    end
    end

    function math.round(number, decimals, method)
    decimals = decimals or 0
    local factor = 10 ^ decimals
    if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor else return tonumber(("%."..decimals.."f"):format(number)) end

    Im anhang server.lua

    Soooo jetzt habe ich nur noch xupdate\server\core.lua:127: dbpoll failed; No database selected, aber ich habe alles richtig eingestellt, db nammen richtig eingegeben mysql is mit Navicat erichbar also an.

    Das is der Block für die regi

    Spoiler anzeigen

    dbHandler = dbConnect("mysql","neww;127.0.0.1","root","12qwasyx")


    addEvent("registerNewPlayer",true)
    addEventHandler("registerNewPlayer", root, function(player, name, pw)
    --outputDebugString("K")
    local query = dbQuery(dbHandler,"SELECT * FROM accounts WHERE name = ?", name)
    local row = dbPoll(query,-1)
    if row == 0 then
    local exec = dbExec(dbHandler,"INSERT INTO accounts (name) VALUES(?)", name)
    if exec then
    local carlights = {buy = "false", color = "none", policelights = "false"}
    local headlights = {buy = "false", color = "none", pulsating = "false", policelights = "false"}
    local rims = {buy = "false", typ = "none" }
    local skin = {buy = "false", model = "none" }
    local lights = {buy = "false", model = "none"}
    local rainbowlights = {buy = "false", enable = "false"}
    local vehicleskin = {buy = "false", model = "none"}
    local exec2 = dbExec(dbHandler,"UPDATE accounts SET password = ?,\
    serial = '"..getPlayerSerial(player).."',\
    grank = 0,\
    points = 0,\
    money = 0,\
    dmtts = 0,\
    dmwins = 0,\
    ddwins = 0,\
    shooterwins = 0,\
    shooterrockets = 0,\
    shooterkills = 0,\
    bombwins = 0,\
    racewins = 0,\
    racetts = 0,\
    trialwins = 0,\
    trialtts = 0,\
    playtime = 0,\
    donator = 0,\
    team = 0,\
    freetokens = 0,\
    carlights = '"..toJSON(carlights).."',\
    headlights = '"..toJSON(headlights).."',\
    mapsplayed = 0,\
    rims = '"..toJSON(rims).."',\
    skin = '"..toJSON(skin).."',\
    serverjoined = 0,\
    mapsbought = 0,\
    lightskin = '"..toJSON(lights).."',\
    rainbowlights = '"..toJSON(rainbowlights).."',\
    vehicleskin = '"..toJSON(vehicleskin).."' WHERE name = ?", md5(pw), name)
    if exec2 then
    triggerClientEvent(player,"removeLoginPanel",root)
    triggerClientEvent(player,"startSelectionMode",root)
    triggerClientEvent(player,"addNotification",root,"Account successfully created", 1)
    bindKey(player,"F1","down",function()
    startSelection(player)
    end)
    end
    end
    else
    triggerClientEvent(player,"addNotification",root,"Accountname exists", 2)
    end
    dbFree(query)
    end)

    So habe jetzt noch mall alles neue Eingesttelt neue db , alles 3-10 fach überprüft, habe aber 1 fehler wen ich auf register klicke :

    Lua
    [2013-07-01 19:56:31] WARNING: xupdate\server\core.lua:127: dbPoll failed; No database selected[2013-07-01 19:56:31] ERROR: xupdate\server\core.lua:128: attempt to get length of local 'row' (a boolean value)

    Und ich habe alles eingetragen , alles überprüft usw, aber es geht nicht

    So jetzt habe ich nur noch den fehler wen ich auf registriren klicke dan kommt das :

    Spoiler anzeigen

    [2013-07-01 16:46:33] WARNING: xupdate\server\core.lua:127: dbPoll failed; No database selected
    [2013-07-01 16:46:33] ERROR: xupdate\server\core.lua:128: attempt to get length of local 'row' (a boolean value)


    Hier is der Code von Zeile 127:

    Lua
    local query = dbQuery(dbHandler,"SELECT * FROM accounts WHERE name = ?", name)


    Hier is der Code von Zeile 128:

    Lua
    local row = dbPoll(query,-1)