-1145.5658,-1045.6901,128.5027 [ Race Cp -1 ] -1183.2870,-1002.4471,128.5025 [ Race Cp -2 ] -1172.3785,-988.5954,128.5025 [ Race Cp - 3] -1129.6694,-1018.2800,128.5025 [ Race Cp -4 ] -1098.4072,-1057.1410,128.4954 [ Race Cp -5 ] -1045.0264,-1022.5968,128.4956 [ Race Cp -6 ] -1011.6423,-980.4113,128.5025 [ Race Cp - 7 ] -1035.6104,-953.7844,128.5026 [ Race Cp - 8 ] -1081.0226,-997.9811,128.5026 [ Race Cp - 9 ] -1089.9166,-962.7728,128.5025 [ Race Cp -10] -1123.8011,-964.7301,128.5021 [ Race Cp -11 ] -1156.1207,-932.0033,128.5025 [ Race Cp -12 ] -1210.1948,-1017.1234,127.5494 [ Race Cp -13 ] -1145.9674,-1034.9795,128.5025 [ Race Cp -14 ] |
SetPlayerRaceCheckpoint(playerid, 0, x[0], y[0], z[0], x[1], y[1], z[1], 5);
// Sets the players race checkpoint to the coordinates number "0", and the arrow will be pointing to the next checkpoint, at coordinates number "1"
public OnPlayerEnterRaceCheckpoint(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 5, x[0], y[0], z[0]))
// If the player is in range of the coordinates number "0", the same coordinates as the first checkpoint is at
{
SetPlayerRaceCheckpoint(playerid, 0, x[1], y[1], z[1], x[2], y[2], z[2], 5);
// Then set the next checkpoint, at coordinates "1", and make the arrow point to coordinates number "2"
}
if(IsPlayerInRangeOfPoint(playerid, 5, x[1], y[1], z[1]))
// If the player is in range of the coordinates number "1", the same coordinates as the second checkpoint is at
{
SetPlayerRaceCheckpoint(playerid, 0, x[2], y[2], z[2], x[3], y[3], z[3], 5);
// Then set the next checkpoint, at coordinates "2", and make the arrow point to coordinates number "3"
}
// Continue for all checkpoints
return 1;
}
new const Float:gCheckpoints[][3] = {
{-1145.5658,-1045.6901,128.5027},
{-1183.2870,-1002.4471,128.5025},
// etc, etc
{-1145.9674,-1034.9795,128.5025}
};
new gCurrentPlayerCheckpoint[MAX_PLAYERS] = {0, ...}; // this stores the id of the currently visible checkpoint
SetPlayerRaceCheckpoint
(
playerid,
0, // type
gCheckpoints[gCurrentPlayerCheckpoint[playerid]][0], // x
gCheckpoints[gCurrentPlayerCheckpoint[playerid]][1], // y
gCheckpoints[gCurrentPlayerCheckpoint[playerid]][2], // z
gCheckpoints[gCurrentPlayerCheckpoint[playerid] + 1][0], //nextx
gCheckpoints[gCurrentPlayerCheckpoint[playerid] + 1][1], //nexty
gCheckpoints[gCurrentPlayerCheckpoint[playerid] + 1][2], // nextz
6.0 // size
);
CMD:kart1(playerid, params[]) { SetPlayerRaceCheckpoint(playerid, 0, -1145.5658,-1045.6901,128.5027,-1183.2870,-1002.4471,128.5025, 5); return 1; } public OnPlayerEnterRaceCheckpoint(playerid) { if(IsPlayerInRangeOfPoint(playerid, 5, -1145.5658,-1045.6901,128.5027)) { SetPlayerRaceCheckpoint(playerid, 0, -1183.2870,-1002.4471,128.5025, -1172.3785,-988.5954,128.5025, 5); } if(IsPlayerInRangeOfPoint(playerid, 5, -1183.2870,-1002.4471,128.5025)) { SetPlayerRaceCheckpoint(playerid, 1, -1172.3785,-988.5954,128.5025, -1129.6694,-1018.2800,128.5025, 5); } if(IsPlayerInRangeOfPoint(playerid, 5,-1098.4072,-1057.1410,128.4954)) return 1; } |
C:\Users\Tarun\Desktop\Ultimate SAMP KeyBinder\New folder (2)\gamemodes\rp.pwn(111) : warning 209: function "OnPlayerEnterRaceCheckpoint" should return a value C:\Users\Tarun\Desktop\Ultimate SAMP KeyBinder\New folder (2)\gamemodes\rp.pwn(139) : error 021: symbol already defined: "OnPlayerEnterRaceCheckpoint" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error. |
CMD:kart1(playerid)
{
SetPlayerRaceCheckpoint(playerid, 0, -1145.5658,-1045.6901,128.5027,-1183.2870,-1002.4471,128.5025, 5);
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 5, -1145.5658,-1045.6901,128.5027))
{
SetPlayerRaceCheckpoint(playerid, 0, -1183.2870,-1002.4471,128.5025, -1172.3785,-988.5954,128.5025, 5);
}
else if(IsPlayerInRangeOfPoint(playerid, 5, -1183.2870,-1002.4471,128.5025))
{
SetPlayerRaceCheckpoint(playerid, 1, -1172.3785,-988.5954,128.5025, -1129.6694,-1018.2800,128.5025, 5);
}
else if(IsPlayerInRangeOfPoint(playerid, 5,-1098.4072,-1057.1410,128.4954))
{
//here u made nothing..lol
}
return 1;
}