Jump to content

OFF [topic]


raynner

Recommended Posts

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 by Guest
Link to comment

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...