need timer - 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:  need timer (
/showthread.php?tid=160448)
 
need timer - 
OmarEco -  16.07.2010
need how to make chanepos timer (timer of (setplayrpos))
like DM server in 10 min change all players pos
Re: need timer - 
ViruZZzZ_ChiLLL -  16.07.2010
Try this :
pawn Код:
public OnGameModeInit()
{
  SetTimer("EndOfRound", 60000*60*10, true);
  return 1;
}
forward EndOfRound();
public EndOfRound()
{
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
    SetPlayerPos(i, x, y, z);
  }
  return 1;
}
 
You get the idea.
Re: need timer - 
OmarEco -  16.07.2010
and if you can help  me there code i put it in top my script to change server name and map name and max players join to server
Re: need timer - 
OmarEco -  16.07.2010
Quote:
| 
					Originally Posted by ViruZZzZ_ChiLLL  Try this : 
pawn Код: public OnGameModeInit(){
 SetTimer("EndOfRound", 60000*60*10, true);
 return 1;
 }
 
 forward EndOfRound();
 public EndOfRound()
 {
 for(new i = 0; i < MAX_PLAYERS; i++)
 {
 SetPlayerPos(i, x, y, z);
 }
 return 1;
 }
 
You get the idea. | 
 look i need this timer change pos many times every 15 min
Re: need timer - 
OmarEco -  17.07.2010
help
me
Re: need timer - 
Grim_ -  17.07.2010
Make the timer shorter, and make it change the positions every X amount of time you want it to.
Re: need timer - 
OmarEco -  17.07.2010
can you give me the code i can't understand
Re: need timer - 
Grim_ -  17.07.2010
pawn Код:
new posStep=-1;
public OnGameModeInit()
{
  SetTimer("EndOfRound", 10000, true);
  return 1;
}
forward EndOfRound();
public EndOfRound()
{
  posStep++;
  for(new i = 0; i < MAX_PLAYERS; i++)
  {
    if(posStep == 0)
    {
      SetPlayerPos(i, x, y, z);
    }
    else if(posStep == 1)
    {
      SetPlayerPos(i, x, y, z);
    }
    // etc.
  }
  return 1;
}
 
That will make the timer go off every 1 minute instead, changing the pos of the player depending on the step of which the setPos variable is at.
thanks - 
OmarEco -  17.07.2010
thanks thanks 
