help with /giveallscore and /giveallmoney
#1

SOLVED

pawn Код:
dcmd_giveallscore(playerid,params[]) {
    if(PlayerInfo[playerid][Level] >= 3) {
        if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /giveallscore [score]");
        new var = strval(params), string[128];
        CMDMessageToAdmins(playerid,"GIVEALLSCORE");
        for(new i = 0; i < MAX_PLAYERS; i++) {
            if(IsPlayerConnected(i)) {
                PlayerPlaySound(i,1057,0.0,0.0,0.0);
                SetPlayerScore(playerid, GetPlayerScore(playerid)+var);
            }
        }
        format(string,sizeof(string),"Administrator \"%s\" has given all players '%d' score/s", pName(playerid), var );
        return SendClientMessageToAll(blue, string);
    } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}
Reply
#2

Example /givaallmoney:
pawn Код:
CMD:giveallmoney(playerid,params[])
{
     new money;
     if(sscanf(params,"d",money)) return SendClientMessage(playerid,-1,"/giveallmoney <amount>");
     foreach(Player,i)//Using foreach
     {
         GivePlayerMoney(i,money);
     }
     return 1;
}
Reply
#3

Quote:
Originally Posted by =WoR=Varth
Посмотреть сообщение
Example /givaallmoney:
pawn Код:
CMD:giveallmoney(playerid,params[])
{
     new money;
     if(sscanf(params,"d",money)) return SendClientMessage(playerid,-1,"/giveallmoney <amount>");
     foreach(Player,i)//Using foreach
     {
         GivePlayerMoney(i,money);
     }
     return 1;
}
i already solved that Omg BTW thanks for the effort i just need the giveall score :O
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)