raynner Posted September 5, 2015 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 don´t is necessari
JR10 Posted September 5, 2015 Posted September 5, 2015 NombreJug is not defined and neither is admin. Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
raynner Posted September 6, 2015 Author Posted September 6, 2015 (edited) JR10 how do I define them if (not isElement(NombreJug)) then ??? Edited November 5, 2015 by Guest don´t is necessari
DNL291 Posted September 6, 2015 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. Please do not PM me with scripting related question nor support, use the forums instead.
raynner Posted September 6, 2015 Author Posted September 6, 2015 our work thanks! : D as I close the topic ?? don´t is necessari
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