public OnPlayerEnterCheckpoint(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 3, 2644.8074,-1442.7813,30.2813))
{
CallRemoteFunction("MoneySet", "dd", playerid, 5);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "[Sweeper] You have collected $5 on your first checkpoint.");
SetPlayerCheckpoint(playerid, 2645.2512,-1586.4508,14.4760, 3.0);
}
else if(IsPlayerInRangeOfPoint(playerid, 3, 2645.2512,-1586.4508,14.4760))
{
CallRemoteFunction("MoneySet", "dd", playerid, 5);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "[Sweeper] You have collected $5 on your second checkpoint.");
SetPlayerCheckpoint(playerid, 2679.9390,-1655.0223,11.0642, 3.0);
}
else if(IsPlayerInRangeOfPoint(playerid, 3, 2679.9390,-1655.0223,11.0642))
{
CallRemoteFunction("MoneySet", "dd", playerid, 5);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "[Sweeper] You have collected $5 on your third checkpoint.");
SetPlayerCheckpoint(playerid, 2849.4407,-1675.0210,10.8750, 3.0);
}
else if(IsPlayerInRangeOfPoint(playerid, 3, 2849.4407,-1675.0210,10.8750))
{
CallRemoteFunction("MoneySet", "dd", playerid, 5);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "[Sweeper] You have collected $5 on your fourth checkpoint.");
SetPlayerCheckpoint(playerid, 2821.8525,-1868.4878,10.9426, 3.0);
}
else if(IsPlayerInRangeOfPoint(playerid, 3, 2821.8525,-1868.4878,10.9426))
{
CallRemoteFunction("MoneySet", "dd", playerid, 5);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "[Sweeper] You have collected $5 on your fifth checkpoint.");
SetPlayerCheckpoint(playerid, 2690.9890,-1878.5159,10.8828, 3.0);
}
else if(IsPlayerInRangeOfPoint(playerid, 3, 2690.9890,-1878.5159,10.8828))
{
CallRemoteFunction("MoneySet", "dd", playerid, 5);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "[Sweeper] You have collected $5 on your sixth checkpoint.");
SetPlayerCheckpoint(playerid, 2630.2695,-1730.7690,10.8746 , 3.0);
}
else if(IsPlayerInRangeOfPoint(playerid, 3, 2630.2695,-1730.7690,10.8746))
{
CallRemoteFunction("MoneySet", "dd", playerid, 5);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "[Sweeper] You have collected $5 on your seventh checkpoint.");
SetPlayerCheckpoint(playerid, 2427.2046,-1730.3483,13.5616 , 3.0);
}
else if(IsPlayerInRangeOfPoint(playerid, 3, 2427.2046,-1730.3483,13.5616))
{
CallRemoteFunction("MoneySet", "dd", playerid, 5);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "[Sweeper] You have collected $5 on your eight checkpoint.");
SetPlayerCheckpoint(playerid, 2433.2480,-1594.4696,25.3559, 3.0);
}
else if(IsPlayerInRangeOfPoint(playerid, 3, 2433.2480,-1594.4696,25.3559))
{
CallRemoteFunction("MoneySet", "dd", playerid, 5);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "[Sweeper] You have collected $5 on your ninth checkpoint.");
SetPlayerCheckpoint(playerid, 2453.1697,-1431.5006,23.8281, 3.0);
}
if(IsPlayerInRangeOfPoint(playerid, 3, 2453.1697,-1431.5006,23.8281))
{
CallRemoteFunction("MoneySet", "dd", playerid, 5);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "[Sweeper] You have collected $5 on your ten checkpoint.");
DisablePlayerCheckpoint(playerid);
}
return 1;
}
if(IsPlayerInRangeOfPoint(playerid, 3, 2644.8074,-1442.7813,30.2813)) { CallRemoteFunction("MoneySet", "dd", playerid, 5); SendClientMessage(playerid, COLOR_LIGHTBLUE, "[Sweeper] You have collected $5 on your first checkpoint."); //disable current cp DisablePlayerCheckpoint(playerid); //Show next one SetPlayerCheckpoint(playerid, 2645.2512,-1586.4508,14.4760, 3.0); } else if(IsPlayerInRangeOfPoint(playerid, 3, 2645.2512,-1586.4508,14.4760)) { CallRemoteFunction("MoneySet", "dd", playerid, 5); SendClientMessage(playerid, COLOR_LIGHTBLUE, "[Sweeper] You have collected $5 on your second checkpoint."); DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 2679.9390,-1655.0223,11.0642, 3.0); } //...
You can only show one checkpoint at a time. Use DisablePlayerCheckpoint (see description at top of that page) when a player enters a checkpoint, before creating the next one.
Using a streamer will be easier as it does a lot of the work for you (creating/destroying things for you). Another benefit of using a streamer is that CreateCheckpoint (or equivalent) usually returns a checkpoint id, so you don't need to do range checks, you can just compare IDs. But if your not using a streamer do something like this: Код:
if(IsPlayerInRangeOfPoint(playerid, 3, 2644.8074,-1442.7813,30.2813)) { CallRemoteFunction("MoneySet", "dd", playerid, 5); SendClientMessage(playerid, COLOR_LIGHTBLUE, "[Sweeper] You have collected $5 on your first checkpoint."); //disable current cp DisablePlayerCheckpoint(playerid); //Show next one SetPlayerCheckpoint(playerid, 2645.2512,-1586.4508,14.4760, 3.0); } else if(IsPlayerInRangeOfPoint(playerid, 3, 2645.2512,-1586.4508,14.4760)) { CallRemoteFunction("MoneySet", "dd", playerid, 5); SendClientMessage(playerid, COLOR_LIGHTBLUE, "[Sweeper] You have collected $5 on your second checkpoint."); DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 2679.9390,-1655.0223,11.0642, 3.0); } //... |
new Checkpoint[MAX_PLAYERS]; Checkpoint[playerid] = 1; //Put it in the first command public OnPlayerEnterCheckpoint(playerid) { if(Checkpoint[playerid] == 1) { Checkpoint[playerid] = 2; CallRemoteFunction("MoneySet", "dd", playerid, 5); SendClientMessage(playerid, COLOR_LIGHTBLUE, "[Sweeper] You have collected $5 on your first checkpoint."); SetPlayerCheckpoint(playerid, 2645.2512,-1586.4508,14.4760, 3.0); } else if(Checkpoint[playerid] == 2) { Checkpoint[playerid] = 3; CallRemoteFunction("MoneySet", "dd", playerid, 5); SendClientMessage(playerid, COLOR_LIGHTBLUE, "[Sweeper] You have collected $5 on your second checkpoint."); SetPlayerCheckpoint(playerid, 2679.9390,-1655.0223,11.0642, 3.0); } else if(Checkpoint[playerid] == 3) { Checkpoint[playerid] = 4; CallRemoteFunction("MoneySet", "dd", playerid, 5); SendClientMessage(playerid, COLOR_LIGHTBLUE, "[Sweeper] You have collected $5 on your third checkpoint."); SetPlayerCheckpoint(playerid, 2849.4407,-1675.0210,10.8750, 3.0); } else if(Checkpoint[playerid] == 4) { Checkpoint[playerid] = 5; CallRemoteFunction("MoneySet", "dd", playerid, 5); SendClientMessage(playerid, COLOR_LIGHTBLUE, "[Sweeper] You have collected $5 on your fourth checkpoint."); SetPlayerCheckpoint(playerid, 2821.8525,-1868.4878,10.9426, 3.0); } else if(Checkpoint[playerid] == 5) { Checkpoint[playerid] = 6; CallRemoteFunction("MoneySet", "dd", playerid, 5); SendClientMessage(playerid, COLOR_LIGHTBLUE, "[Sweeper] You have collected $5 on your fifth checkpoint."); SetPlayerCheckpoint(playerid, 2690.9890,-1878.5159,10.8828, 3.0); } else if(Checkpoint[playerid] == 6) { Checkpoint[playerid] = 7; CallRemoteFunction("MoneySet", "dd", playerid, 5); SendClientMessage(playerid, COLOR_LIGHTBLUE, "[Sweeper] You have collected $5 on your sixth checkpoint."); SetPlayerCheckpoint(playerid, 2630.2695,-1730.7690,10.8746 , 3.0); } else if(Checkpoint[playerid] == 7) { Checkpoint[playerid] = 8; CallRemoteFunction("MoneySet", "dd", playerid, 5); SendClientMessage(playerid, COLOR_LIGHTBLUE, "[Sweeper] You have collected $5 on your seventh checkpoint."); SetPlayerCheckpoint(playerid, 2427.2046,-1730.3483,13.5616 , 3.0); } else if(Checkpoint[playerid] == 8) { Checkpoint[playerid] = 9; CallRemoteFunction("MoneySet", "dd", playerid, 5); SendClientMessage(playerid, COLOR_LIGHTBLUE, "[Sweeper] You have collected $5 on your eight checkpoint."); SetPlayerCheckpoint(playerid, 2433.2480,-1594.4696,25.3559, 3.0); } else if(Checkpoint[playerid] == 9) { Checkpoint[playerid] = 10; CallRemoteFunction("MoneySet", "dd", playerid, 5); SendClientMessage(playerid, COLOR_LIGHTBLUE, "[Sweeper] You have collected $5 on your ninth checkpoint."); SetPlayerCheckpoint(playerid, 2453.1697,-1431.5006,23.8281, 3.0); } if(Checkpoint[playerid] == 10) { Checkpoint[playerid] = 0; CallRemoteFunction("MoneySet", "dd", playerid, 5); SendClientMessage(playerid, COLOR_LIGHTBLUE, "[Sweeper] You have collected $5 on your ten checkpoint."); DisablePlayerCheckpoint(playerid); } return 1; }
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == vehicleid) //use sweeper id { Code }