Big problem. Should return a value
#10

Quote:
Originally Posted by iOxide
Посмотреть сообщение
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.
While the return 1;'s aren't necessary, they did not cause the error.

@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;
}
Reply


Messages In This Thread
Big problem. Should return a value - by prooftzm - 27.06.2014, 16:10
Re: Big problem. Should return a value - by luis_mendoza - 27.06.2014, 16:15
Re: Big problem. Should return a value - by iOxide - 27.06.2014, 16:15
Re: Big problem. Should return a value - by prooftzm - 27.06.2014, 16:17
Re: Big problem. Should return a value - by prooftzm - 27.06.2014, 16:34
Re: Big problem. Should return a value - by prooftzm - 27.06.2014, 16:36
Re: Big problem. Should return a value - by Dziugsas - 27.06.2014, 16:37
Re: Big problem. Should return a value - by prooftzm - 27.06.2014, 16:39
Re: Big problem. Should return a value - by Dziugsas - 27.06.2014, 16:40
Re: Big problem. Should return a value - by Dignity - 27.06.2014, 16:42

Forum Jump:


Users browsing this thread: 1 Guest(s)