ViRuZGamiing Posted December 31, 2012 Share Posted December 31, 2012 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 Link to comment
ViRuZGamiing Posted December 31, 2012 Author Share Posted December 31, 2012 And Remember; LeaveTeam not DeleteTeam, It need to stay in the List after i do /leavePD Link to comment
Perfect Posted December 31, 2012 Share Posted December 31, 2012 You have already made /JoinArmy and /leavePD command ? or asking us to make ? Link to comment
3NAD Posted December 31, 2012 Share Posted December 31, 2012 -- 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 ) Link to comment
ViRuZGamiing Posted December 31, 2012 Author Share Posted December 31, 2012 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? Link to comment
Castillo Posted December 31, 2012 Share Posted December 31, 2012 What is a "Rang system"? or you mean "Gang system"? Link to comment
Perfect Posted January 1, 2013 Share Posted January 1, 2013 Maybe he mean Rank system. Link to comment
ViRuZGamiing Posted January 1, 2013 Author Share Posted January 1, 2013 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. Link to comment
Perfect Posted January 1, 2013 Share Posted January 1, 2013 maybe for car thingy you can use this resource: https://community.multitheftauto.com/ind ... ls&id=6222 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now