SA-MP Forums Archive
help with /giveallscore and /giveallmoney - 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 with /giveallscore and /giveallmoney (/showthread.php?tid=293136)



[SOLVED] help with /giveallscore - jejemonerz123 - 27.10.2011

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");
}



Re: help with /giveallscore and /giveallmoney - =WoR=Varth - 27.10.2011

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;
}



Re: help with /giveallscore and /giveallmoney - jejemonerz123 - 27.10.2011

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