How To Make Player Spawn In Custom Loc. - 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: How To Make Player Spawn In Custom Loc. (
/showthread.php?tid=292520)
How To Make Player Spawn In Custom Loc. -
15outland - 24.10.2011
Hi,
I'm fairly new to all this, but I'm just wonder, how I can get players to spawn in locations..
I'm using ruNix's CnR gamemode, and people spawn randomly across the map (police do spawn in stations like normal, but just diff spots on map)
So, I wanted to make it a SF map, but I don't know how I can make them spawn there...
any help?
Re: How To Make Player Spawn In Custom Loc. -
StuffBoy - 24.10.2011
wiki.sa-mp.com is your best friend

take a look at SetPlayerPos on the functions
Re: How To Make Player Spawn In Custom Loc. -
Kitten - 24.10.2011
pawn Код:
public OnPlayerSpawn(playerid)
{
new randomspawn = random( number of your spawns );
switch ( randomspawn )
{
case 1 : SetPlayerPos( playerid , x , y , z ) ; // Random Spawn 1
case 2 : SetPlayerPos( playerid , x , y , z ) ; // Random Spawn 2
// add more if you want
}
return 1;
}
or just follow the samp wiki one
https://sampwiki.blast.hk/wiki/Random