Give Cookie script help
#5

Add this near your stocks:
PHP код:
forward GiveAllCookies(playeridamount);
public 
GiveAllCookies(playeridamount)
{
    for(new 
i=0MAX_PLAYERSi++)
    {
         if(
IsPlayerConnected(i))
        {
            
PlayerInfo[i][Cookies] += amount;
        }
    }
      return 
1;

Then add this:
PHP код:
CMD:giveallcookie(playeridparams[]) // CMD for giving somebody a cookie
{
        new 
str[250], amount;
        if(
PlayerInfo[playerid][Level] >= 3)
        {
             if(
sscanf(params"i",amount)) return SendClientMessage(playeridCOLOR_YELLOW"USAGE: /giveallcookie [Amount]");;
             
format(strsizeof(str), "**Admin %s (ID:%d) has given %d cookie(s) to everyone!",PlayerName2(playerid), playeridamount);
             
SendClientMessageToAll(COLOR_ORANGEstr);;
             
format(strsizeof(str), "**You just gave %d cookie(s) to everyone."amount);
             
SendClientMessage(playeridCOLOR_GREENstr);
             
GiveAllCookies(playeridamount);
        }
        else 
SendClientMessage(playeridCOLOR_YELLOW"**You're not authorized to use this command.");
        return 
1;

Written from here, so I'm unsure of the errors. Just reply if there are any.
Reply


Messages In This Thread
Give Cookie script help - by KyNe - 20.12.2017, 15:50
Re: Give Cookie script help - by aoky - 20.12.2017, 15:54
Re: Give Cookie script help - by DelK - 20.12.2017, 15:59
Re: Give Cookie script help - by KyNe - 20.12.2017, 16:17
Re: Give Cookie script help - by aoky - 20.12.2017, 16:26
Re: Give Cookie script help - by KyNe - 20.12.2017, 16:35
Re: Give Cookie script help - by Kaperstone - 20.12.2017, 16:37
Re: Give Cookie script help - by KyNe - 20.12.2017, 16:39
Re: Give Cookie script help - by aoky - 20.12.2017, 16:40
Re: Give Cookie script help - by KyNe - 20.12.2017, 16:42

Forum Jump:


Users browsing this thread: 1 Guest(s)