SA-MP Forums Archive
random spawn hospitals - 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: random spawn hospitals (/showthread.php?tid=475438)



random spawn hospitals - Another1 - 13.11.2013

can i do OnPlayerDeath random spawn hospitals.. like if someone die in ls hes gone to los santos hospital and if die in sf hes gone to sf hospital

Sorry for my english :/


Re: random spawn hospitals - David (Sabljak) - 13.11.2013

Код:
new RandomSpawnHospital[4][PlayerSpawnInfo] =
{
	{X,Y,Z},
	{X,Y,Z},
	{X,Y,Z},
	{X,Y,Z}//so on...
};
onplayerspawn

check if hospital

Код:
If(your variable for hosiptal = 1
{
new rands = random(sizeof(RandomSpawnHospital));
SetPlayerPos(playerid,RandomSpawnHospital[rands][PlayerX],RandomSpawnHospital[rands][PlayerY],RandomSpawnHospital[rands][PlayerZ]);
}