Cookie Help
#1

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:
PHP код:
CMD:redeem(playerid,params[])
{
    if(
adlvl(playerid)<3) return 0;
    static 
amountname[MAX_PLAYERS], string8[200];
    if (
sscanf(params"i",amount)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /redeem [amount] (to redeem Cookies with Cash)");
    if(
Cookies[playerid]<amount)return SendClientMessage(playeridCOLOR_RED"You Dont Have Enough Cookies.");
     
GetPlayerName(playeridnamesizeof(name));
    
format(string8,sizeof(string8),"{FFFF00}|- You have Redeem %i Cookie(s) For $%i -|",amount);
    
SendClientMessage(playeridCOLOR_RED,string8);
    
Cookies[playerid]-=amount;
    
printf("%s(Id%d) has redeemed %i Cookie(s)"name,playeridamount);
    return 
1;

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?
Reply
#2

PHP код:
GivePlayerMoney(playeridcookies 10000); //The number of cookies will get multiplied by 10000 i.e 3 cookies, 30000. And that cash will be given to player 
Is that what you want?
Reply
#3

YESS!!!! thank u
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)