Jump to content

setWeaponFiringRate


Forrest

Recommended Posts

local mode = getElementData(localPlayer, "firemode") 
        if mode == 0 then -- bean bag 
            triggerServerEvent("firemode", localPlayer, 1) 
            setWeaponFiringRate(31, 1) 
            outputChatBox( "You switched your gun to semi-auto mode", 0, 255, 0 ) 
        elseif mode == 1 then -- lethal gun mode 
            outputChatBox( "You switched your gun to full-auto mode", 0, 255, 0 ) 
            setWeaponFiringRate(31, 1) 
            triggerServerEvent("firemode", localPlayer, 0) 
        end 

Right, this is what I have currently. Though it's kicking out "Bad argument @ setWeaponFiringRate' [Expected weapon at argument 1, got number '31']

Any help would be appreciated, thanks.

Link to comment

First argument for setWeaponFiringRate is a Weapon, not the weapon ID.

I usually create a weapon assign it to a variable, and apply to the first argument.

bool setWeaponFiringRate ( weapon theWeapon, int firingRate ) 

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