Jump to content

ertlflorian1

Members
  • Posts

    145
  • Joined

  • Last visited

Everything posted by ertlflorian1

  1. I have a problem when I start the gamemode (selfmade) and connect to the server to Register panel come, and I get this error: When I reconnect then it works perfect and i get no error??? Client : function registerfunc (name) Fenster = guiCreateWindow(screenx/2-registerw/2,screeny/2-registerh/2, registerw, registerh, "Herzlich Willkommen", false) guiWindowSetSizable(Fenster, false) usw.. end addEvent ("onGuiRegister", true) addEventHandler ("onGuiRegister", getRootElement(), registerfunc) Server: function selfOnCon () local name = getPlayerName (source) local player = getPlayerFromName (name) local ip = getPlayerIP (source) local serial = getPlayerSerial (source) if (ifnameexists(name) == true) then triggerClientEvent (source, "onGuiLogin", source,name) elseif (ifnameexists(name) == false) then if (ifserialexists(serial) == false) then triggerClientEvent (source, "onGuiRegister", source,name) else kickPlayer (player, "Console", "Du hast bereits einen Account!") end end end addEventHandler ("onPlayerJoin", getRootElement(), selfOnCon) I also get this error on every Gamemode start:
  2. Hi i will when # is in an players name he must be kicked? function bannCheck ( nick) local search = string.find (nick, #) if search == true then cancelEvent (true, "Your name contains an Colorcode!") end end addEventHandler ( "onPlayerConnect", getRootElement(), bannCheck ) It wouldnt work
  3. Thanks destoyElement Error is now away but now: its this line: setElementData ( getPedOccupiedVehicle ( getLocalPlayer () ), "liveradio.radio" .. getElementData ( getLocalPlayer (), "liveradio.seat" ),
  4. Hi i have an radio script : it works perfect but i get this errors local xml = xmlLoadFile ( "settings.xml" ) local nodeColor = xmlFindChild ( xml, "color", 0 ) local nodeFont = xmlFindChild ( xml, "font", 0 ) local nodeStations = xmlFindChild ( xml, "stations", 0 ) local label = guiCreateLabel ( 0, 0, 1, 0.1, "Radio off", true ) guiLabelSetColor ( label, xmlNodeGetAttribute ( nodeColor, "r" ), xmlNodeGetAttribute ( nodeColor, "g" ), xmlNodeGetAttribute ( nodeColor, "b" ) ) guiLabelSetHorizontalAlign ( label, "center" ) guiSetFont ( label, xmlNodeGetValue ( nodeFont ) ) guiSetVisible ( label, false ) addEventHandler ( "onClientResourceStart", getResourceRootElement (), function () showPlayerHudComponent ( "radio", false ) for k, v in ipairs ( getElementsByType ( "vehicle" ) ) do setElementData ( v, "liveradio.radio0", false ) setElementData ( v, "liveradio.radio1", false ) setElementData ( v, "liveradio.radio2", false ) setElementData ( v, "liveradio.radio3", false ) end end ) addEventHandler ( "onClientResourceStop", getResourceRootElement (), function () showPlayerHudComponent ( "radio", true ) end ) addEventHandler ( "onClientPlayerWasted", getLocalPlayer (), function () if isElement ( sound ) then stopSound ( sound ) destroyElement ( sound ) end guiSetVisible ( label, false ) setElementData ( getLocalPlayer (), "liveradio.radio", 0 ) end ) addEventHandler ( "onClientPlayerVehicleEnter", getLocalPlayer (), function ( vehicle, seat ) setRadioChannel ( 0 ) setElementData ( getLocalPlayer (), "liveradio.seat", seat ) if getElementData ( vehicle, "liveradio.radio" .. seat ) then setElementData ( getLocalPlayer (), "liveradio.radio", getElementData ( vehicle, "liveradio.radio" .. seat ) ) else for k, v in ipairs ( xmlNodeGetChildren ( nodeStations ) ) do setElementData ( getLocalPlayer (), "liveradio.radio", k ) end setElementData ( getLocalPlayer (), "liveradio.radio", math.random ( getElementData ( getLocalPlayer (), "liveradio.radio" ) ) ) setElementData ( vehicle, "liveradio.radio" .. seat, getElementData ( getLocalPlayer (), "liveradio.radio" ) ) end if isElement ( sound ) then stopSound ( sound ) destroyElement ( sound ) end local nodeStation = xmlFindChild ( nodeStations, "station", getElementData ( vehicle, "liveradio.radio" .. seat ) - 1 ) local radioName = xmlNodeGetAttribute ( nodeStation, "name" ) local radioURL = xmlNodeGetAttribute ( nodeStation, "URL" ) sound = playSound ( radioURL ) guiSetText ( label, radioName ) guiSetVisible ( label, true ) if isTimer ( timer ) then killTimer ( timer ) end timer = setTimer ( guiSetVisible, 5000, 1, label, false ) end ) addEventHandler ( "onClientPlayerRadioSwitch", getLocalPlayer (), function ( station ) if station ~= 0 then cancelEvent () end if station == 1 then setElementData ( getLocalPlayer (), "liveradio.radio", getElementData ( getLocalPlayer (), "liveradio.radio" ) + 1 ) elseif station == 12 then setElementData ( getLocalPlayer (), "liveradio.radio", getElementData ( getLocalPlayer (), "liveradio.radio" ) - 1 ) if getElementData ( getLocalPlayer (), "liveradio.radio" ) == -1 then for k, v in ipairs ( xmlNodeGetChildren ( nodeStations ) ) do setElementData ( getLocalPlayer (), "liveradio.radio", k ) end end end setElementData ( getPedOccupiedVehicle ( getLocalPlayer () ), "liveradio.radio" .. getElementData ( getLocalPlayer (), "liveradio.seat" ), getElementData ( getLocalPlayer (), "liveradio.radio" ) ) local nodeStation = xmlFindChild ( nodeStations, "station", getElementData ( getLocalPlayer (), "liveradio.radio" ) - 1 ) if isElement ( sound ) then stopSound ( sound ) destroyElement ( sound ) end if nodeStation then local radioName = xmlNodeGetAttribute ( nodeStation, "name" ) local radioURL = xmlNodeGetAttribute ( nodeStation, "URL" ) sound = playSound ( radioURL ) guiSetText ( label, radioName ) guiSetVisible ( label, true ) if isTimer ( timer ) then killTimer ( timer ) end timer = setTimer ( guiSetVisible, 5000, 1, label, false ) else guiSetText ( label, "Radio Off" ) guiSetVisible ( label, true ) setElementData ( getLocalPlayer (), "liveradio.radio", 0 ) if isTimer ( timer ) then killTimer ( timer ) end timer = setTimer ( guiSetVisible, 5000, 1, label, false ) end end ) addEventHandler ( "onClientVehicleStartExit", getRootElement (), function ( player ) if player == getLocalPlayer () then if isElement ( sound ) then stopSound ( sound ) destroyElement ( sound ) end guiSetVisible ( label, false ) setElementData ( player, "liveradio.radio", 0 ) end end ) addEventHandler ( "onClientVehicleExit", getRootElement (), function ( player ) if player == getLocalPlayer () then if isElement ( sound ) then stopSound ( sound ) destroyElement ( sound ) end guiSetVisible ( label, false ) setElementData ( player, "liveradio.radio", 0 ) end end ) i get this errors in debugscipt:
  5. OMG so an fucking mistake thank you so much
  6. Hi i have a problem with my script so it works : function selfOnCon () local name = getPlayerName (source) local player = getPlayerFromName (name) local ip = getPlayerIP (source) local serial = getPlayerSerial (source) local query = dbQuery ( handler2, "SELECT * FROM userdata WHERE Name=?",name ) result , numrows, errmsg = dbPoll (query, -1) local row = result[1] if row then triggerClientEvent (source, "onPlayerGuiLogin", source,name) elseif not row then local query = dbQuery ( handler2, "SELECT * FROM userdata WHERE Serial=?",serial ) result , numrows, errmsg = dbPoll (query, -1) local row = result[1] if not row then triggerClientEvent (source, "onPlayerGuiRegister", source,name) else kickPlayer (player, "Console", "Du hast bereits einen Account!") end end end addEventHandler ("onPlayerJoin", getRootElement(), selfOnCon) but it wouldn work so: function selfOnCon () local name = getPlayerName (source) local player = getPlayerFromName (name) local ip = getPlayerIP (source) local serial = getPlayerSerial (source) if (ifnameexists(pname) == true) then triggerClientEvent (source, "onPlayerGuiLogin", source,name) elseif (ifnameexists(pname) == false) then if (ifserialexists(serial) == false) then triggerClientEvent (source, "onPlayerGuiRegister", source,name) else kickPlayer (player, "Console", "Du hast bereits einen Account!") end end end addEventHandler ("onPlayerJoin", getRootElement(), selfOnCon) function ifnameexists (pname) local query = dbQuery ( handler2, "SELECT * FROM userdata WHERE Name=?",pname ) result , numrows, errmsg = dbPoll (query, -1) local row = result[1] if row then return true else return false end end function ifserialexists (serial) local query = dbQuery ( handler2, "SELECT * FROM userdata WHERE Serial=?",serial ) result , numrows, errmsg = dbPoll (query, -1) local row = result[1] if row then return true else return false end end By the second script i will be kicked although when im logging in with the original name and serial with who are in mysql?
  7. You are right. Thank you so much i have learned from my mistake.
  8. My code now seems like : server: function outputcode (gme) local pname = getPlayerName (gme) if (fileExists ("koordinaten.xml") ) then local rootnode = xmlLoadFile("koordinaten.xml") local children = xmlNodeGetChildren(rootnode) for index, node in ipairs(children) do local xx = tonumber(xmlNodeGetAttribute(node, "x")) local yy = tonumber(xmlNodeGetAttribute(node, "y")) local zz = tonumber(xmlNodeGetAttribute(node, "z")) triggerClientEvent ("guittf", root, index,xx, yy, zz) end end end addEvent ("on1", true) addEventHandler("on1", getRootElement(), outputcode) client: ........... tff = guiCreateMemo(10, 81, 489, 443, "Klicke auf eine Zahl!", false, OutputFenster) ............ function newertext (index,xx, yy, zz) local text = string.format ("%s %d, %d, %d", guiGetText ( tff ), xx, yy, zz ); guiSetText ( tff, '['..index..']="'..text..'",' ); end addEvent ("guittf", true) addEventHandler ("guittf", getRootElement(), newertext) in the EditBox it seems so: [3]=[2]=[1]= -751.2763671875, 1008.7109375, 16.795833587646, -754.0029296875, 1010.09375, 17.559013366699, -756.8203125, 1011.521484375, 18.040607452393, How i can make that it seems so: [1]="-751.2763671875, 1008.7109375, 16.795833587646", [2]="-754.0029296875, 1010.09375, 17.559013366699", [3]="-756.8203125, 1011.521484375, 18.040607452393",
  9. Why it dont work? local text = string.format ("%s %s, %s, %s", guiGetText ( tff ), xx, yy, zz ); guiSetText ( tff, '['..index..']="'..text..'",' );
  10. Another Question how can i make that (where number??) that that will numbered consecutively guiSetText ( tff, '[number??]="'..text..'",' );
  11. Thank you I have solved it now local text = string.format ( "%s %s, %s, %s", guiGetText ( tff ), xx, yy, zz ); guiSetText ( tff, text );
  12. I will that it dont look like -2434, -596, 132 but rather -2434.854156414, -596.56486, 132.486421884
  13. Thank you so much but i will that it dont look so -2434, -596, 132 but so -2434.854156414, -596.56486, 132.486421884 sorry for really bad english
  14. I mean like this guiSetText (tff, xx..", "..yy..", "..zz.."\n") But ther will only be shown the first entry of the xml.
  15. Thanks another Question how i can set that such every koordinates a new line will beginn? this ist the memo: tff = guiCreateMemo(20, 145, 478, 368, "\n", false, OutputFenster) function newertext (xx, yy, zz) guiSetText (tff, xx..", "..yy..", "..zz) end addEvent ("guittf", true) addEventHandler ("guittf", getRootElement(), newertext)
  16. Hi please help me my script don't work?? for index, node in ipairs(children) do local xx = tonumber(xmlNodeGetAttribute(node, "x")) local yy = tonumber(xmlNodeGetAttribute(node, "y")) local zz = tonumber(xmlNodeGetAttribute(node, "z")) triggerClientEvent (getRootElement(), "guittf", xx, yy, zz) [/][14:54:25] WARNING: pos\server.lua:103: Bad argument @ 'triggerClientEvent' [Expected element at argument 3, got number '2385.53515625'][14:54:25] WARNING: pos\server.lua:103: Bad argument @ 'triggerClientEvent' [Expected element at argument 3, got number '2342.5126953125'][14:54:25] WARNING: pos\server.lua:103: Bad argument @ 'triggerClientEvent' [Expected element at argument 3, got number '2342.841796875'][14:54:25] WARNING: pos\server.lua:103: Bad argument @ 'triggerClientEvent' [Expected element at argument 3, got number '2341.5732421875'][14:54:25] WARNING: pos\server.lua:103: Bad argument @ 'triggerClientEvent' [Expected element at argument 3, got number '2341.49609375'][14:54:25] WARNING: pos\server.lua:103: Bad argument @ 'triggerClientEvent' [Expected element at argument 3, got number '2342.712890625'][14:54:25] WARNING: pos\server.lua:103: Bad argument @ 'triggerClientEvent' [Expected element at argument 3, got number '2340.861328125'][14:54:25] WARNING: pos\server.lua:103: Bad argument @ 'triggerClientEvent' [Expected element at argument 3, got number '2342.4248046875'][14:54:25] WARNING: pos\server.lua:103: Bad argument @ 'triggerClientEvent' [Expected element at argument 3, got number '2341.888671875'][14:54:25] WARNING: pos\server.lua:103: Bad argument @ 'triggerClientEvent' [Expected element at argument 3, got number '2343.8037109375']
  17. Hi i have an problem there will be always showerror triggered, when the xml exists and when not please help me I will wen the xml exists then the first part will happen else show error must be triggered addEventHandler ("onClientGUIClick", getRootElement(), function (state) if state == "left" then if source == but1 then gme = getLocalPlayer() pname = getPlayerName (gme) if (fileExists ("koordinaten.xml") )then local rootnode = xmlLoadFile("koordinaten.xml") local children = xmlNodeGetChildren(rootnode) for index, node in ipairs(children) do local xx = tonumber(xmlNodeGetAttribute(node, "x")) local yy = tonumber(xmlNodeGetAttribute(node, "y")) local zz = tonumber(xmlNodeGetAttribute(node, "z")) guiSetText (text, xx..", "..yy..", "..zz..", ") end else triggerServerEvent ("showerror", getRootElement(), pname) end end end end) Sorry for my very bad english
  18. I dont know the problem cann you edit it for me?
×
×
  • Create New...