18.05.2017, 10:48
This is a car parts order. And the number to break. For example, I put the number 99999999 into my input box, and I received a great deal of money instead of a deduction in the character. I do not know how to solve the problem.
PHP код:
CMD:buycomp(playerid, params[])
{
new amount;
if (PlayerData[playerid][pJob] != JOB_MECHANIC)
return ErrorMsg(playerid, "§Т№ўН§¤ШідБидґйгЄй¤УКС觹Хй");
if(!IsPlayerInRangeOfPoint(playerid, 5.0, 2424.9688,-2459.3313,13.6250))
{
Waypoint_Set(playerid, "Solarin Industries", 2424.9688,-2459.3313,13.6250);
ErrorMsg(playerid, "¤ШідБидґйНВЩи·ХиГйТ№ўТВЄФй№КиЗ№ аГТгЛйа¤ГЧиН§ЛБТВдЗйг№бј№·ХибЕйЗ");
return 1;
}
else
{
new vehicleid = GetPlayerVehicleID(playerid);
if (GetVehicleModel(vehicleid) != 525)
return ErrorMsg(playerid, "¤ШідБидґйНВЩиє№ Towtruck");
if (sscanf(params, "d", amount))
return SyntaxMsg(playerid, "/buycomp [amount]");
if(PlayerData[playerid][pMoney] < amount*250)
return ErrorMsg(playerid, "¤ШіБХа§Ф№дБиѕН·ХиЁР«ЧйН");
new extrapay = 0, price = 250;
if(PlayerData[playerid][pJobEmployed] > 0) { extrapay = PlayerData[playerid][pJobEmployed] < 10 ? (5 * PlayerData[playerid][pJobEmployed]) : 50; }
price -= extrapay;
GiveMoney(playerid, -amount*price, "buy comp");
CoreVehicles[vehicleid][vehComponent] += amount*25;
ServerMsg(playerid, "¤Ші«ЧйНЄФй№КиЗ№ %d ЄФй№г№ГТ¤Т %s", amount, FormatNumber(amount*price));
}
return 1;
}