YCMD:kupizlato(playerid, params[], help)
{
#pragma unused help
if(IsPlayerInRangeOfPoint(playerid, 1.0, 1696.5371,-1183.6985,23.8899))
{
new string[128], ammount, cash = ammount * 300;
if(GetPlayerMoney(playerid) < cash)
{
SCM(playerid, -1, "[ES:RPG] "CRVENA"Nemate dovoljno novca!");
return 1;
}
else
{
if(sscanf(params, "u", ammount))
{
SCM(playerid,-1,"ES:RPG Pomoc | "SPLAVA"/kupizlato [Kolicina]");
SCM(playerid,-1,"ES:RPG Pomoc | "SPLAVA"Cijena grama je 300");
return 1;
}
else
{
PlayerInfo[playerid][pZlato] += ammount;
GivePlayerMoney(playerid, - cash);
format(string, sizeof(string), ""SPLAVA"Kupili ste "ZUTA"%d g zlata za "ZELENA"%d$", ammount, cash);
SCM(playerid, -1, string);
return 1;
}
}
}
else
{
SCM(playerid, -1, "[ES:RPG] "CRVENA"Niste na mjestu kupovine zlata!");
return 1;
}
}
new string[128], ammount, cash = ammount * 300; if(GetPlayerMoney(playerid) < cash)
Код:
new string[128], ammount, cash = ammount * 300; if(GetPlayerMoney(playerid) < cash) 'cash' will always be 0 because 'ammount' is 0, 0 * 300 = 0.. |