raynner Posted September 5, 2015 Share Posted September 5, 2015 (edited) It is taking place the following error! in cmd WARNING: PTags\server.lua:2: Bad argument @ 'getPlayerAccount' [Expected element at argument 1, got nil] WARNING: PTags\server.lua:2: Bad argument @ 'getAccountName' [Expected account at argument 1, got boolean] Client function function Tag1Name () local jugadorseleccionado = guiGridListGetItemText(GridJugadores3, guiGridListGetSelectedItem(GridJugadores3), 1) local NombreJug = getPlayerFromName(jugadorseleccionado) local admin = getLocalPlayer() triggerServerEvent("addtag1", root, NombreJug, admin) end addEventHandler ("onClientGUIClick", Tag1, Tag1Name ,false) Server function function add1 (commandName, accountName) local accountName = getAccountName(getPlayerAccount(NombreJug)) if accountName then aclGroupAddObject (aclGetGroup("Admin"), "user."..accountName) outputChatBox ("Painel TAG: Conta '"..accountName.."' Foi Adcionada com sucesso ao Grupo.", admin) else outputChatBox ("Painel TAG: Conta Não Especificada.", admin) outputChatBox ("Painel TAG: Selecione um Player na Lista.", admin) end end addEvent( "addtag1", true ) addEventHandler( "addtag1", root, add1 ) Edited November 5, 2015 by Guest Link to comment
JR10 Posted September 5, 2015 Share Posted September 5, 2015 NombreJug is not defined and neither is admin. Link to comment
raynner Posted September 6, 2015 Author Share Posted September 6, 2015 (edited) JR10 how do I define them if (not isElement(NombreJug)) then ??? Edited November 5, 2015 by Guest Link to comment
DNL291 Posted September 6, 2015 Share Posted September 6, 2015 You aren't getting the argument sent to the function 'add1'. function Tag1Name () local jugadorseleccionado = guiGridListGetItemText(GridJugadores3, guiGridListGetSelectedItem(GridJugadores3), 1) triggerServerEvent("addtag1", localPlayer, getPlayerFromName(jugadorseleccionado)) end addEventHandler ("onClientGUIClick", Tag1, Tag1Name ,false) function add1 (thePlayer) if not (isElement(thePlayer)) then return end; local accountName = getAccountName(getPlayerAccount(thePlayer)) if accountName then aclGroupAddObject (aclGetGroup("Admin"), "user."..accountName) outputChatBox ("Painel TAG: Conta '"..accountName.."' Foi Adcionada com sucesso ao Grupo.", client) else outputChatBox ("Painel TAG: Conta Não Especificada.", client) outputChatBox ("Painel TAG: Selecione um Player na Lista.", client) end end addEvent( "addtag1", true ) addEventHandler( "addtag1", root, add1 ) Try it. Link to comment
raynner Posted September 6, 2015 Author Share Posted September 6, 2015 our work thanks! : D as I close the topic ?? 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