Erknneto Posted May 4, 2014 Share Posted May 4, 2014 Hey, I need help with my Spawn Selector, ok, it is for the gamemode DayZ, I made this script to spawn when the player that he click a button and be teleported to the Spawn Wanted! Everything works correctly, more gives an error when the player clicks, the panel closes it is not teleported to the coordinated Error in console: [2014-04-29 19:20:56] WARNING: [DayZ-MTA]\DayZ\spawnselectors.lua:10: Bad argument @ 'setElementPosition' [Expected element at argument 1, got nil] client.lua (SelecaoSexo.lua) function sexo() showCursor(true) wal = -- Walpaper \/ guiCreateStaticImage(0, 0, 1, 1, "images/wal.jpg", true) fundo = -- Imagem de fundo onde irá ficar a opção de escolha \/ guiCreateWindow(313, 173, 412, 331, "SELECT YOUR SPAWN - ELITE ZOMBIE", false, wal) guiWindowSetMovable(fundo, false) guiWindowSetSizable(fundo, false) click = -- bagulho escrito la poha guiCreateLabel(9, 30, 316, 16, "Click a button to select your spawn | Do not Spawn Kill |", false, fundo) guiSetFont(click, "default-bold-small") bony = -- botau de bony guiCreateButton(10, 75, 130, 72, "-- Bone County --", false, fundo) guiSetFont(bony, "default-bold-small") tierra = guiCreateButton(150, 75, 130, 72, "-- Tierra Robada --", false, fundo) guiSetFont(tierra, "default-bold-small") area51 = guiCreateButton(290, 75, 108, 72, "-- Área 51 --\n*Proximidades*", false, fundo) guiSetFont(area51, "default-bold-small") sf = guiCreateButton(9, 157, 130, 72, "-- San Fierro --", false, fundo) guiSetFont(sf, "default-bold-small") angel = guiCreateButton(150, 157, 130, 72, "-- Angel Pine --", false, fundo) guiSetFont(angel, "default-bold-small") montanha = guiCreateButton(290, 157, 108, 72, "-- Montanhas --\n*Los Santos*", false, fundo) guiSetFont(montanha, "default-bold-small") praia = guiCreateButton(9, 239, 130, 72, "-- Praia de LS --\n*LS = Los Santos*", false, fundo) guiSetFont(praia, "default-bold-small") aero = guiCreateButton(150, 239, 130, 72, "-- Aeroporto --\n*Los Santos*", false, fundo) guiSetFont(aero, "default-bold-small") ls = guiCreateButton(290, 239, 108, 72, "-- Los Santos --\n*Interior*", false, fundo) guiSetFont(ls, "default-bold-small") addEventHandler("onClientGUIClick", bony, spawnbony) -- função de bony county addEventHandler("onClientGUIClick", tierra, spawntierra) -- função de tierra robada addEventHandler("onClientGUIClick", area51, spawn51) -- função da área 51 addEventHandler("onClientGUIClick", sf, spawnsf) -- função de san fierro addEventHandler("onClientGUIClick", angel, spawnangel) -- função de angel pine addEventHandler("onClientGUIClick", montanha, spawnmontanha) -- função das montanhas addEventHandler("onClientGUIClick", praia, spawnpraia) -- função da praia de ls addEventHandler("onClientGUIClick", aero, spawnaero) -- função do aero krl addEventHandler("onClientGUIClick", ls, spawnls) -- função de ls interior --[[ for i, data in ipairs(playerDataTable) do if data[1] == "skin" then setElementModel(localPlayer, 73) end end ]] end addEvent("sex",true) addEventHandler("sex",root,sexo) ----------------------------------------------------------------------- -- FUNÇÕES DOS BOTÕES - EDITAVEIS NO OUTRO ARQUIVO function spawnbony () showCursor(false) destroyElement(wal) destroyElement(fundo) destroyElement(click) destroyElement(bony) destroyElement(tierra) destroyElement(area51) destroyElement(sf) destroyElement(angel) destroyElement(montanha) destroyElement(praia) destroyElement(aero) destroyElement(ls) triggerServerEvent ( "bonyconty", getLocalPlayer() ) end end function spawntierra () showCursor(false) destroyElement(wal) destroyElement(fundo) destroyElement(click) destroyElement(bony) destroyElement(tierra) destroyElement(area51) destroyElement(sf) destroyElement(angel) destroyElement(montanha) destroyElement(praia) destroyElement(aero) destroyElement(ls) triggerServerEvent ( "tierrarobada", getLocalPlayer() ) end function spawn51 () showCursor(false) destroyElement(wal) destroyElement(fundo) destroyElement(click) destroyElement(bony) destroyElement(tierra) destroyElement(area51) destroyElement(sf) destroyElement(angel) destroyElement(montanha) destroyElement(praia) destroyElement(aero) destroyElement(ls) triggerServerEvent ( "poha51", getLocalPlayer() ) end function spawnsf () showCursor(false) destroyElement(wal) destroyElement(fundo) destroyElement(click) destroyElement(bony) destroyElement(tierra) destroyElement(area51) destroyElement(sf) destroyElement(angel) destroyElement(montanha) destroyElement(praia) destroyElement(aero) destroyElement(ls) triggerServerEvent ( "sfpoha", getLocalPlayer() ) end function spawnangel () showCursor(false) destroyElement(wal) destroyElement(fundo) destroyElement(click) destroyElement(bony) destroyElement(tierra) destroyElement(area51) destroyElement(sf) destroyElement(angel) destroyElement(montanha) destroyElement(praia) destroyElement(aero) destroyElement(ls) triggerServerEvent ( "angelpinepoha", getLocalPlayer() ) end function spawnmontanha () showCursor(false) destroyElement(wal) destroyElement(fundo) destroyElement(click) destroyElement(bony) destroyElement(tierra) destroyElement(area51) destroyElement(sf) destroyElement(angel) destroyElement(montanha) destroyElement(praia) destroyElement(aero) destroyElement(ls) triggerServerEvent ( "montanhamarota", getLocalPlayer() ) end function spawnpraia () showCursor(false) destroyElement(wal) destroyElement(fundo) destroyElement(click) destroyElement(bony) destroyElement(tierra) destroyElement(area51) destroyElement(sf) destroyElement(angel) destroyElement(montanha) destroyElement(praia) destroyElement(aero) destroyElement(ls) triggerServerEvent ( "lspraia", getLocalPlayer() ) end function spawnaero () showCursor(false) destroyElement(wal) destroyElement(fundo) destroyElement(click) destroyElement(bony) destroyElement(tierra) destroyElement(area51) destroyElement(sf) destroyElement(angel) destroyElement(montanha) destroyElement(praia) destroyElement(aero) destroyElement(ls) triggerServerEvent ( "aeru", getLocalPlayer() ) end function spawnls () showCursor(false) destroyElement(wal) destroyElement(fundo) destroyElement(click) destroyElement(bony) destroyElement(tierra) destroyElement(area51) destroyElement(sf) destroyElement(angel) destroyElement(montanha) destroyElement(praia) destroyElement(aero) destroyElement(ls) triggerServerEvent ( "interioacre", getLocalPlayer() ) end ----------------------------------------------------------------------- server.lua (spawnselectors.lua) --Bony County function bonyconty (player) setElementPosition ( player, 318, 2897, 45 ) end addEvent( "bonyconty", true ) addEventHandler( "bonyconty", getRootElement(), bonyconty ) --Tierra Robada function tierrarobada (player) setElementPosition ( player, -1682, 2645, 68 ) end addEvent( "tierrarobada", true ) addEventHandler( "tierrarobada", getRootElement(), tierrarobada ) --Área 51 function poha51 (player) setElementPosition ( player, -528, 1968, 60 ) end addEvent( "poha51", true ) addEventHandler( "poha51", getRootElement(), poha51 ) --San fierro function sfpoha (player) setElementPosition ( player, -1983, 1116, 53 ) end addEvent( "sfpoha", true ) addEventHandler( "sfpoha", getRootElement(), sfpoha ) --Angel Pine function angelpinepoha (player) setElementPosition ( player, -2038, -2388, 30 ) end addEvent( "angelpinepoha", true ) addEventHandler( "angelpinepoha", getRootElement(), angelpinepoha ) --Montanhas function montanhamarota (player) setElementPosition ( player, 298, -1158, 80 ) end addEvent( "montanhamarota", true ) addEventHandler( "montanhamarota", getRootElement(), montanhamarota ) --Praia de LS function lspraia (player) setElementPosition ( player, 627, -1919, 0 ) end addEvent( "lspraia", true ) addEventHandler( "lspraia", getRootElement(), lspraia ) --Aero de LS function aeru (player) setElementPosition ( player, 1954, -2188, 13 ) end addEvent( "aeru", true ) addEventHandler( "aeru", getRootElement(), aeru ) --Interior LS function interioacre (player) setElementPosition ( player, 1306, 63, 21 ) end addEvent( "interioacre", true ) addEventHandler( "interioacre", getRootElement(), interioacre ) I'm Brazilian so this panel is mixed a bit of banter with a Brazilian! I believe you have something very simple wrong with that ... Sorry my bad english, I did it by Google Translate! Help me please!!!! I know only a little '.lua' so I can not decipher this error, I think somebody help me! Link to comment
.:HyPeX:. Posted May 4, 2014 Share Posted May 4, 2014 You're sending the player as source, but not as argument. You should also send it as argument for as the function to recive the argument. You should change this one, or edit the other script to make it use source instead of the argument. function sexo() showCursor(true) wal = -- Walpaper \/ guiCreateStaticImage(0, 0, 1, 1, "images/wal.jpg", true) fundo = -- Imagem de fundo onde irá ficar a opção de escolha \/ guiCreateWindow(313, 173, 412, 331, "SELECT YOUR SPAWN - ELITE ZOMBIE", false, wal) guiWindowSetMovable(fundo, false) guiWindowSetSizable(fundo, false) click = -- bagulho escrito la poha guiCreateLabel(9, 30, 316, 16, "Click a button to select your spawn | Do not Spawn Kill |", false, fundo) guiSetFont(click, "default-bold-small") bony = -- botau de bony guiCreateButton(10, 75, 130, 72, "-- Bone County --", false, fundo) guiSetFont(bony, "default-bold-small") tierra = guiCreateButton(150, 75, 130, 72, "-- Tierra Robada --", false, fundo) guiSetFont(tierra, "default-bold-small") area51 = guiCreateButton(290, 75, 108, 72, "-- Área 51 --\n*Proximidades*", false, fundo) guiSetFont(area51, "default-bold-small") sf = guiCreateButton(9, 157, 130, 72, "-- San Fierro --", false, fundo) guiSetFont(sf, "default-bold-small") angel = guiCreateButton(150, 157, 130, 72, "-- Angel Pine --", false, fundo) guiSetFont(angel, "default-bold-small") montanha = guiCreateButton(290, 157, 108, 72, "-- Montanhas --\n*Los Santos*", false, fundo) guiSetFont(montanha, "default-bold-small") praia = guiCreateButton(9, 239, 130, 72, "-- Praia de LS --\n*LS = Los Santos*", false, fundo) guiSetFont(praia, "default-bold-small") aero = guiCreateButton(150, 239, 130, 72, "-- Aeroporto --\n*Los Santos*", false, fundo) guiSetFont(aero, "default-bold-small") ls = guiCreateButton(290, 239, 108, 72, "-- Los Santos --\n*Interior*", false, fundo) guiSetFont(ls, "default-bold-small") addEventHandler("onClientGUIClick", bony, spawnbony) -- função de bony county addEventHandler("onClientGUIClick", tierra, spawntierra) -- função de tierra robada addEventHandler("onClientGUIClick", area51, spawn51) -- função da área 51 addEventHandler("onClientGUIClick", sf, spawnsf) -- função de san fierro addEventHandler("onClientGUIClick", angel, spawnangel) -- função de angel pine addEventHandler("onClientGUIClick", montanha, spawnmontanha) -- função das montanhas addEventHandler("onClientGUIClick", praia, spawnpraia) -- função da praia de ls addEventHandler("onClientGUIClick", aero, spawnaero) -- função do aero krl addEventHandler("onClientGUIClick", ls, spawnls) -- função de ls interior --[[ for i, data in ipairs(playerDataTable) do if data[1] == "skin" then setElementModel(localPlayer, 73) end end ]] end addEvent("sex",true) addEventHandler("sex",root,sexo) ----------------------------------------------------------------------- -- FUNÇÕES DOS BOTÕES - EDITAVEIS NO OUTRO ARQUIVO function spawnbony () showCursor(false) destroyElement(wal) destroyElement(fundo) destroyElement(click) destroyElement(bony) destroyElement(tierra) destroyElement(area51) destroyElement(sf) destroyElement(angel) destroyElement(montanha) destroyElement(praia) destroyElement(aero) destroyElement(ls) triggerServerEvent ( "bonyconty", getLocalPlayer(),getLocalPlayer() ) end end function spawntierra () showCursor(false) destroyElement(wal) destroyElement(fundo) destroyElement(click) destroyElement(bony) destroyElement(tierra) destroyElement(area51) destroyElement(sf) destroyElement(angel) destroyElement(montanha) destroyElement(praia) destroyElement(aero) destroyElement(ls) triggerServerEvent ( "tierrarobada", getLocalPlayer(),getLocalPlayer() ) end function spawn51 () showCursor(false) destroyElement(wal) destroyElement(fundo) destroyElement(click) destroyElement(bony) destroyElement(tierra) destroyElement(area51) destroyElement(sf) destroyElement(angel) destroyElement(montanha) destroyElement(praia) destroyElement(aero) destroyElement(ls) triggerServerEvent ( "poha51", getLocalPlayer(),getLocalPlayer() ) end function spawnsf () showCursor(false) destroyElement(wal) destroyElement(fundo) destroyElement(click) destroyElement(bony) destroyElement(tierra) destroyElement(area51) destroyElement(sf) destroyElement(angel) destroyElement(montanha) destroyElement(praia) destroyElement(aero) destroyElement(ls) triggerServerEvent ( "sfpoha", getLocalPlayer(),getLocalPlayer() ) end function spawnangel () showCursor(false) destroyElement(wal) destroyElement(fundo) destroyElement(click) destroyElement(bony) destroyElement(tierra) destroyElement(area51) destroyElement(sf) destroyElement(angel) destroyElement(montanha) destroyElement(praia) destroyElement(aero) destroyElement(ls) triggerServerEvent ( "angelpinepoha", getLocalPlayer(),getLocalPlayer() ) end function spawnmontanha () showCursor(false) destroyElement(wal) destroyElement(fundo) destroyElement(click) destroyElement(bony) destroyElement(tierra) destroyElement(area51) destroyElement(sf) destroyElement(angel) destroyElement(montanha) destroyElement(praia) destroyElement(aero) destroyElement(ls) triggerServerEvent ( "montanhamarota", getLocalPlayer(),getLocalPlayer() ) end function spawnpraia () showCursor(false) destroyElement(wal) destroyElement(fundo) destroyElement(click) destroyElement(bony) destroyElement(tierra) destroyElement(area51) destroyElement(sf) destroyElement(angel) destroyElement(montanha) destroyElement(praia) destroyElement(aero) destroyElement(ls) triggerServerEvent ( "lspraia", getLocalPlayer(),getLocalPlayer() ) end function spawnaero () showCursor(false) destroyElement(wal) destroyElement(fundo) destroyElement(click) destroyElement(bony) destroyElement(tierra) destroyElement(area51) destroyElement(sf) destroyElement(angel) destroyElement(montanha) destroyElement(praia) destroyElement(aero) destroyElement(ls) triggerServerEvent ( "aeru", getLocalPlayer(),getLocalPlayer() ) end function spawnls () showCursor(false) destroyElement(wal) destroyElement(fundo) destroyElement(click) destroyElement(bony) destroyElement(tierra) destroyElement(area51) destroyElement(sf) destroyElement(angel) destroyElement(montanha) destroyElement(praia) destroyElement(aero) destroyElement(ls) triggerServerEvent ( "interioacre", getLocalPlayer(),getLocalPlayer() ) end ----------------------------------------------------------------------- Link to comment
Erknneto Posted May 4, 2014 Author Share Posted May 4, 2014 .:HyPeX:.the one you gave me will work? Sorry but I do not quite understand it Link to comment
.:HyPeX:. Posted May 4, 2014 Share Posted May 4, 2014 .:HyPeX:.the one you gave me will work? Sorry but I do not quite understand it Just replace the one you have with the one i pasted, it should work. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now