22.12.2013, 15:46
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
}