Big problem. Should return a value
#7

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;
                return 1;
            }
            else
            {
                SendClientMessage(playerid,0x6A6A6AFF, "Ai deja un job. Foloseste /quitjob intai.");
                return 1;
            }
        }

        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;
                return 1;
            }
            else
            {
                SendClientMessage(playerid, 0x6A6A6AFF, "Ai deja un job. Foloseste /quitjob intai.");
                return 1;
            }
        }
        else
        {
            SendClientMessage(playerid, 0x6A6A6AFF, "Nu poti lua jobul de aici.");
            return 1;
        }
    }
    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;
                return 1;
            }
            else
            {
                SendClientMessage(playerid, 0x6A6A6AFF, "Ai deja un job. Foloseste /quitjob intai.");
                return 1;
            }
        }
        else
        {
            SendClientMessage(playerid, 0x6A6A6AFF, "Nu poti lua jobul de aici.");
            return 1;
        }
    }
    return 1;
}
if you wont type return in every statement system will look for closiest return point (return 1 - means everything okay , your code was executed | return 0 - means something is wrong your code cannot be executed)
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: 3 Guest(s)