Jump to content

need help


Majhol

Recommended Posts

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?

Link to comment
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 
) 

Link to comment
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 
) 

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