CMD:admin(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 1) { new msg[128]; new logstring[128]; new year, month, day, hour, minute, second; getdate(year, month, day); gettime(hour, minute, second); if(!sscanf(params, "s[128]", msg)) { strmid(sendername, PlayerRPName(playerid), 0, MAX_PLAYER_NAME); new alevel[25]; if(PlayerInfo[playerid][pAdmin] == 1) { alevel = "Moderator"; } if(PlayerInfo[playerid][pAdmin] == 2) { alevel = "Junior Admin"; } format(string, sizeof(string), "* [MOD CHAT] %s %s: %s", alevel, sendername, msg); format(logstring, sizeof(logstring), "[%d/%d/%d - %d:%d:%d] * %s %s", day, month, year, hour, minute, second, alevel, sendername, msg); SendAdminMessage(COLOR_PINK, string); AchatLog(logstring); } else { SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/mc)chat [MOD chat]"); } } else { SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command !"); } return 1; } CMD:admin2(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 3) { new msg[128]; new logstring[128]; new year, month, day, hour, minute, second; getdate(year, month, day); gettime(hour, minute, second); if(!sscanf(params, "s[128]", msg)) { strmid(sendername, PlayerRPName(playerid), 0, MAX_PLAYER_NAME); new alevel[25]; if(PlayerInfo[playerid][pAdmin] == 3) { alevel = "Senior Admin"; } if(PlayerInfo[playerid][pAdmin] == 4) { alevel = "Head Admin"; } if(PlayerInfo[playerid][pAdmin] == 1337) { alevel = "Lead Head Admin"; } format(string, sizeof(string), "*[ADM CHAT] %s %s: %s", alevel, sendername, msg); format(logstring, sizeof(logstring), "[%d/%d/%d - %d:%d:%d] * %s %s", day, month, year, hour, minute, second, alevel, sendername, msg); SendAdminMessage(COLOR_GREEN, string); AchatLog(logstring); } else { SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/adm)in [admin chat]"); } } else { SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command !"); } return 1; } CMD:admin3(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 1338) { new msg[128]; new logstring[128]; new year, month, day, hour, minute, second; getdate(year, month, day); gettime(hour, minute, second); if(!sscanf(params, "s[128]", msg)) { strmid(sendername, PlayerRPName(playerid), 0, MAX_PLAYER_NAME); new alevel[25]; if(PlayerInfo[playerid][pAdmin] == 1338) { alevel = "Community Manager"; } if(PlayerInfo[playerid][pAdmin] == 99999) { alevel = "Community Developer"; } if(PlayerInfo[playerid][pAdmin] == 100000) { alevel = "Community Owner"; } format(string, sizeof(string), "*[COM. ADM'S CHAT] %s %s: %s", alevel, sendername, msg); format(logstring, sizeof(logstring), "[%d/%d/%d - %d:%d:%d] * %s %s", day, month, year, hour, minute, second, alevel, sendername, msg); SendAdminMessage(COLOR_BLUE, string); AchatLog(logstring); } else { SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/ca)dmin [COM. admin chat]"); } } else { SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command !"); } return 1; }
CMD:ma(playerid,params[]) { return cmd_admin(playerid, params); } CMD:ca(playerid, params[]) { return cmd_admin3(playerid, params); } CMD:adm(playerid, params[]) { return cmd_admin2(playerid, params); }
CMD:ma(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 1) { new msg[128]; new logstring[128]; new year, month, day, hour, minute, second; getdate(year, month, day); gettime(hour, minute, second); if(!sscanf(params, "s[128]", msg)) { strmid(sendername, PlayerRPName(playerid), 0, MAX_PLAYER_NAME); new alevel[25]; if(PlayerInfo[playerid][pAdmin] == 1) { alevel = "Moderator"; } if(PlayerInfo[playerid][pAdmin] == 2) { alevel = "Junior Admin"; } format(string, sizeof(string), "* [MOD CHAT] %s %s: %s", alevel, sendername, msg); format(logstring, sizeof(logstring), "[%d/%d/%d - %d:%d:%d] * %s %s", day, month, year, hour, minute, second, alevel, sendername, msg); SendAdminMessage(COLOR_PINK, string); AchatLog(logstring); } else { SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/mc)chat [MOD chat]"); } } else { SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command !"); } return 1; } CMD:adm(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 3) { new msg[128]; new logstring[128]; new year, month, day, hour, minute, second; getdate(year, month, day); gettime(hour, minute, second); if(!sscanf(params, "s[128]", msg)) { strmid(sendername, PlayerRPName(playerid), 0, MAX_PLAYER_NAME); new alevel[25]; if(PlayerInfo[playerid][pAdmin] == 3) { alevel = "Senior Admin"; } if(PlayerInfo[playerid][pAdmin] == 4) { alevel = "Head Admin"; } if(PlayerInfo[playerid][pAdmin] == 1337) { alevel = "Lead Head Admin"; } format(string, sizeof(string), "*[ADM CHAT] %s %s: %s", alevel, sendername, msg); format(logstring, sizeof(logstring), "[%d/%d/%d - %d:%d:%d] * %s %s", day, month, year, hour, minute, second, alevel, sendername, msg); SendAdminMessage(COLOR_GREEN, string); AchatLog(logstring); } else { SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/adm)in [admin chat]"); } } else { SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command !"); } return 1; } CMD:ca(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 1338) { new msg[128]; new logstring[128]; new year, month, day, hour, minute, second; getdate(year, month, day); gettime(hour, minute, second); if(!sscanf(params, "s[128]", msg)) { strmid(sendername, PlayerRPName(playerid), 0, MAX_PLAYER_NAME); new alevel[25]; if(PlayerInfo[playerid][pAdmin] == 1338) { alevel = "Community Manager"; } if(PlayerInfo[playerid][pAdmin] == 99999) { alevel = "Community Developer"; } if(PlayerInfo[playerid][pAdmin] == 100000) { alevel = "Community Owner"; } format(string, sizeof(string), "*[COM. ADM'S CHAT] %s %s: %s", alevel, sendername, msg); format(logstring, sizeof(logstring), "[%d/%d/%d - %d:%d:%d] * %s %s", day, month, year, hour, minute, second, alevel, sendername, msg); SendAdminMessage(COLOR_BLUE, string); AchatLog(logstring); } else { SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/ca)dmin [COM. admin chat]"); } } else { SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command !"); } return 1; }
SendAdminMessage(color, string2[]) { // for(new i = 0; i < MAX_PLAYERS; i++) foreach (Player, i) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pAdmin] >= 1) { SendClientMessage(i, color, string2); } } } return 1; }
SendAdminMessage(color, string2[], level) {
foreach (Player, i) { if(IsPlayerConnected(i) && PlayerInfo[i][pAdmin] >= level) SendClientMessage(i, color, string2); }
return 1;
}
Usage: Example if you want to send to +1 admins(all admins) use SendAdminMessage(color, msg, 1)
if you want to send to +3 admins(don't send to 1 and 2) use SendAdminMessage(color, msg, 3) |
CMD:ma(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
new msg[128];
new logstring[128];
new year, month, day, hour, minute, second;
getdate(year, month, day);
gettime(hour, minute, second);
if(!sscanf(params, "s[128]", msg))
{
strmid(sendername, PlayerRPName(playerid), 0, MAX_PLAYER_NAME);
new alevel[25];
if(PlayerInfo[playerid][pAdmin] == 1) { alevel = "Moderator"; }
if(PlayerInfo[playerid][pAdmin] == 2) { alevel = "Junior Admin"; }
format(string, sizeof(string), "* [MOD CHAT] %s %s: %s", alevel, sendername, msg);
format(logstring, sizeof(logstring), "[%d/%d/%d - %d:%d:%d] * %s %s", day, month, year, hour, minute, second, alevel, sendername, msg);
SendAdminMessage(COLOR_PINK, string, 1);//HERE
AchatLog(logstring);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/mc)chat [MOD chat]");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command !");
}
return 1;
}
CMD:adm(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
new msg[128];
new logstring[128];
new year, month, day, hour, minute, second;
getdate(year, month, day);
gettime(hour, minute, second);
if(!sscanf(params, "s[128]", msg))
{
strmid(sendername, PlayerRPName(playerid), 0, MAX_PLAYER_NAME);
new alevel[25];
if(PlayerInfo[playerid][pAdmin] == 3) { alevel = "Senior Admin"; }
if(PlayerInfo[playerid][pAdmin] == 4) { alevel = "Head Admin"; }
if(PlayerInfo[playerid][pAdmin] == 1337) { alevel = "Lead Head Admin"; }
format(string, sizeof(string), "*[ADM CHAT] %s %s: %s", alevel, sendername, msg);
format(logstring, sizeof(logstring), "[%d/%d/%d - %d:%d:%d] * %s %s", day, month, year, hour, minute, second, alevel, sendername, msg);
SendAdminMessage(COLOR_GREEN, string, 3);//HERE
AchatLog(logstring);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/adm)in [admin chat]");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command !");
}
return 1;
}
CMD:ca(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1338)
{
new msg[128];
new logstring[128];
new year, month, day, hour, minute, second;
getdate(year, month, day);
gettime(hour, minute, second);
if(!sscanf(params, "s[128]", msg))
{
strmid(sendername, PlayerRPName(playerid), 0, MAX_PLAYER_NAME);
new alevel[25];
if(PlayerInfo[playerid][pAdmin] == 1338) { alevel = "Community Manager"; }
if(PlayerInfo[playerid][pAdmin] == 99999) { alevel = "Community Developer"; }
if(PlayerInfo[playerid][pAdmin] == 100000) { alevel = "Community Owner"; }
format(string, sizeof(string), "*[COM. ADM'S CHAT] %s %s: %s", alevel, sendername, msg);
format(logstring, sizeof(logstring), "[%d/%d/%d - %d:%d:%d] * %s %s", day, month, year, hour, minute, second, alevel, sendername, msg);
SendAdminMessage(COLOR_BLUE, string,1338);//HERE
AchatLog(logstring);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/ca)dmin [COM. admin chat]");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command !");
}
return 1;
}
E:\****\gamemodes\****.pwn(27190) : error 029: invalid expression, assumed zero E:\****\gamemodes\****.pwn(27190) : warning 215: expression has no effect E:\****\gamemodes\****.pwn(27190) : warning 215: expression has no effect E:\****\gamemodes\****.pwn(27190) : error 001: expected token: ";", but found ")" E:\****\gamemodes\****.pwn(27190) : error 029: invalid expression, assumed zero E:\****\gamemodes\****.pwn(27190) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
format(string, sizeof(string), "Whisper to %s(ID: %d): %s", PlayerRPName(giveplayerid), giveplayerid, (result)); SendClientMessage(playerid, COLOR_YELLOW, string); if(PlayerInfo[playerid][pAdmin] == 0 && GetDistanceBetweenPlayers(playerid,giveplayerid) <= 6) { format(string, sizeof(string), "%s(ID: %d) whispers: %s", PlayerRPName(playerid), playerid, (result)); SendClientMessage(giveplayerid, COLOR_YELLOW, string); if(AwaitingHelp[giveplayerid] == 1 && PlayerInfo[playerid][pAdmin] >= 1) { format(string2, sizeof(string2), "{FF0000}AdmWarning{FFFFFF}: %s %s has answered %s (ID: %d):", alevel, PlayerRPName(playerid),PlayerRPName(giveplayerid) ,giveplayerid); SendAdminMessage(0xFFFFFFAA, string2, 1); format(string2, sizeof(string2), "ANSWER: %s", (result)); SendAdminMessage(0xFF6347AA,, string2, 1); //27190 } AwaitingHelp[giveplayerid] = 0; return 1; }