Jump to content

[HELP]Leave Team


ViRuZGamiing

Recommended Posts

Posted

Hello Community,

Here's my script:

addEventHandler("onResourceStart",resourceRoot,function () 
     newTeam = createTeam ( "Police" , 0, 255 , 0 ) 
end) 
  
addCommandHandler("joinPD", function(source) 
     if not newTeam then outputChatBox("Team couldn't be created!") return end 
     if getPlayerTeam(source) == newTeam then 
           outputChatBox("You are already a Police Officer!") 
      else 
           setPlayerTeam(source,newTeam) 
           setElementModel(source,284) 
           giveWeapon ( source, 4, 1 ) 
           outputChatBox("Now you are a Police Officer!") 
      end 
end) 

My Problem:

I want to make a command /leavePD because when I write /joinPD i've joined but when I do /joinArmy after /joinPD i'm in both teams.

Greetings Billy

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

Posted

And Remember;

LeaveTeam not DeleteTeam, It need to stay in the List after i do /leavePD

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

Posted

You have already made /JoinArmy and /leavePD command ? or asking us to make ?

Multi Theft Auto Player since middle of 2011.

Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.

Posted
-- Try This 
createTeam ( "Police" , 0, 255 , 0 ) 
  
addCommandHandler ( "joinPD", 
    function ( source ) 
        local theTeam = getTeamFromName ( "Police" ) 
        if not theTeam then outputChatBox ( "Team couldn't be created!" ) return end 
        if getPlayerTeam ( source ) == theTeam then 
            outputChatBox ( "* You are already a Police Officer !", source, 255, 0, 0, true ) 
        else 
           setPlayerTeam ( source, theTeam ) 
           setElementModel ( source, 284 ) 
           giveWeapon ( source, 4, 1 ) 
           outputChatBox ( "* Now you are a Police Officer !", source, 0, 255, 0, true ) 
        end 
    end 
)  
  
addCommandHandler ( "leavePD", 
    function ( source ) 
        local theTeam = getTeamFromName ( "Police" ) 
        if getPlayerTeam ( source ) == theTeam then 
            setPlayerTeam ( source, nil ) 
            outputChatBox ( "* You Left the PD !", source, 0, 255, 0, true ) 
        else 
           outputChatBox ( "* You're not at PD !", source, 255, 0, 0, true ) 
        end 
    end 
) 

Posted

I have now a /joinPD and /leavePD and it gives me a Skin, Weapon and autorized to open the Gates...

But i see in most RolePlaying Server they have a Rang system.

How is this made?

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

Posted

What is a "Rang system"? or you mean "Gang system"?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Maybe he mean Rank system.

Multi Theft Auto Player since middle of 2011.

Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.

Posted

Like this;

You enter a RolePlaying server and joins a gang (example: mafia)

When you enter you are rang 0 with a skin and abbility to drive 1 car of the gang cars.

When you make a test the Leader (Rang 5) will promote you.

Your skin changes and the car abbility.

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

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