IsPlayerInACL

From Multi Theft Auto: Wiki
Revision as of 04:05, 15 April 2013 by Braydon Davis (talk | contribs) (Created page with "== Code == <syntaxhighlight lang="lua"> function isPlayerInACL(player,acl) local account = getAccountName(getPlayerAccount(player)) if(isObjectInACLGroup("user."..account,aclGetGroup(acl))) t...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Code

function isPlayerInACL(player,acl)
	local account = getAccountName(getPlayerAccount(player))
	if(isObjectInACLGroup("user."..account,aclGetGroup(acl))) then
		return true
	else
		return false
	end
end

Usage:

function playerLogin()
	if (isPlayerInACL(source,"Admin")==true) then
		outputChatBox(getPlayerName(source).." has logged in!", root, 0, 255, 0)
	end
end
addEventHandler("onPlayerLogin",root,playerLogin)

Code by xXMADEXx