Bean666 Posted May 12, 2015 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 Aftermath
darhal Posted May 12, 2015 Posted May 12, 2015 You can also use cancelEvent #include <iostream> int main() { std::cout << "C++ is amazing <3" << std::endl; return 0; } I left MTA !... I m doing some tuts about (servers and scripting here) subscribe please
Bean666 Posted May 12, 2015 Author Posted May 12, 2015 alright , thanks , ill try to make it now , i'll show the results. Aftermath
Enargy, Posted May 12, 2015 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 - Inactivo.
Bean666 Posted May 12, 2015 Author Posted May 12, 2015 Works - SOLVED *Thank you enargy , you've helped me many times. Aftermath
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