Jump to content

Team fucntion help


Prat

Recommended Posts

Hi guys

today i tried to make this script, but itsn't working , i tried to delete those Team function but it works.

so all i need to do is:

when you do /gobase you warp to the base , /gobase only work for "staff" team only.

here is the script

function staffwarp (thePlayer ,command) 
if getTeamName(getPlayerTeam(thePlayer)) == "Staff" then 
    setElementPosition ( thePlayer, 2454.7448730469, 1441.8331298828, 10.90625) 
    sendClientMessage ( "You succesfuly warped to Staff Base", thePlayer, 0, 255, 0, true ) 
else 
    outputChatBox ("You don't have access for this command", thePlayer, 255, 0, 0) 
end 
addCommandHandler ("gobase", staffwarp) 
  
  
     

Link to comment

try this

function staffwarp (thePlayer ,command) 
    local playerTeam =  getPlayerTeam ( thePlayer ) == getTeamFromName( "Staff" )  
    if ( playerTeam ) then 
    setElementPosition ( thePlayer, 2454.7448730469, 1441.8331298828, 10.90625) 
    sendClientMessage ( "You succesfuly warped to Staff Base", thePlayer, 0, 255, 0, true ) 
else 
    outputChatBox ("You don't have access for this command", thePlayer, 255, 0, 0) 
end 
addCommandHandler ("gobase", staffwarp) 
  
  
     

Link to comment
Hi guys

today i tried to make this script, but itsn't working , i tried to delete those Team function but it works.

so all i need to do is:

when you do /gobase you warp to the base , /gobase only work for "staff" team only.

here is the script

function staffwarp (thePlayer ,command) 
if getTeamName(getPlayerTeam(thePlayer)) == "Staff" then 
    setElementPosition ( thePlayer, 2454.7448730469, 1441.8331298828, 10.90625) 
    sendClientMessage ( "You succesfuly warped to Staff Base", thePlayer, 0, 255, 0, true ) 
else 
    outputChatBox ("You don't have access for this command", thePlayer, 255, 0, 0) 
end 
addCommandHandler ("gobase", staffwarp) 
  
  
     

function staffwarp (thePlayer ,command) 
if getPlayerTeam(thePlayer) and getTeamName(getPlayerTeam(thePlayer)) == "Staff" then 
    setElementPosition ( thePlayer, 2454.7448730469, 1441.8331298828, 10.90625) 
    sendClientMessage ( "You succesfuly warped to Staff Base", thePlayer, 0, 255, 0, true ) 
else 
    outputChatBox ("You don't have access for this command", thePlayer, 255, 0, 0) 
end 
end 
addCommandHandler ("gobase", staffwarp 
     

Link to comment

Ahh I see, we are recreating his command? Cool;

addCommandHandler ( "gobase", 
    function ( thePlayer, command ) 
        if ( getPlayerTeam ( thePlayer ) ) then 
            if ( getPlayerTeam ( thePlayer ) == getTeamFromName ( "Staff" ) ) then 
                setElementPosition ( thePlayer, 2454.7448730469, 1441.8331298828, 10.90625); 
                outputChatBox ( "You succesfuly warped to Staff Base", thePlayer, 0, 255, 0, true ); 
            else 
                outputChatBox( "You do not have the required access for this command.", thePlayer, 255, 0, 0, true ); 
            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...