Jump to content
  • 0

[HELP] - Anti Weapon Spam Script PLEASE HELP !


KissMTA

Question

Hey I want make a Anti RPG spam script i made it u can only shoot every 7 seconds but it isnt work , it worked 3-5 months ago and i re-add it then not work anymore idk why

DEBUG

CINantiRPGspam/antiSpammm.lua:15: Bad usage @'addEventHandler'['onClientPlayerWeaponSwitch' with this function is already handled]

CINantiRPGspam/antiSpammm.lua:16: Bad usage @'addEventHandler'['onClientPlayerWeaponFire' with this function is already handled]

 

 

	timer = {}
addEventHandler("onClientPlayerWeaponFire", localPlayer,
function(weapon)
    if  weapon == 35  then
        setElementData(localPlayer, "anti repeater", true);
        if ( getElementData(localPlayer, "anti repeater") == true ) then
           
            timer[source] = setTimer( function()
            toggleControl("fire", true)
            toggleControl("aim_weapon", true);
            setElementData(localPlayer, "anti repeater", false);
            removeEventHandler("onClientPlayerWeaponSwitch", getRootElement(), cancelShots);
        removeEventHandler("onClientPlayerWeaponFire", getRootElement(), cancelShots);
            end, 7000, 1 )
            addEventHandler("onClientPlayerWeaponSwitch", getRootElement(), cancelShots);
        addEventHandler("onClientPlayerWeaponFire", getRootElement(), cancelShots);
        end
    end
end)
 
function cancelShots()
    if ( getPedWeapon(localPlayer) == 35 ) then
	        toggleControl("fire", false);
toggleControl("aim_weapon", false);
        else
toggleControl("aim_weapon", true);
        toggleControl("fire", true);  
    end
end

Link to comment

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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