31.03.2017, 16:30
he so I want to make a cookie system and I made it but I want the players to redeem their cookies buy money so iv made this:
the problem is that I want it like if he redeem 1 cookie it give him 10k if 2 cookies 20k but if ill work like that it will take ages and I don't need to set maximum amount of cookies to redeem so any suggestions?
PHP код:
CMD:redeem(playerid,params[])
{
if(adlvl(playerid)<3) return 0;
static amount, name[MAX_PLAYERS], string8[200];
if (sscanf(params, "i",amount)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /redeem [amount] (to redeem Cookies with Cash)");
if(Cookies[playerid]<amount)return SendClientMessage(playerid, COLOR_RED, "You Dont Have Enough Cookies.");
GetPlayerName(playerid, name, sizeof(name));
format(string8,sizeof(string8),"{FFFF00}|- You have Redeem %i Cookie(s) For $%i -|",amount);
SendClientMessage(playerid, COLOR_RED,string8);
Cookies[playerid]-=amount;
printf("%s(Id%d) has redeemed %i Cookie(s)", name,playerid, amount);
return 1;
}