GetAccountsRanks: Difference between revisions
Jump to navigation
Jump to search
(→Code) |
No edit summary |
||
Line 1: | Line 1: | ||
{{Useful Function}} __NOTOC__ | |||
This function get | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> |
Revision as of 12:56, 29 August 2020
This function get
Syntax
player getAccountsRanks ( string accountName )
Required Arguments
- accountName: A string containing account name of a player you want to know his groups.
Code
function getAccountRanks( accName ) -- getAccountRanks Function By MouNiR.Dz local groups = aclGroupList() -- Acl group list for i,v in ipairs(groups) do -- table if isObjectInACLGroup("user."..accName,v) then -- if he have groups outputChatBox( " there are "..aclGroupGetName(v).." group for the account ("..accName..") ",thePlayer) -- telling the player about his groups end -- end for if end -- end for end -- end function
Example
-- Example : When he command "groups", he tells him on chat all the groups he is in addCommandHandler("groups",function (thePlayer) -- binding the command "groups" local acc = getAccountName(getPlayerAccount(thePlayer)) -- getting account name getAccountsRanks(acc) -- getting accounts ranks end -- end for function ) -- closing addCommandHandler(