30.10.2010, 14:46
I think you are misunderstanding something.
cp[playerid] is changing in your script.
If you enter the first checkpoint, then cp[playerid] is 0, so first if is true and other else if's won't be executed.
But if you enter second checkpoint, then cp[playerid] is 1, so first is false and it takes the next else if.
cp[playerid] is changing in your script.
If you enter the first checkpoint, then cp[playerid] is 0, so first if is true and other else if's won't be executed.
pawn Код:
if (cp[playerid] == 0) // true
{
cp[playerid] = SetPlayerRaceCheckpoint(playerid, 0, -2143.2742,-2006.9039,95.0157, -2145.5430,-1958.8540,117.9665, 9);
cp[playerid] = 1
}
else if (cp[playerid] == 1) // won't be called
{
cp[playerid] = SetPlayerRaceCheckpoint(playerid, 0, -2145.5430,-1958.8540,117.9665, -2474.9404,-2077.9385,124.7880, 9);
cp[playerid] = 2;
}
pawn Код:
if (cp[playerid] == 0) // false
{
cp[playerid] = SetPlayerRaceCheckpoint(playerid, 0, -2143.2742,-2006.9039,95.0157, -2145.5430,-1958.8540,117.9665, 9);
cp[playerid] = 1
}
else if (cp[playerid] == 1) // true
{
cp[playerid] = SetPlayerRaceCheckpoint(playerid, 0, -2145.5430,-1958.8540,117.9665, -2474.9404,-2077.9385,124.7880, 9);
cp[playerid] = 2;
}