Jump to content
  • 0

How to set /staff only for admins.


Batista

Question

Posted

Hello all,

today I create script that when you type /staff you'll be in staff team on TAB, but the problem that everyone can use it, so for that I need it only for admins who have acces to admin panel, please tell me how to do it.

thank you.

7 answers to this question

Recommended Posts

  • 0
Posted
function joinStaffTeam ( source ) 
    local staffteam = getTeamFromName ( "Staff" ) 
    if ( staffteam ) then  
        setPlayerTeam ( source, staffteam ) 
    end 
end 
 addCommandHandler ( "staff", joinStaffTeam ) 

  • 0
Posted
function joinStaffTeam ( source ) 
    local staffteam = getTeamFromName ( "Staff" ) 
    local acc = getPlayerAccount ( source ) --Let's get the account of this guy 
    if staffteam and not isGuestAccount ( acc ) and hasObjectPermissionTo ( "user."..getAccountName ( acc ), "command.ban" ) then --If the guy is logged in and can ban players (admin or higher) 
        setPlayerTeam ( source, staffteam ) 
    end 
end 
 addCommandHandler ( "staff", joinStaffTeam ) 

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...