16.05.2015, 23:23
pawn Код:
#define HOLDING(%0) ((newkeys & (%0)) == (%0))
#define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#define RELEASED(%0) (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
if(PRESSED(KEY_SPRINT) && PRESSED(KEY_AIM) && weaponAttached[playerid] == 0)
{
if(BreatheTime[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "You need to wait before holding your breathe again!");
SetPlayerDrunkLevel(playerid, 0);
BreatheTimer[playerid] = SetTimerEx("BreathTime", 10000, false, "d", playerid);
PlayerPlaySound(playerid, 165, 0.0, 0.0, 10.0);
BreatheTime[playerid] = 1;
}
forward BreathTime(playerid);
public BreathTime(playerid)
{
BreatheTime[playerid] = 0;
SendClientMessage(playerid, 0x42CC33C8, "You can hold your breath again!");
return 1;
}