Spawning in an order?
#1

Hello.
Is it possible to spawn players in order?

Like if a player connects to a server and than he spawns than the second player comes but he get spawned at the second location, third player third location etc and if second player quits that the fourth player who come gets spawned at second location..

Is that possible?

Thanks!
Reply
#2

Anyone?
Reply
#3

Probably is possible but may be hard to script.
Reply
#4

Hmm, you could use something to get the players ID, so whatever ID they have, corresponds to what spawn they get. Not sure how to do it, but try this:

https://sampwiki.blast.hk/wiki/GetPlayerID
Reply
#5

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(playerid == 0) SetSpawnInfo(playerid,team,skin,Float:x,Float:y,Float:z,Float:rotation,weapon1,weapon1_ammo,weapon2,weapon2_ammo,weapon3,weapon3_ammo);
    if(playerid == 1) SetSpawnInfo(playerid,team,skin,Float:x,Float:y,Float:z,Float:rotation,weapon1,weapon1_ammo,weapon2,weapon2_ammo,weapon3,weapon3_ammo);
    //Add as many as you like
    SpawnPlayer(playerid);
    return 1;
}

EDIT: Or maybe you want to use SetPlayerPos.
Reply
#6

Quote:

...and if second player quits that the fourth player who come gets spawned at second location...

Point is to order locations not player ids. Maybe defining spawn locations and then using tons of
pawn Код:
if
codes?
Reply
#7

Quote:
Originally Posted by [MG]Dimi
Посмотреть сообщение
Point is to order locations not player ids. Maybe defining spawn locations and then using tons of
pawn Код:
if
codes?
Quote:
Originally Posted by varthshenon
Посмотреть сообщение
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(playerid == 0) SetSpawnInfo(playerid,team,skin,Float:x,Float:y,Float:z,Float:rotation,weapon1,weapon1_ammo,weapon2,weapon2_ammo,weapon3,weapon3_ammo);
    if(playerid == 1) SetSpawnInfo(playerid,team,skin,Float:x,Float:y,Float:z,Float:rotation,weapon1,weapon1_ammo,weapon2,weapon2_ammo,weapon3,weapon3_ammo);
    //Add as many as you like
    SpawnPlayer(playerid);
    return 1;
}

EDIT: Or maybe you want to use SetPlayerPos.
The code above should work. When someone leaves with playerid 2, the next one that connects is automatically playerid 2.
Reply
#8

But if player id 4 dies and player id 2 isn't connected id 4 should spawn on 2's position. That's how I have understood.
Reply
#9

Thanks guys for all the help. I put slots on every spawn point, so when player spawns on Spawn point 1 that Slot1 = 1; than when secound player connects it checks Spawn point 1 if its 1 than moves to spawn point 2 etc.

I have i new problem
I'm making a derby and almost everything is ready. I just can't figure out how to make that the last guy "standing" is the winner. Any of you know how?

Thanks.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)