Forrest Posted March 9, 2013 Share Posted March 9, 2013 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
OGF Posted March 9, 2013 Share Posted March 9, 2013 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
Castillo Posted March 9, 2013 Share Posted March 9, 2013 That function is only used for created weapons, it doesn't work for what you want. 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