20.12.2013, 18:28
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:
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;
}