Jump to content

If admin join


Admigo

Recommended Posts

hmmm

this code is alright ?

function createTeamsOnStart () 
    teamAdmmin = createTeam ( "Admin", 0, 255, 0 ) 
end 
addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart  ) 
  
local root = getRootElement() 
  
addEventHandler("onPlayerLogin", root 
if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "Admin" ) ) then 
local theTeam = getPlayerTeam ( source )  
  if theTeam then                        
    setPlayerTeam ( source, Admin ) 
  end 
end 

Edited by Guest
Link to comment
teamAdmin = createTeam ( "Admin", 0, 255, 0 ) 
  
  
function addtoteam(player) 
if isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(player)) , aclGetGroup ( "Admin" ) ) then 
setPlayerTeam ( player,teamAdmin ) 
end 
end 
  
function addtoteamtimer() 
setTimer(addtoteam,3000,1,source) 
end  
  
addEventHandler("onPlayerLogin",getRootElement(),addtoteamtimer) 

Link to comment

& For all Admins , Supermoderator , moderator

use this code , i'm just added *else* to code

teamAdmin = createTeam ( "Admin", 255, 0, 0 ) 
  
  
function addtoteam(player) 
if isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(player)) , aclGetGroup ( "Admin" ) ) then 
setPlayerTeam ( player,teamAdmin ) 
elseif isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(player)) , aclGetGroup ( "SuperModerator" ) ) then 
setPlayerTeam ( player,teamAdmin ) 
elseif isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(player)) , aclGetGroup ( "Moderator" ) ) then 
setPlayerTeam ( player,teamAdmin ) 
end 
end 
  
function addtoteamtimer() 
setTimer(addtoteam,3000,1,source) 
end 
  
addEventHandler("onPlayerLogin",getRootElement(),addtoteamtimer) 
  

i'm sure it's working :D

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