SA-MP Forums Archive
[Help]Givemoneyall and levelup commands in zcmd - 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: [Help]Givemoneyall and levelup commands in zcmd (/showthread.php?tid=469774)



[Help]Givemoneyall and levelup commands in zcmd - mikjo - 14.10.2013

Hey everyone i need help for making command in zcmd for giving all players money, and giving level up to all players. my varibale for Level is pLevel is someone want to help to make this 2 commands


Re: [Help]Givemoneyall and levelup commands in zcmd - EiresJason - 14.10.2013

You can add in your own requirements to use the commands.

pawn Код:
CMD:giveallmoney(playerid,params[])
{
        if(PlayerInfo[playerid][pAdmin] <= 2) return  SendClientMessage(playerid,-1,"ERROR: You are not allowed to use that command!"); //only level 3+ admins can use the command, for example.
    new cash;
    if(sscanf(params,"i",cash)) return SendClientMessage(playerid,-1,"USAGE: /giveallmoney [amount]");
    for(new i=0; i< MAX_PLAYERS; i++)
    {
        GivePlayerMoney(i,cash);   
    }
    //not sure if you have the foreach inc so I'll just use a for loop.
}

CMD:levelupall(playerid,params[])
{
        if(PlayerInfo[playerid][pAdmin] <= 2) return  SendClientMessage(playerid,-1,"ERROR: You are not allowed to use that command!"); //only level 3+ admins can use the command, for example.
    for(new i=0; i< MAX_PLAYERS; i++)
    {
        PlayerInfo[i][pLevel]++;
    }
}