SA-MP Forums Archive
Admin Command: Give Money To All Players - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Admin Command: Give Money To All Players (/showthread.php?tid=303514)



Admin Command: Give Money To All Players - stuoyto - 13.12.2011

Hello,
For my roleplay server i am the head admin and every so often i would like to give all of the players that are online acertain amount of money. Im looking for an admin command that works along the lines of;

/giveall [amount]

If somebody could please help me with this i would appreciate it.


Stuoyto


Re: Admin Command: Give Money To All Players - Rob_Maate - 13.12.2011

I'll assume your using zcmd and sscanf

pawn Code:
CMD:giveall(playerid, params[])
{
    new value;
    if(!IsPlayerAdmin(playerid)) return 1;
    if(sscanf(params, "d", value) != 0) SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /giveall [Amount]"); return 1;
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            GivePlayerMoney(i, value);
        }
    }
    return 1;
}



Re: Admin Command: Give Money To All Players - stuoyto - 13.12.2011

Yeah i use ZCMD and thanks for the fast response


Re: Admin Command: Give Money To All Players - Rob_Maate - 13.12.2011

No dramas mate, this community is a good balance of give/take.
I started out asking questions, now that they have been answered I can share them with others

Yo I didn't test that, so you'll need to


Re: Admin Command: Give Money To All Players - stuoyto - 13.12.2011

Thats fine, ill test it tomorrow.


Re: Admin Command: Give Money To All Players - oLfacTiv - 02.03.2013

nice.