Jump to content

Help Swat Team


Hassam

Recommended Posts

Hello fellow guys,

I'm posting here due I need help, when I use "/swatadd name", I can't put one guy on team swat.

addCommandHandler("swatadd", 
function(player, command, plr) 
    local name = getPlayerFromName (plr) 
    if (name) then 
    local accname = getAccountName ( getPlayerAccount ( player) ) 
    if ( isObjectInACLGroup ( "user.".. accname, aclGetGroup ( ( "GolawSwat" ) ) ) ) then 
        setPlayerTeam(plr, SWAT) 
        setPlayerNametagColor (plr, 65, 105, 225) 
        setElementModel(plr, 285) 
        setElementData(plr, "Occupation", "SWAT Team", true ) 
        outputChatBox(plr.." is now SWAT Team.",source,0,255,0) 
    else 
        outputChatBox("You aren't allowed use this command.",source,0,255,0) 
    end 
    end 
end 
) 
  

Link to comment

Try this

addCommandHandler("swatadd", 
function(player, command, plr) 
    local name = getPlayerFromName (plr) 
    if (name) then 
    local accname = getAccountName ( getPlayerAccount ( player ) ) 
    if ( isObjectInACLGroup ( "user.".. accname, aclGetGroup ( ( "Admin" ) ) ) ) then 
        setPlayerTeam(name, getTeamFromName ( "SWAT" ) ) 
        setPlayerNametagColor (name, 65, 105, 225) 
        setElementModel(name, 285) 
        setElementData(name, "Occupation", "SWAT Team", true ) 
        outputChatBox( getPlayerName ( name ) .." is now SWAT Team.",player,0,255,0) 
    else 
        outputChatBox("You aren't allowed use this command.",player,0,255,0) 
    end 
    end 
end 
) 

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