else if(newkeys & KEY_SPRINT && newkeys & 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; return 1; } forward BreathTime(playerid); public BreathTime(playerid) { BreatheTime[playerid] = 0; SendClientMessage(playerid, 0x42CC33C8, "You can hold your breath again!"); return 1; }
#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;
}
if(HOLDING(KEY_SPRINT) && weaponAttached[playerid] == 0) { if(IsPlayerAiming(playerid))
nah that didnt really work, for it to work i had to press them at the same exact time.
but u kind of helped me, i used this now Код:
if(HOLDING(KEY_SPRINT) && weaponAttached[playerid] == 0) { if(IsPlayerAiming(playerid)) |