03.02.2013, 12:14
Hi, so I need some help with race checkpoints.
on top of the script:
Creating first checkpoint:
The callback:
The problem is that when i enter the first checkpoint - the server thinks I entered the last checkpoint and writes "Someone finished duel track one"
on top of the script:
pawn Код:
new dcp[MAX_PLAYERS][10];
pawn Код:
dcp[playerid][0] = SetPlayerRaceCheckpoint(PlayerThatInvited, 0, 2720.0857, -2405.7524, 13.4609, 2345.2678, -2662.7524, 13.5229, 4);
pawn Код:
public OnPlayerEnterRaceCheckpoint(playerid)
{
// Track #1
// 2720.0857,-2405.7524,13.4609 Start
// 2345.2678,-2662.7524,13.5229 2nd
// 2391.4956,-2407.0464,13.3803 3rd
// 2719.8816,-2405.5457,13.4609 Finish
// Track #2
if(dcp[playerid][0])
{
dcp[playerid][0] = -1;
dcp[playerid][1] = SetPlayerRaceCheckpoint(playerid, 0, 2345.2678, -2662.7524, 13.5229, 2391.4956, -2407.0464, 13.3803, 4);
}
if(dcp[playerid][1])
{
dcp[playerid][1] = -1;
dcp[playerid][2] = SetPlayerRaceCheckpoint(playerid, 0, 2391.4956,-2407.0464,13.3803, 2719.8816,-2405.5457,13.4609, 4);
}
if(dcp[playerid][2])
{
dcp[playerid][2] = -1;
dcp[playerid][3] = SetPlayerRaceCheckpoint(playerid, 0, 2719.8816,-2405.5457,13.4609, 2719.8816,-2405.5457,13.4609, 4);
}
if(dcp[playerid][3])
{
dcp[playerid][3] = -1;
DisablePlayerRaceCheckpoint(playerid);
SendClientMessageToAll(-1, "Someone finished duel track one");
cmd_dueloff(playerid);
}
return 1;
}