SA-MP Forums Archive
Different spawn points - 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)
+--- Thread: Different spawn points (/showthread.php?tid=283488)



Different spawn points - FrostDoggy - 15.09.2011

Hello , Ill be fast because I have to go.

For eg.

I want when someone connects to spawn randomly at the Airports

SetPlayerPos(playerid,Los Santos Airport)
etc

and..I tried but , when someone dies I want same to spawn at neareast hospital.
I think for that I have to get areas right?


Re: Different spawn points - |_ⒾⓇⓄN_ⒹⓄG_| - 15.09.2011

yes u have
with /save
then go to documents-gta folder- samp -savedpositions
get the x,y,z
and then create the random spawns...


Re: Different spawn points - =WoR=Varth - 15.09.2011

Use boloean.
pawn Код:
new bool:Dead[MAX_PLAYERS];

//OnPlayerDeath
Dead[playerid] = true;

//OnPlayerSpawn
if(Dead[playerid])
{
   //Spawn in Hospital
   Dead[playerid] = false;
}



Re: Different spawn points - FrostDoggy - 15.09.2011

well that I know , I mean

I just put

public OnPlayerDeath

SetPlayerPos(playerid,-2424.2395,1003.6310,30.247);
SetPlayerPos(playerid,-5624.2395,6003.6310,15.5687);
SetPlayerPos(playerid,-9024.2395,853.6310,30.232);

And it will spawn randomly?
Not to the first one?


Re: Different spawn points - [MG]Dimi - 15.09.2011

https://sampwiki.blast.hk/wiki/random

^ Solution ^


Re: Different spawn points - |_ⒾⓇⓄN_ⒹⓄG_| - 15.09.2011

Quote:
Originally Posted by FrostDoggy
Посмотреть сообщение
well that I know , I mean

I just put

public OnPlayerDeath

SetPlayerPos(playerid,-2424.2395,1003.6310,30.247);
SetPlayerPos(playerid,-5624.2395,6003.6310,15.5687);
SetPlayerPos(playerid,-9024.2395,853.6310,30.232);

And it will spawn randomly?
Not to the first one?
No lol
top of gm
pawn Код:
new Float:RandomSpawns[][] =
{
    {-2424.2395,1003.6310,30.247},
    {-5624.2395,6003.6310,15.5687},
    {-9024.2395,853.6310,30.232}
};
ONPLAYERSpawn:
pawn Код:
new Random = random(sizeof(RandomSpawns));
    SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);



Re: Different spawn points - =WoR=Varth - 15.09.2011

pawn Код:
new bool:Dead[MAX_PLAYERS];

//OnPlayerDeath
Dead[playerid] = true;

//OnPlayerSpawn
if(Dead[playerid])
{
    switch(random(3))
    {
        case 0: SetPlayerPos(playerid,xxx,yyy,zzz);
        case 1: SetPlayerPos(playerid,xxx,yyy,zzz);
        case 2: SetPlayerPos(playerid,xxx,yyy,zzz);
    }
    Dead[playerid] = false;
}



Re: Different spawn points - |_ⒾⓇⓄN_ⒹⓄG_| - 15.09.2011

hum
i think we cant do it onplayerdeath
cuz player will spawn and go back to normal spawn
so...the dead boolean must be OnPlayerSpawn
edit : i didnt saw varthshenon post sorry


Re: Different spawn points - FrostDoggy - 15.09.2011

Thanks!

Tested & Works.

For spawning place I do the same?


Re: Different spawn points - =WoR=Varth - 15.09.2011

Yes.