30.03.2016, 12:39
Okay it's very easy to do. First of all, let's say you have a 4 people race. This means they should be placed like this:
Now, go in game and use /save to save these positions at the race start.
Now in your script, create a variable:
Now, when someone joins the race:
Also, make sure to do Racers=0; when the race ends and if a racer disconnects:
Код:
| | | |
Now in your script, create a variable:
Код:
new Racers=0; new bool: pInRace[MAX_PLAYERS];
Код:
Racers++; pInRace[playerid]=true; if(Racers == 1) { SetPlayerPos(playerid, X1, Y1, Z1); } else if(Racers == 2) { SetPlayerPos(playerid, X2, Y2, Z2); } // and so on...
Код:
X1 = The X position for first racer Y1 = The Y position for the first racer Z1 = The Z position for the first racer X2 = The X position for the second racer Y2 = The Y position for the second racer Z2 = The Z position for the second racer // And so on...
Код:
if(pInRace[playerid] == true) { Racers--; }