Bean666 Posted May 12, 2015 Share Posted May 12, 2015 (edited) hello , is it possible that a player can only throw 1 grenade in 5 seconds? then after 5 seconds he can throw again. setTimer onPlayerWeaponFire , these maybe? or am i wrong. Edited May 12, 2015 by Guest Link to comment
Bean666 Posted May 12, 2015 Author Share Posted May 12, 2015 alright , thanks , ill try to make it now , i'll show the results. Link to comment
Bean666 Posted May 12, 2015 Author Share Posted May 12, 2015 i tried doing one but i can't do it Link to comment
Enargy, Posted May 12, 2015 Share Posted May 12, 2015 (edited) try this timer = {} addEventHandler("onClientPlayerWeaponFire", localPlayer, function(weapon) if weapon == 16 then setElementData(localPlayer, "anti repeater", true); if ( getElementData(localPlayer, "anti repeater") == true ) then toggleControl("fire", false); timer[source] = setTimer( function() toggleControl("fire", true); setElementData(localPlayer, "anti repeater", false); removeEventHandler("onClientPlayerWeaponSwitch", getRootElement(), cancelShots); end, 5000, 1 ) addEventHandler("onClientPlayerWeaponSwitch", getRootElement(), cancelShots); end end end) function cancelShots() if ( getPedWeapon(localPlayer) == 16 ) then toggleControl("fire", false); else toggleControl("fire", true); end end Edited May 12, 2015 by Guest Link to comment
Bean666 Posted May 12, 2015 Author Share Posted May 12, 2015 Works - SOLVED *Thank you enargy , you've helped me many times. 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