05.04.2014, 11:55
Код:
CMD:buycomponent(playerid, params[])
{
if(!IsAtComponent(playerid))
{// Component
SendClientMessageEx(playerid, COLOR_GREY, "Kamu tidak sedang ada di toko komponen (Ocean Docks).");
return 1;
}
if(PlayerInfo[playerid][pJob] != 7 && PlayerInfo[playerid][pJob2] != 7)
{
SendClientMessageEx(playerid, COLOR_GREY, "Kamu bukan mechanic.");
return 1;
}
new component, string[128];
if(sscanf(params, "d", component))
return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /buycomponent [jumlah]");
if(component < 1)
return SendClientMessageEx(playerid, COLOR_WHITE, "Error: Invalid amount of component!");
if (GetPlayerCash(playerid) >= component*10)
{
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pComponent] += component;
GivePlayerCash(playerid, -(component*10));
SaveAccountsUpdate();
format(string, sizeof(string), "Kamu telah membeli %d component seharga $%d", component, component*10);
SendClientMessageEx(playerid, COLOR_GREEN, string);
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD4, "You don't have the cash for this item!");
}
return 1;
}
i use /buycomponent -250000000 and -2500000000 , directly get the money 99999999
how to fix that /buycomponent -250000000 and -2500000000 no more bugs?
#sorry for bad my english


