weapon hold breath help??
#2

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;
}
I didn't test it, but you can try that.
Reply


Messages In This Thread
weapon hold breath help?? - by Trucido - 16.05.2015, 23:17
Re: weapon hold breath help?? - by DTV - 16.05.2015, 23:23
Re: weapon hold breath help?? - by Trucido - 16.05.2015, 23:59
Re: weapon hold breath help?? - by DTV - 17.05.2015, 00:35

Forum Jump:


Users browsing this thread: 2 Guest(s)