hello all i created a teampanel all works fine but problem is in adding players to team which only leader must do!
for exmaple i created team and if i need to add players to team i tried with
if getElementData(localPlayer, "player.key") == "amazingcasino" then
but it doesn't work below is full code
addEventHandler("onClientGUIClick", guiRoot,
function()
if getElementData(localPlayer, "player.key") == "amazingcasino" then
if source == GUIEditor.button[3] then
local row, column = guiGridListGetSelectedItem( GUIEditor.gridlist[1])
if row == -1 then return end
local playerName = guiGridListGetItemText( GUIEditor.gridlist[1],row,column)
local player = getPlayerFromName(playerName)
local team = getPlayerTeam(localPlayer)
local teamName = getTeamName(team)
if not playerName then
guiGridListRemoveRow(row)
return
end
triggerServerEvent("Add to team", localPlayer,playerName,teamName)
end
end
end)