/givescoreall and /givemoneyall
#1

Basically, when i (Or any other admin) type /givescoreall [Score-Amount], the message sends twice.
For an example - If there are 2 admins online, the message will be sent 2 times, but If I'm the only admin online, it will be sent only once.
The same happens with /givemoneyall
Here's an picture.

http://i.imgur.com/DA7dLN3.jpg?1

Codes:

pawn Код:
CMD:givescoreall(playerid, params[]) {
    new score;
    if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_RED, "[ADMIN] - You're not a high enough level to use this command!");
    if(sscanf(params, "d", score)) return SendClientMessage(playerid, COLOR_RED, "[USAGE] - /givescoreall [AMMOUNT]");
    if( score < 1 ) return SendClientMessage(playerid, COLOR_RED, "[ERROR] - You need to give more than 0 score.");
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerConnected(i))
        {
            new string[74];
            new name[MAX_PLAYER_NAME];
            GetPlayerName(i, name, sizeof(name));
            SetPlayerScore(playerid,GetPlayerScore(playerid)+score);
            format(string, sizeof(string), "[ADMIN] - %s[%d] has used GIVESCOREALL - %d -", name, i, score);
            SendMessageToAdmins(string);
            format(string, sizeof(string), "* Admin %s[%d] has given %d score to everyone!", name, i, score);
            SendClientMessageToAll(COLOR_YELLOW, string);
        }
    }
    return 1;
}
CMD:givemoneyall(playerid, params[]) {
    new money;
    if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_RED, "[ADMIN] - You're not a high enough level to use this command!");
    if(sscanf(params, "d", money)) return SendClientMessage(playerid, COLOR_RED, "[USAGE] - /givemoneyall [AMMOUNT]");
    if( money < 1 ) return SendClientMessage(playerid, COLOR_RED, "[ERROR] - You need to give more than 0$");
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerConnected(i))
        {
            new string[74];
            new name[MAX_PLAYER_NAME];
            GetPlayerName(i, name, sizeof(name));
            GivePlayerMoney(i, money);
            format(string, sizeof(string), "[ADMIN] - %s[%d] has used GIVEMONEYALL - %d -", name, i, money);
            SendMessageToAdmins(string);
            format(string, sizeof(string), "* Admin %s[%d] has given %d$ to everyone!", name, i, money);
            SendClientMessageToAll(COLOR_YELLOW, string);
        }
    }
    return 1;
}
Reply


Messages In This Thread
/givescoreall and /givemoneyall - by Kyance - 20.12.2013, 18:28
Re: /givescoreall and /givemoneyall - by Konstantinos - 20.12.2013, 18:47
Re: /givescoreall and /givemoneyall - by CutX - 20.12.2013, 18:50
Re: /givescoreall and /givemoneyall - by Zamora - 20.12.2013, 18:53
Re: /givescoreall and /givemoneyall - by Kyance - 20.12.2013, 19:20

Forum Jump:


Users browsing this thread: 2 Guest(s)