تفضل :
-- Client Side --
loca = getLocalPlayer()
function putAllAccountsInList ( )
triggerServerEvent( "putaccount", loca )
end
addEvent("put",true)
addEventHandler("put", root,
function ( vTable )
if vTable and type ( vTable ) == "table" then
guiGridListClear ( GUIEditor.gridlist[1] )
for i,v in ipairs ( vTable ) do
local row = guiGridListAddRow ( GUIEditor.gridlist[1] )
guiGridListSetItemText ( GUIEditor.gridlist[1], row, 1, vTable, false, false )
end
end
end
)
-- Server Side --
addEvent ( "putaccount", true )
addEventHandler ( "putaccount", root,
function ( )
local vTable = { } ;
for i,v in ipairs ( getAccounts ( ) ) do
local acc = getAccountName ( v )
if acc then
table.insert ( vTable, acc )
end
end
triggerClientEvent ( source, "put", resourceRoot, vTable )
end
)