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 Code:
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;
}