SA-MP Forums Archive
anti bomb spam - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: anti bomb spam (/showthread.php?tid=482711)



anti bomb spam - ReD_HunTeR - 22.12.2013

asking if someone can make anti bomb spam
i want like this
if player make 3 explode of hunter then if he do again n again he will be drop out of the hunter and if he stop at 3 and wait for 10 secs so he wont be drop out.

+rep as reward.


Re: anti bomb spam - SilentSoul - 22.12.2013

pawn Код:
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
   
forward Hunter(playerid);
   
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (PRESSED(KEY_FIRE) || PRESSED(KEY_ACTION)) // CTRL/LMB the fire button of hunter
    {
        if (IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleID(playerid) == 425)//checking if the player inside the hunter
        {
            SetTimerEx("Hunter", 3000, false, "%d", playerid);//3 secs of 3 bombs i think
            TogglePlayerControllable(playerid, false);//stop him from controlling for sometime
        }
    }
    return 1;
}

public Hunter(playerid)
{
    TogglePlayerControllable(playerid, true);//make him can control again
}