Race vehicle
#3

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:

Код:
new Racers=0;
new bool: pInRace[MAX_PLAYERS];
Now, when someone joins the race:

Код:
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...
Also, make sure to do Racers=0; when the race ends and if a racer disconnects:

Код:
if(pInRace[playerid] == true) { Racers--; }
Reply


Messages In This Thread
Race vehicle - by ScIrUsna - 30.03.2016, 12:17
Re: Race vehicle - by Mencent - 30.03.2016, 12:23
Re: Race vehicle - by Lucky13 - 30.03.2016, 12:39
Re: Race vehicle - by ScIrUsna - 30.03.2016, 12:52
Re: Race vehicle - by theonethatownz - 30.03.2016, 12:59

Forum Jump:


Users browsing this thread: 2 Guest(s)