Making races
#1

Hey, I am working on a racingserver but my checkpoints is not appearing..

I did a little try to start with.
Код:
public OnPlayerEnterRaceCheckpoint(playerid)
{
	SetPlayerRaceCheckpoint (playerid,0,1430.0835,207.2409,18.1294,1507.9691,237.9281,18.1316,2);//Checkpoint 1
	SetPlayerRaceCheckpoint (playerid,1,1507.9691,237.9281,18.1316,1631.6682,267.4311,19.4609,2);//Checkpoint 2
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	DisablePlayerRaceCheckpoint (playerid);
	return 1;
}
Can you see anything wrong in this?
Reply
#2

You can only show one race CP at the time. And you should set the race CP before, because OnPlayerEnterRaceCheckpoint is called when player enters the race CP.
Reply
#3

So where am i supposed to put it?
Reply
#4

I don't know, how do you want it? In a command, timer?
Reply
#5

No. I am supposed to spawn, enter a car and race
Reply
#6

So set a race CP when you spawn or when player's on-foot state changes to driver state.
Reply
#7

What, OnPlayerEnterVehicle or OnPlayerKeyStateChange :S
Reply
#8

It''s not stealing, I see it as learning from that masters. Check this script out, coded by Ryder:
http://forum.sa-mp.com/index.php?topic=169121.0
Genius way to switching what CP to show.

Basically you need a start point (something like add players to race). That would show checkpoint 1.
When OnPlayerEnterCheckpoint is called, show checkpoint 2 (in your case, the finish checkpoint).

Quote:
Originally Posted by Don Correlli
You can only show one race CP at the time.
True, but using normal checkpoints (not race checkpoints) can have a similar effect.
Or (as we do) use a map icon to show where the next checkpoint is.
Reply
#9

It was to hard to understand, but i put the first checkpoint on OnPlayerEnterVehicle,
And the rest of them on OnPlayerEnterRaceCheckpoint
Reply
#10

OnPlayerEnterVehicle can be called even if player cancels his entry. Use OnPlayerStateChange and check for old state (on-foot) and new state (driver).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)