[HELP] About Timers. - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] About Timers. (
/showthread.php?tid=100934)
[HELP] About Timers. -
cepiokas - 07.10.2009
Hey. Look, guys. I want to make like that. I have simple timer, everything OKAY. But i want to make that if i type /timer , that timer refresh and it start count again. But if i didn't type /timer, after 2minutes something happened?
Thanks for response.
Re: [HELP] About Timers. -
Finn - 07.10.2009
pawn Код:
public OnGameModeInit()
{
timer = SetTimer("Timer", 120000, false);
}
pawn Код:
zcmd(timer, playerid, params[])
{
KillTimer(timer); // Kill the timer.
timer = SetTimer("Timer", 120000, false); // Start the timer again.
return 1;
}
pawn Код:
public Timer()
{
Something();
Happens();
Here();
After();
2Min();
return 1;
}
NOTE: This won't work with multiple players, you need to find out how to do it yourself.
Re: [HELP] About Timers. -
UsaBoy91 - 07.10.2009
public Timer()
{
for(new x; x < 200; x++)
{
if(IsPlayerConnected(x))
{
// Your Code ; Don't use RETURN !
}
}
return 1;
}
Re: [HELP] About Timers. -
saiberfun - 07.10.2009
Quote:
Originally Posted by Angel φ
public Timer()
{
for(new x; x < 200; x++)
{
if(IsPlayerConnected(x))
{
// Your Code ; Don't use RETURN !
}
}
return 1;
}
|
thats so useless
and
Quote:
Originally Posted by Finn
pawn Код:
public OnGameModeInit() { timer = SetTimer("Timer", 120000, false); }
pawn Код:
zcmd(timer, playerid, params[]) { KillTimer(timer); // Kill the timer. timer = SetTimer("Timer", 120000, false); // Start the timer again. return 1; }
pawn Код:
public Timer() { Something(); Happens(); Here(); After(); 2Min(); return 1; }
NOTE: This won't work with multiple players, you need to find out how to do it yourself. 
|
he got it almost but i don't think cepiokas got zcmd
so change that part
pawn Код:
zcmd(timer, playerid, params[])
{
KillTimer(timer); // Kill the timer.
timer = SetTimer("Timer", 120000, false); // Start the timer again.
return 1;
}
to
pawn Код:
OnPlayerCommandText(playerid,commandtext[])
{
if (strcmp(cmdtext, "/timer", true) == 0)
{
KillTimer(timer); // Kill the timer.
timer = SetTimer("Timer", 120000, false); // Start the timer again.
}
return 1;
}
Re: [HELP] About Timers. -
cepiokas - 07.10.2009
Thanks alot.

You all so help me to make a new RP.

Respect.