Timer Help - 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: Timer Help (
/showthread.php?tid=441954)
Timer Help -
xXRealLegitXx - 05.06.2013
I have these two timers set up on this command:
Код:
CMD:startpretest(playerid, params[])
{
if(isnull(params))
{
return SendClientMessage(playerid, -1, "USAGE: /startpretest [standard/trucker]");
}
if(!strcmp(params, "standard", true))
{
SetPlayerCheckpoint(playerid, 1020.6112,1376.4153,10.4650, 3.0);
SetTimer("message", 220000, false);
return 1;
}
if(!strcmp(params, "trucker", true))
{
SetPlayerCheckpoint(playerid, 1020.6112,1376.4153,10.4650, 3.0);
SetTimer("messaget", 220000, false);
return 1;
}
return 1;
}
I am trying to get it below, to kill both messaget and message when they reach the final checkpoint. How do I do this?
Код:
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1159.8411,1370.9576,10.4051))
{
DisablePlayerCheckpoint(playerid);
SetVehicleToRespawn(1);
SetVehicleToRespawn(2);
SetVehicleToRespawn(3);
KillTimer(0);
KillTimer(1);
SendClientMessage(playerid, COLOR_WHITE, "Congratulations! You passed the test!");
}
return 1;
}
Код:
public message()
{
SendClientMessageToAll(COLOR_WHITE, "It has taken you longer than 3:40 to complete the test. Sorry, you failed. (/retrytest)");
}
public messaget()
{
SendClientMessageToAll(COLOR_WHITE, "It has taken you longer than 3:40 to complete the test. Sorry, you failed. (/retrytest)");
}
Re: Timer Help -
DobbysGamertag - 05.06.2013
not sure if it'll help, but you can try adding:
pawn Код:
forward timername();
public timername()
{
if(time == 0)
{
//code
}
return 1;
}
you may have to add an extra bit to the timer, like SetTimer("name",time,repeating,time);