SA-MP Forums Archive
Scripting fuction "sleep"? - 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: Scripting fuction "sleep"? (/showthread.php?tid=74769)



Scripting fuction "sleep"? - Qeux - 25.04.2009

Is there a scripting function that will act like a sleep where the script pauses then after the sleep count is gone it moves to next line because i made it so that if you walk on a point it teleports you somewhere and if you walk on that point it teleports you back... but it does it like instantly and you get stuck in a teleport back and forth... so is there a fuction that will make the script pause.


Re: Scripting fuction "sleep"? - Backwardsman97 - 25.04.2009

Maybe like this.

pawn Код:
new Tp[MAX_PLAYERS];//Top

//When you teleport them
if(PlayerToPoint(/*Blah Blah*/))
{
   if(!Tp[playerid])
   {
      //SetPlayerPos
      Tp[playerid] = 1;
   }
}
else
{
   Tp[playerid] = 0;
}



Re: Scripting fuction "sleep"? - yom - 25.04.2009

It's possible to pause a script but this cause problems like desync, timeouts..


Re: Scripting fuction "sleep"? - Qeux - 26.04.2009

Quote:
Originally Posted by backwardsman97
Maybe like this.

pawn Код:
new Tp[MAX_PLAYERS];//Top

//When you teleport them
if(PlayerToPoint(/*Blah Blah*/))
{
  if(!Tp[playerid])
  {
     //SetPlayerPos
     Tp[playerid] = 1;
  }
}
else
{
  Tp[playerid] = 0;
}
thanks man i think i get it


Re: Scripting fuction "sleep"? - Backwardsman97 - 26.04.2009

You're welcome.


Re: Scripting fuction "sleep"? - Joe Staff - 26.04.2009

Or have it teleport the person NEXT to the next teleporter =p