Jump to content

Grenade delay?


Bean666

Recommended Posts

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