Random spawns
#1

Hello,

How do I make it so when someone joins and they pick a skin or when they die it spawns them at a random position that I make?

Thanks
Reply
#2

Top of the script:

Код:
new Float: RandomSpawns[3][] = {
{X,Y,Z},
{X,Y,Z},
{X,Y,Z}
};
The cell-number (which has a value of 3 currently), changes on an accord of how many sets of co-ordinates you put in there. Change the X,Y,Z as well, obviously.

Код:
public OnPlayerSpawn(playerid)
{
SetPlayerPos(playerid,RandomSpawns[random(3)]);
return 1;
}
I'm not sure, that might work.
Reply
#3

This is what i use: (and it works perfectly, for me anyway)
Код:
public OnPlayerSpawn(playerid)
{
  new rand;
	rand = random(5);
	rand++; 
	switch(rand)
	{
	case 1: { SetPlayerPos(playerid, X,Y,Z); SetPlayerFacingAngle(playerid, Angle); SetCameraBehindPlayer(playerid);}
	case 2: { SetPlayerPos(playerid, X,Y,Z); SetPlayerFacingAngle(playerid, Angle); SetCameraBehindPlayer(playerid);}
	case 3: { SetPlayerPos(playerid, X,Y,Z); SetPlayerFacingAngle(playerid, Angle); SetCameraBehindPlayer(playerid);}
	case 4: { SetPlayerPos(playerid, X,Y,Z); SetPlayerFacingAngle(playerid, Angle); SetCameraBehindPlayer(playerid);}
	case 5: { SetPlayerPos(playerid, X,Y,Z); SetPlayerFacingAngle(playerid, Angle); SetCameraBehindPlayer(playerid);}
	}
	return 1;
}
Reply
#4

Clinz,

I get these errors:

Код:
C:\Users\Damien\Desktop\samp server\gamemodes\deathhour.pwn(14) : error 018: initialization data exceeds declared size
C:\Users\Damien\Desktop\samp server\gamemodes\deathhour.pwn(65) : error 010: invalid function or declaration
C:\Users\Damien\Desktop\samp server\gamemodes\deathhour.pwn(117) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
http://pastebin.com/mfb928b3
Reply
#5

Here, pastebin.com/fec18517, use this...
Reply
#6

Quote:
Originally Posted by еddy
Here, pastebin.com/fec18517, use this...
Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)