getPlayerAccs : وظيفة لـ جلب جميع حسابات اللاعب
Syntax / التركيبة :
table getPlayerAccs ( player thePlayer )
player thePlayer: اللاعب الذي تريد جلب جميع حساباته
- Source Code:
getPlayerAccs = function ( Player )
if ( getElementType( Player ) ~= "player" ) then return error ("Bad argument @ 'getElementType' [Expected player at argument 1 , got "..type ( Player ).."]") end
local Serial = getPlayerSerial ( Player )
local Table = {};
for _,acc in ipairs ( getAccounts ( ) ) do
if ( Serial == getAccountSerial ( acc ) ) then
table.insert ( Table , acc )
end
end
return Table
end
مثال عن الوظيفة :
addCommandHandler('getAccs', function ( Player )
outputChatBox('* Your Accounts', Player , 255 ,0,0 , true )
for _,v in ipairs ( getPlayerAccs ( Player ) ) do
outputChatBox(getAccountName ( v ) )
end
end)