SendClientMessage(playerid, COLOR_RED, "You're not in range of the job"
COMMAND:work(playerid, cmdtext) //You can edit this
{
if (!IsPlayerInRangeOfPoint(playerid, 7.0, -64.1551,-1120.6709,1.0781))
{
SendClientMessage(playerid, blue, "Welcome to work!"); //You can edit this
SendClientMessage(playerid, yellow, "Please drive to the checkpoint to recieve your reward."); //You can edit this
new thevehicle = CreateVehicle(498, -79.2382, -1128.1711, 1.0781, 0.0, 0, 0, 5000);
PutPlayerInVehicle(playerid, thevehicle, 0);
SetPlayerCheckpoint(playerid, 1827.8311,-1075.7113,23.9317, 4.0);
}
return 1;
}
COMMAND:work(playerid, cmdtext) //You can edit this
{
if (!IsPlayerInRangeOfPoint(playerid, 7.0, -64.1551,-1120.6709,1.0781))
{
{
else SendClientMessage(playerid, COLOR_RED, "You're not in range of the job");
}
SendClientMessage(playerid, blue, "Welcome to work!"); //You can edit this
SendClientMessage(playerid, yellow, "Please drive to the checkpoint to recieve your reward."); //You can edit this
new thevehicle = CreateVehicle(498, -79.2382, -1128.1711, 1.0781, 0.0, 0, 0, 5000);
PutPlayerInVehicle(playerid, thevehicle, 0);
SetPlayerCheckpoint(playerid, 1827.8311,-1075.7113,23.9317, 4.0);
}
return 1;
}
COMMAND:work(playerid, cmdtext) //You can edit this
{
if (!IsPlayerInRangeOfPoint(playerid, 7.0, -64.1551,-1120.6709,1.0781))
{
return SendClientMessage(playerid, COLOR_RED, "You're not in range of the job");
}
SendClientMessage(playerid, blue, "Welcome to work!"); //You can edit this
SendClientMessage(playerid, yellow, "Please drive to the checkpoint to recieve your reward."); //You can edit this
new thevehicle = CreateVehicle(498, -79.2382, -1128.1711, 1.0781, 0.0, 0, 0, 5000);
PutPlayerInVehicle(playerid, thevehicle, 0);
SetPlayerCheckpoint(playerid, 1827.8311,-1075.7113,23.9317, 4.0);
return 1;
}
COMMAND:work(playerid, cmdtext) //You can edit this
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, -64.1551,-1120.6709,1.0781))
{
SendClientMessage(playerid, blue, "Welcome to work!"); //You can edit this
SendClientMessage(playerid, yellow, "Please drive to the checkpoint to recieve your reward."); //You can edit this
new thevehicle = CreateVehicle(498, -79.2382, -1128.1711, 1.0781, 0.0, 0, 0, 5000);
PutPlayerInVehicle(playerid, thevehicle, 0);
SetPlayerCheckpoint(playerid, 1827.8311,-1075.7113,23.9317, 4.0);
}
else SendClientMessage(playerid, COLOR_RED, "You're not in range of the job");
return 1;
}
You were trying to check if the player was not near the position, therefore it would execute the command. Try this code.
pawn Код:
|