SA-MP Forums Archive
help | 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 | spawn (/showthread.php?tid=99178)



help | spawn - rong13 - 26.09.2009

so when i start the game the player is spawn only 1
place i want to make many places
so what i need to do ?



Re: help | spawn - brett7 - 26.09.2009

public OnGameModeInit()
{

//player classes

AddPlayerClass(skinid, x, y, z,180.8934,0,0,0,0,0,0); // outhouse1
AddPlayerClass(skinid, x, y, z,108.3009,0,0,0,0,0,0); // caravan1
AddPlayerClass(skinid, x, y, z,186.2041,0,0,0,0,0,0); // barn1
return 0;
}

add what ever you want


Re: help | spawn - rong13 - 26.09.2009

no
i mean any class
will telleport to any where
not 1 place :\



Re: help | spawn - Correlli - 26.09.2009

Are you setting their position to any other place at OnPlayerSpawn?


Re: help | spawn - rong13 - 26.09.2009

yes


Re: help | spawn - Correlli - 26.09.2009

Well, there's your problem then.


Re: help | spawn - rong13 - 26.09.2009




Re: help | spawn - Amit_B - 26.09.2009

To do this you can create randomally spawns.
Something like this:
pawn Код:
new Float:randomSpawns[][3] =
{
  {0.0,0.0,0.0}, // spawn #1
  {0.0,0.0,0.0}, // spawn #2
  {0.0,0.0,0.0}, // spawn #3
  {0.0,0.0,0.0} // spawn #4
};
public OnPlayerSpawn(playerid)
{
  new r = random(sizeof(randomSpawns));
  SetPlayerPos(playerid,randomSpawns[r][0],randomSpawns[r][1],randomSpawns[r][2]);
  return 1;
}



Re: help | spawn - rong13 - 26.09.2009

סוף סוף מישהו ישראלי פה
איפו אני שם את ('where i put it ?)

new Float:randomSpawns[][3] =
{
{-1989.1232, 591.4193, 35.1841}, // spawn #1
{ 1123.1140, -1131.8231, 23.8281}, // spawn #2
{ 2023.8903, 1343.1018, 10.8203}, // spawn #3
{ 2343.3652, 1390.1266, 42.8203}, // spawn #4
{ 2056.9578, 860.9142, 6.7177}, // spawn #5
};
ואני לא צריך לימחוק את ה // spawn # האלה ?
i dont need to delete those // spawn #
and that dont even say error
that close it


Re: help | spawn - Amit_B - 26.09.2009

Put it in the top of your script.
About the "// spawn #" - you can remove it. It's comment, and doing nothing.

And don't write Hebrew letters only English is allowed.