SA-MP Forums Archive
Random spawn help - 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 help (/showthread.php?tid=543204)



Random spawn help - Glossy42O - 25.10.2014

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

You need code? tell me


Re: Random spawn help - Rudy_ - 25.10.2014

yes we need code -.-


AW: Random spawn help - Flori - 25.10.2014

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.


Re: Random spawn help - Glossy42O - 25.10.2014

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]); 



Re: Random spawn help - Steel_ - 25.10.2014

Use GetPlayerSkin to detect if the player is a cop.


Re: Random spawn help - Glossy42O - 25.10.2014

Okay.


Re: Random spawn help - Glossy42O - 25.10.2014

To be honest idk how to do it really.

New scripter..


Re: Random spawn help - Laurey - 25.10.2014

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]);
}



Re: Random spawn help - NeGaTiveZ - 25.10.2014

I think just use setpos for cops..


Re: Random spawn help - Glossy42O - 25.10.2014

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?