Small problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Small problem (
/showthread.php?tid=598116)
Small problem -
Squirrel - 08.01.2016
Okay so my problem is simple, jumps arent being detected well the Timestamp isnt
PHP код:
if(PRESSED(KEY_JUMP)) {
if(!IsPlayerInAnyVehicle(playerid)) {
new timenow = gettime();
if(timenow < (LastJumpWhen[playerid] + 3)) {
TogglePlayerControllable(playerid,0);
SetTimerEx("PlayerCannotShoot",1000,false,"i",playerid);
Msg(playerid,COLOR_RED,"Bunny-Hopping is not allowed on this server. You are allowed to jump once every 3 seconds");
LastJumpWhen[playerid] = gettime();
}
}
}
Re: Small problem -
Jefff - 09.01.2016
pawn Код:
if(PRESSED(KEY_JUMP))
{
if(!IsPlayerInAnyVehicle(playerid))
{
new timenow = gettime();
if(LastJumpWhen[playerid] < timenow)
{
TogglePlayerControllable(playerid,0);
SetTimerEx("PlayerCannotShoot",1000,false,"i",playerid);
Msg(playerid,COLOR_RED,"Bunny-Hopping is not allowed on this server. You are allowed to jump once every 3 seconds");
LastJumpWhen[playerid] = timenow + 3;
}
}
}