AR/aclGetGroup: Difference between revisions
Jump to navigation
Jump to search
KING-ABADY (talk | contribs) (Created page with "==Syntax== <!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'pla...") |
KING-ABADY (talk | contribs) (→مثال) |
||
Line 16: | Line 16: | ||
===مثال=== | ===مثال=== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
players = getElementsByType ( "player" ) | |||
admins = "" | |||
for k,v in ipairs(players) do | |||
local accountname = "" | |||
if (isGuestAccount(getPlayerAccount(v)) == false) then | |||
accountname = getAccountName (getPlayerAccount(v)) | |||
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "admin" ) ) then | |||
if (admins == "") then | |||
admins = getPlayerName(v) | |||
else | |||
admins = admins .. ", " .. getPlayerName(v) | |||
end | |||
end | |||
end | |||
end | |||
outputChatBox( "Online Admins:", getRootElement(), 255, 255, 0) | |||
outputChatBox( " " .. tostring ( admins ), getRootElement(), 255, 255, 0) | |||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 15:51, 7 April 2013
Syntax
aclgroup aclGetGroup ( string groupName )
العناصر المطلوبة
- groupName: اسم القروب ( المجموعة ) التي تريد احضارها
Returns
Returns اذا تم العثور على القروب. الرجوع اليه false/nil اذا لم يوجد القروب او فشل بسبب غير معروف.
مثال
players = getElementsByType ( "player" ) admins = "" for k,v in ipairs(players) do local accountname = "" if (isGuestAccount(getPlayerAccount(v)) == false) then accountname = getAccountName (getPlayerAccount(v)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "admin" ) ) then if (admins == "") then admins = getPlayerName(v) else admins = admins .. ", " .. getPlayerName(v) end end end end outputChatBox( "Online Admins:", getRootElement(), 255, 255, 0) outputChatBox( " " .. tostring ( admins ), getRootElement(), 255, 255, 0)