Try something like this:
pawn Код:
{
if (strcmp("/dishwasher", cmdtext, true, 10) == 0)
{
if( IsPlayerInRangeOfPoint( playerid,dist, X, Y, Z )
{
SetPlayerCheckpoint(playerid, HotPoint1, 3.0);
GameTextForPlayer(playerid, "~g~You started the job, good luck!", 3000, 4);
new name[MAX_PLAYER_NAME], string[48];
GetPlayerName(playerid, name, sizeof(name));
SendClientMessageToAll(COLOR_RED, string);
return 1;
}
else SendClientMessage( playerid, -1, "You are not at the job possition." );
}
return 0;
}
Now, dist means the distance from the point (pickup, where you use /dishwasher) you want, try something like 1.5.
X,Y,Z are the job coordinates, where exactly you want the /dishwasher command to work.
ps: I don`t see the point of:
pawn Код:
new name[MAX_PLAYER_NAME], string[48];
GetPlayerName(playerid, name, sizeof(name));
SendClientMessageToAll(COLOR_RED, string);
You have any idea why is it there?