Admin Command: Give Money To All Players
#1

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

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;
}
Reply
#3

Yeah i use ZCMD and thanks for the fast response
Reply
#4

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
Reply
#5

Thats fine, ill test it tomorrow.
Reply
#6

nice.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)