Problem /repair command
#1

Mechanics can repair themself , how can i fix this ?
Code:
pawn Код:
CMD:repair(playerid,params[])
{
        new userID;
        new giveplayer[MAX_PLAYER_NAME];
        new sendername[MAX_PLAYER_NAME];
        new moneys, string[256];
        if(IsPlayerConnected(playerid))
        {
            if(playerVariables[playerid][pJob] != 3)
            {
                SendClientMessage(playerid, COLOR_GREY, "You are not a mechanic.");
                return 1;
            }
            if(sscanf(params, "ui", userID, moneys))
            {
                return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/repair [playerid] [money]");
            }
            if(moneys < 1 || moneys > 15000) { SendClientMessage(playerid, COLOR_GREY, "The money must be until 15000$."); return 1; }
            if(IsPlayerConnected(userID))
            {
                if(userID != INVALID_PLAYER_ID)
                {
                    if(IsPlayerInAnyVehicle(userID))
                    {
                        GetPlayerName(userID, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "You offerd %s to fix his car for $%d.",giveplayer,moneys);
                        SendClientMessage(playerid, COLOR_WHITE, string);
                        format(string, sizeof(string), " Car Mechanic %s wants to repair your car for $%d,(type /accept repair to accept).",sendername,moneys);
                        SendClientMessage(userID, COLOR_WHITE, string);
                        RepairOffer[userID] = playerid;
                        RepairPrice[userID] = moneys;
                    }
                }
            }
        }
        return 1;
}
Reply


Messages In This Thread
Problem /repair command - by buburuzu19 - 09.09.2014, 06:39
Re: Problem /repair command - by Threshold - 09.09.2014, 07:21

Forum Jump:


Users browsing this thread: 1 Guest(s)