Race vehicle
#1

Hi,

I want to make race start position i have position and i want to place car how much is racers if for ex:

2

position will be like that:

| |


if 3


| |
|



if four 4



| |
| |



if five 5


| |
| |
|


and so..
Reply
#2

Hi!

I don't understand your problem. How can we help you?
Reply
#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
#4

I know that, but i'am searcing for easier way, i want to calculate from any position because start could by anywhere i need calculate from one position, others
Reply
#5

Its easier via the method above, otherwise you need to start working the difference between vehicles and objects around those vehicles.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)