public OnPlayerEnterCheckpoint(playerid) { DisablePlayerCheckpoint(playerid); SendClientMessage(playerid,COLOR_ORANGE,"Drive back to docks!"); SetPlayerCheckpoint(playerid,2462.9810,-2097.6760,13.5469, 5.0); return 1; }
DisablePlayerCheckpoint(playerid); GivePlayerMoney(playerid,1000); SendClientMessage(playerid,COLOR_ORANGE,"You have finished delivery!"); DestroyVehicle(GetPlayerVehicleID(playerid));
public OnPlayerEnterCheckpoint(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, X, Y, Z))
{
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid,COLOR_ORANGE,"Drive back to docks!");
SetPlayerCheckpoint(playerid,2462.9810,-2097.6760,13.5469, 5.0);
}
if(IsPlayerInRangeOfPoint(playerid, 5.0, X, Y, Z))
{
DisablePlayerCheckpoint(playerid);
GivePlayerMoney(playerid,1000);
SendClientMessage(playerid,COLOR_ORANGE,"You have finished delivery!");
DestroyVehicle(GetPlayerVehicleID(playerid));
}
return 1;
}
new Checkpoint[MAX_PLAYERS];
SetPlayerCheckpoint(playerid,your frist checkpoint settings..
Checkpoint[playerid] = 1;
public OnPlayerEnterCheckpoint(playerid)
{
if(Checkpoint[playerid] == 1) {
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid,COLOR_ORANGE,"Drive back to docks!");
SetPlayerCheckpoint(playerid,2462.9810,-2097.6760,13.5469, 5.0);
Checkpoint[playerid] = 2;
} else if(Checkpoint[playerid] == 2) {
DisablePlayerCheckpoint(playerid);
GivePlayerMoney(playerid,1000);
SendClientMessage(playerid,COLOR_ORANGE,"You have finished delivery!");
DestroyVehicle(GetPlayerVehicleID(playerid));
Checkpoint[playerid] = 0;
}
return 1;
}
stock SetPlayerCheckpointEx(playerid, Float:x, Float:y, Float:z, Float:range, id)
{
SetPlayerCheckpoint(playerid, x, y, z, range);
Checkpoint[playerid] = id;
}
For this you should use either streamer or IsPlayerInRangeOfPoint function.
Example pawn Код:
|
SetPlayerCheckpoint(playerid,-49.0372,-1150.6403,1.0781, 5.0); Checkpoint[playerid] = 1;