27.06.2014, 16:42
Quote:
Why do you have return 1; in each else statement? Remove it. Thats the reason its showing the error. You don't need to return a value after using else statement to send a client message.
|
@OP:
You don't need to add callbacks for a single function after a "else" statement. (as iOxide already mentioned) I fixed your indentation and shortened your command, please tell me if it works. Also, if your "you cannot take the job" messages persist after this, you need to fix your coordinates.
pawn Код:
CMD:takejob(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1030.9374,-1442.4918,13.5546))
{
if(PlayerInfo[playerid][pJob] == 0)
{
SendClientMessage(playerid,COLOR_AQUA, "***Felicitari!*** Acum ai jobul Deliver.***");
SendClientMessage(playerid,COLOR_AQUA, "***Comenzile jobului: /work, /quitjob.***");
PlayerInfo[playerid][pJob] = 1;
}
else SendClientMessage(playerid,0x6A6A6AFF, "Ai deja un job. Foloseste /quitjob intai.");
}
else if(IsPlayerInRangeOfPoint(playerid, 3.0, 2093.7031,-2032.5769,13.5469))
{
if(PlayerInfo[playerid][pJob] < 1)
{
SendClientMessage(playerid, COLOR_AQUA, "***Felicitari! Acum ai jobul Garbage Man.**");
SendClientMessage(playerid, COLOR_AQUA, "***Comenzile jobuli: /garbage, /quitjob.**");
PlayerInfo[playerid][pJob] = 2;
}
else SendClientMessage(playerid, 0x6A6A6AFF, "Ai deja un job. Foloseste /quitjob intai.");
}
else SendClientMessage(playerid, 0x6A6A6AFF, "Nu poti lua jobul de aici.");
else if(IsPlayerInRangeOfPoint(playerid, 3.0, -401.3627,-1419.2340,25.7209))
{
if(PlayerInfo[playerid][pJob] < 1)
{
SendClientMessage(playerid, COLOR_AQUA, "***Felicitari! Acum ai jobul Fermier.**");
SendClientMessage(playerid, COLOR_AQUA, "***Comenzile jobuli: /recolteaza, /quitjob.**");
PlayerInfo[playerid][pJob] = 3;
}
else SendClientMessage(playerid, 0x6A6A6AFF, "Ai deja un job. Foloseste /quitjob intai.");
}
else SendClientMessage(playerid, 0x6A6A6AFF, "Nu poti lua jobul de aici.");
}
return 1;
}