Why does it send the same thing for 3 times?
#1

pawn Code:
CMD:takejob(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        if(PlayerInfo[playerid][pJob] == 0)
        {
            if (IsPlayerInRangeOfPoint(playerid, 4, -323.0505,2675.5161,63.6797)) //Mechanic
            {
                PlayerInfo[playerid][pJob] = 1;
                SendClientMessage(playerid, COLOR_WHITE,"You are mechanic now.");
                SendClientMessage(playerid, COLOR_WHITE,"You should check /help for new commands.");
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY,"You are not in the right place.");
            }

            if (IsPlayerInRangeOfPoint(playerid, 4, -245.1974,2724.2322,62.6875)) //Streetsweeper
            {
                PlayerInfo[playerid][pJob] = 2;
                SendClientMessage(playerid, COLOR_WHITE,"You are streetsweeper now.");
                SendClientMessage(playerid, COLOR_WHITE,"You should check /help for new commands.");
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY,"You are not in the right place.");
            }

            if (IsPlayerInRangeOfPoint(playerid,4, -227.7350,2721.9934,62.6875)) //Postman
            {
                PlayerInfo[playerid][pJob] = 3;
                SendClientMessage(playerid, COLOR_WHITE,"You are postman now.");
                SendClientMessage(playerid, COLOR_WHITE,"You should check /help for new commands.");
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY,"You are not in the right place.");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You already have an job. Write /quitjob to quit job.");
        }
    }
    return 1;
}
Here is the command. The problem is it sends "You are not in the right place" three times.
Reply


Messages In This Thread
Why does it send the same thing for 3 times? - by vent - 17.12.2011, 16:41
Respuesta: Why does it send the same thing for 3 times? - by [DOG]irinel1996 - 17.12.2011, 16:45
Re: Why does it send the same thing for 3 times? - by Neo Karls - 17.12.2011, 16:46
Re: Why does it send the same thing for 3 times? - by vent - 17.12.2011, 16:46
Respuesta: Why does it send the same thing for 3 times? - by [DOG]irinel1996 - 17.12.2011, 16:52

Forum Jump:


Users browsing this thread: 1 Guest(s)