14.05.2015, 00:13
i have a problem , i tryed to fix it, not fixed
this bug is player can get 999999kk$ , ex: i he did /getdrugs 999999999 or 100000000 .. he will get money , and sometimes he get -999999$$
this bug is player can get 999999kk$ , ex: i he did /getdrugs 999999999 or 100000000 .. he will get money , and sometimes he get -999999$$
pawn Код:
CMD:getdrugs(playerid,params[])
{
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_WHITE, "You need to login first.");
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pJob] != 4) return SCM(playerid,COLOR_WHITE,"{FFF8C6}You are not a Drugs Dealer.");
if(!IsPlayerInRangeOfPoint(playerid, 5.0, 322.9745,1119.4409,1083.8828)) return SCM(playerid,COLOR_WHITE,"{FFF8C6}You are not the place where you can get drugs.");
new points;
new dpoints = PlayerInfo[playerid][pDrugs];
if(sscanf(params, "i", points)) return SCM(playerid, COLOR_WHITE, "Usage: /getdrugs [amount]");
new totaldrugs = dpoints + points;
if(totaldrugs > 99) return SCM(playerid, COLOR_WHITE, "You can not hold so many drugs to you.");
new money = points * 1000;
if(GetPlayerCash(playerid) < money) return SCM(playerid,COLOR_WHITE,"You do not have enough money.");
PlayerInfo[playerid][pDrugs] += points;
GivePlayerCash(playerid,-money);
new string[64];
format(string,sizeof(string),"You bought %d grams of drugs $%s",points,FormatNumber(money));
SCM(playerid,COLOR_WHITE,string);
new str2[128];
format(str2,sizeof(str2),"UPDATE users SET `Money`='%d',`Drugs`='%d' WHERE `name`='%s'",GetPlayerCash(playerid),PlayerInfo[playerid][pDrugs],PlayerInfo[playerid][pNormalName]);
mysql_query(SQL,str2);
return 1;
}
return 1;
}