26.10.2013, 19:31
You could try something like this.
When someone enters a CP, it sets a variable.
If they try to enter a CP within 5 seconds, it will not do anything.
Try this.
Set '5' to whatever is needed.
When someone enters a CP, it sets a variable.
If they try to enter a CP within 5 seconds, it will not do anything.
Try this.
pawn Код:
if(checkpointid == SupaSaveCP[playerid])
{
if(tickcount()/1000 - GetPVarInt(playerid,"RecentlyEnteredCP")/1000 > 5)
{
if(GetPlayerControllable(playerid) == 1)
{
SetPlayerPos(playerid,485.0322,-2378.1455,10.7833);
SetPlayerInterior(playerid,12);
TogglePlayerControllable(playerid,0);
SetPlayerFacingAngle(playerid,179.3945);
TextDrawShowForPlayer(playerid,LoadingObjs);
TextDrawShowForPlayer(playerid,LoadingBOX);
TextDrawShowForPlayer(playerid,Please);
SetTimer("UnfreezePlayer",2000,false);
SetTimer("LoadingTDS",2000,false);
SetPVarInt(playerid,"RecentlyEnteredCP",tickcount());
}
}
else return 1;
}
if(checkpointid == SupaExitCP[playerid])
{
if(tickcount()/1000 - GetPVarInt(playerid,"RecentlyEnteredCP")/1000 > 5)
{
if(GetPlayerControllable(playerid) == 1)
{
SetPlayerPos(playerid,-2442.7317,755.4174,35.1719);
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid,0);
SetPlayerFacingAngle(playerid,177.3436);
SetPlayerInterior(playerid,0);
SetTimer("UnfreezePlayer",2000,false);
SetPVarInt(playerid,"RecentlyEnteredCP",gettime());
}
}
else return 1;