SA-MP Forums Archive
[Help]How to Random Spawn? - 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]How to Random Spawn? (/showthread.php?tid=102798)



[Help]How to Random Spawn? - Tigerbeast11 - 17.10.2009

Guys! I really need help with this!
Код:
SetPlayerPos(playerid, 2493.9133, -1682.3986, 13.3382);
 	SetPlayerInterior(playerid, 0); //grove st. spawn
 	
 	SetPlayerPos(playerid, -2617.5156, 1390.6353, 7.1105);
 	SetPlayerInterior(playerid, 0);//jizzy spawn
 	
 	SetPlayerPos(playerid, 2028.5538, 1008.3543, 10.8203);
  SetPlayerInterior(playerid, 0);//4 dragons casino spawn
  
  SetPlayerPos(playerid, 1541.2833, -1362.4741, 329.6457);
  	SetPlayerInterior(playerid, 0);//starfish tower
How can i make random spawns?? Plz tell me!!! This wont work!



Re: [Help]How to Random Spawn? - dice7 - 17.10.2009

With this


Re: [Help]How to Random Spawn? - Tigerbeast11 - 17.10.2009

Quote:
Originally Posted by dice7
With this
I tried searching, no real help : (




Re: [Help]How to Random Spawn? - Jakku - 17.10.2009

You should read some gamemode scripts including with your server package. As an example lvdm has a random spawn, maybe you use it?


Re: [Help]How to Random Spawn? - Tigerbeast11 - 17.10.2009

I have done that... But since im a newbie, i dont understand them... If I tru to copy it into my script, it gives me tonnes of errors!


Re: [Help]How to Random Spawn? - Tigerbeast11 - 17.10.2009

Please can someone give me an example of random spawning?


Re: [Help]How to Random Spawn? - dice7 - 17.10.2009

pawn Код:
public OnPlayerSpawn(playerid)
{
  if(Is player in dm or simething)
  {
    new rand = random(3);
    switch(rand)
    {
      case 0:
      {
        SetPlayerPos();
        SetPlayerFacingAngle();
      }

      case 1:
      {
        SetPlayerPos();
        SetPlayerFacingAngle();
      }

      case 2:
      {
        SetPlayerPos();
        SetPlayerFacingAngle();
      }
    }
  }
  return 1;
}