Whats wrong with this code?
#1

pawn Код:
else if(strcmp(x_job,"repair",true) == 0)
            {
                if(RepairOffer[playerid] < 999)
                {
                    if(GetPlayerMoney(playerid) > RepairPrice[playerid])
                    {
                        if(IsPlayerInAnyVehicle(playerid))
                        {
                            if(IsPlayerConnected(RepairOffer[playerid]))
                            {
                                GetPlayerName(RepairOffer[playerid], giveplayer, sizeof(giveplayer));

                                RepairCar[playerid] = GetPlayerVehicleID(playerid);
                                SetVehicleHealth(RepairCar[playerid], 1000.0);
                                format(string, sizeof(string), "* You repaired your car for $%d by Car Mechanic %s.",RepairPrice[playerid],giveplayer);
                                SendClientMessage(playerid, COLOR_WHITE, string);
                                format(string, sizeof(string), "* You fixed %s's car, the $%d has been added to your PayCheck.",sendername,RepairPrice[playerid]);
                                SendClientMessage(RepairOffer[playerid], COLOR_WHITE, string);
                                SafeGivePlayerMoney(playerid, -RepairPrice[playerid]);
                                RepairOffer[playerid] = 999;
                                RepairPrice[playerid] = 0;
                                return 1;
                            }
                            return 1;
                        }
                        return 1;
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GREY, "   You can't afford the Repair !");
                        return 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "   No-one offerd you to Repair your Car !");
                    return 1;
                }
            }
            else { return 1; }
        }//not connected
        return 1;
    }
It will crash the pawno.
Reply
#2

nvm, it had a missing bracket.
Reply
#3

It's using "strcmp" thats the biggest issue ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)