26.04.2012, 13:24
I've tried everything to fix my SetTimeEx but it won't work... here's the timer.
For what i'm using it is..
and
Full code
Command to enable/disable it.
No errors
Please someone help me :/
pawn Code:
SetTimerEx("ResetJumping", 2500, true, "d" , playerid); // i got forward ResetJumping..
pawn Code:
IsJumping[MAX_PLAYERS];
pawn Code:
public ResetJumping(playerid)
{
IsJumping[playerid] = 1;
return 1;
}
pawn Code:
new
SuperJumpEnabled[MAX_PLAYERS],
Float:pX,
Float:pY,
Float:pZ,
IsJumping[MAX_PLAYERS];
forward ResetJumping(playerid);
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(SuperJumpEnabled[playerid] == 1)
{
if(newkeys & KEY_JUMP && SuperJumpEnabled[playerid])
{
GetPlayerVelocity(playerid, pX, pY, pZ);
SetPlayerVelocity(playerid, pX,pY, pZ+5);
SendClientMessage(playerid, COLOR_USE, "Super Jump De-Acticated");
SetTimerEx("ResetJumping", 2500, true, "d" , playerid);
}
return 1;
}
return 0;
}
public ResetJumping(playerid)
{
IsJumping[playerid] = 1;
return 1;
}
pawn Code:
command(jump, playerid, params[])
{
if(SuperJumpEnabled[playerid] == 0)
{
SuperJumpEnabled[playerid] = 1;
SendClientMessage(playerid, COLOR_USE, "Super Jump is now enabled.");
SetTimerEx("ResetJumping", 2500, true, "d" , playerid);
}
else
{
SuperJumpEnabled[playerid] = 0;
SendClientMessage(playerid, COLOR_USE, "Super jump is now disabled.");
}
return 1;
}
Please someone help me :/