Spawn in different places
#1

Hello, on my server the lpayer when dies, always returns the same place. I want that to varie. For example: I die now and I spawn in place "BLUE" then die again and spawn in place "RED"
(Blue and Red are just examples so they know they are two different places)
Reply
#2

On top script

Код:
new BlueSpawn[3][PlayerSpawnInfo] = 
{
{X,Y,Z},
{X,Y,Z},
{X,Y,Z}
};
onplayerspawn
Код:
new rand = random(sizeof(BlueSpawn));
SetPlayerPos(playerid,BlueSpawn[rand][PlayerX],BlueSpawn[rand][PlayerY],BlueSpawn[rand][PlayerZ]);
i forgot this

Код:
enum PlayerSpawnInfo
{
	Float:PlayerX,
	Float:PlayerY,
	Float:PlayerZ
}
on top
Reply
#3

look at this is very useful!
https://sampforum.blast.hk/showthread.php?tid=162488
Reply
#4

The wiki for the function "random" has this as an example

https://sampwiki.blast.hk/wiki/Random
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)