20.11.2011, 05:52
When the timer is over, it's basically 0.. Unless you want to create another variable to track the timer's seconds which is useless.
So, you will need something like this:
So basically, the "if" check is not necessary in this case.
So, you will need something like this:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_JUMP)
{
PlayerPressedJump[playerid] ++;
if(PlayerPressedJump[playerid] == 3) // change 5 to whatever number of jumps you want
{
ApplyAnimation(playerid, "PED", "BIKE_fall_off", 4.1, 0, 1, 1, 1, 0, 1);
SetTimerEx("PressJump", 15000, false, "i", playerid); // When the timer reaches 0, we move to the callback "PressJump"
}
}
return 1;
}
forward PressJump(playerid); // Timer is over.
public PressJump(playerid)
{
PlayerPressedJump[playerid] = 0; // Reset the variable
ClearAnimations(playerid);
return 1;
}