Majhol Posted August 1, 2013 Posted August 1, 2013 hi guys I couldn't post a code because I couldn't think of anything all I need is how to make ak47 for only "police" team I couldn't do it , can anyone help me out?
Castillo Posted August 1, 2013 Posted August 1, 2013 Well, you can make a script where when a player tries to change his weapon, if he's not in the Police team and the weapon is the Ak-47, then set it back to the old slot or the next one. Use the event: onPlayerWeaponSwitch and the functions: getPlayerTeam getTeamName setPedWeaponSlot San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Majhol Posted August 1, 2013 Author Posted August 1, 2013 WeaponID = { [30] = true, } --add an event handler for onPlayerWeaponSwitch addEventHandler ( 'onPlayerWeaponSwitch', getRootElement ( ), function ( previousWeaponID, currentWeaponID ) if ( WeaponID[currentWeaponID] ) then toggleControl ( source, 'fire', false ) --disable the fire button else if ( getPlayerTeam ( hitPlayer ) == getTeamFromName ( "Police" ) ) then toggleControl ( source, 'fire', true ) --enable it end end ) this is what i reached to and I couldn't figure out the setpedweaponslot thingy can u help me?
Castillo Posted August 1, 2013 Posted August 1, 2013 WeaponID = { [ 30 ] = true, } --add an event handler for onPlayerWeaponSwitch addEventHandler ( 'onPlayerWeaponSwitch', getRootElement ( ), function ( previousWeaponID, currentWeaponID ) if ( WeaponID [ currentWeaponID ] ) then toggleControl ( source, 'fire', false ) --disable the fire button end if ( getPlayerTeam ( source ) == getTeamFromName ( "Police" ) ) then toggleControl ( source, 'fire', true ) --enable it end end ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Majhol Posted August 1, 2013 Author Posted August 1, 2013 I found a big bug , now if you are not in the police teams all all weapons doesn't shot
Castillo Posted August 1, 2013 Posted August 1, 2013 WeaponID = { [ 30 ] = true, } --add an event handler for onPlayerWeaponSwitch addEventHandler ( 'onPlayerWeaponSwitch', getRootElement ( ), function ( previousWeaponID, currentWeaponID ) if ( WeaponID [ currentWeaponID ] ) then toggleControl ( source, 'fire', false ) --disable the fire button else toggleControl ( source, 'fire', true ) --disable the fire button end if ( getPlayerTeam ( source ) == getTeamFromName ( "Police" ) ) then toggleControl ( source, 'fire', true ) --enable it end end ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted August 1, 2013 Posted August 1, 2013 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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