14.10.2013, 17:49
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
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]++;
}
}