Random spawn help
#1

I got random spawn it works perfectly but i need the police NOT to random spawn.

You need code? tell me
Reply
#2

yes we need code -.-
Reply
#3

Just add a playervariable for cops. When the player who is spawning is a cop, set his position to a specific pos. When he isn't a cop, set the random spawnpos.
Reply
#4

Hello rudy.

Here are the codes.
PHP код:
new Float:RandomSpawns[][] =
{
  {
425.5645,-1778.4537,5.5469,357.3496},
  {
790.4620,-1629.5061,13.3828,267.7632},
  {
1143.0552,-1388.1757,13.8137,178.0773},
  {
1671.9475,-1585.7109,13.5469,178.9575},
  {
1408.9834,-1725.4763,13.5391,182.0253},
  {
1335.8291,-1312.0231,13.5469,270.9686},
  {
790.4620,-1629.5061,13.3828,267.7632},
  {
2317.6921,-1665.0355,14.2129,0.7005}
}; 
PHP код:
new Random random(sizeof(RandomSpawns));
SetPlayerPos(playeridRandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
SetPlayerFacingAngle(playeridRandomSpawns[Random][3]); 
Reply
#5

Use GetPlayerSkin to detect if the player is a cop.
Reply
#6

Okay.
Reply
#7

To be honest idk how to do it really.

New scripter..
Reply
#8

Well either use the cops faction id or as somebody already said above use the skin id.
pawn Код:
new Random = random(sizeof(RandomSpawns));
if(PlayerInfo][playerid][pFaction] != facidhere)
{
    SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
    SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);
}
Reply
#9

I think just use setpos for cops..
Reply
#10

Quote:
Originally Posted by Laurey
Посмотреть сообщение
Well either use the cops faction id or as somebody already said above use the skin id.
pawn Код:
new Random = random(sizeof(RandomSpawns));
if(PlayerInfo][playerid][pFaction] != facidhere)
{
    SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
    SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);
}
What do you mean?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)