Jump to content

Check Acl group


Recommended Posts

Hello

I'm doing this script and was wondering how do I check if the player to type "t" / go in this group acl "PRO"?

    local player = getLocalPlayer() 
function mob(player) 
     guiSetVisible ( los, true ) 
 end  
 function timer ( player ) 
    setTimer ( mob, 5000, 1 ,player ) 
    outputChatBox ( "let's go!", player, 10, 250, 1 ) 
    end 
     addCommandHandler("go", timer) 

Link to comment

Use this

IsObjectInACLGroup

Put this in a serverside script and set an event in the clientside to trigger when command "go" is typed.

  
accountname = getPlayerAccount( thePlayer ) 
isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "PRO" ) ) 

Try this:

Server:

function startgo(thePlayer, commandName) 
    accountname = getPlayerAccount( thePlayer ) 
    if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "PRO" ) ) then 
        triggerClientEvent("startGO", thePlayer, thePlayer) 
    end 
end 
addCommandHandler("go", startgo) 

Client:

local player = getLocalPlayer() 
function mob( player ) 
    guiSetVisible ( los, true ) 
 end 
function timer ( thePlayer ) 
   setTimer ( mob, 5000, 1 ,thePlayer) 
   outputChatBox ( "let's go!", thePlayer, 10, 250, 1 ) 
end 
addEvent("startGO", true) 
addEventHandler("startGO", getResourceRootElement(getThisResource()), timer) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...