SA-MP Forums Archive
spawns - 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: spawns (/showthread.php?tid=76721)



spawns - litel - 05.05.2009

how do i make random spawns?
the random spawns of lvdm doesent work


Re: spawns - Weirdosport - 05.05.2009

Elsewhere (outside callback)
pawn Код:
new Float:RandomSpawn[][4] =
 {
 // Positions, (X, Y, Z and Facing Angle)
  {-2796.9854, 1224.8180, 20.5429, 192.0335},
  {-2454.2170, 503.8759, 30.0790, 267.2932},
  {-2669.7322, -6.0874, 6.1328, 89.8853}
 }
pawn Код:
public OnPlayerSpawn(playerid)
{
  new iRandom = random(sizeof(RandomSpawn));
  SetPlayerPos to the random spawn information
  SetPlayerPos(playerid, RandomSpawn[iRandom][0], RandomSpawn[iRandom][1],RandomSpawn[iRandom][2]);
  SetPlayerFacingAngle to the random facing angle information
  SetPlayerFacingAngle(playerid, RandomSpawn[iRandom][3]);
  return 1;
}
Found on forums, Haven't tested.