12.08.2016, 15:15
Yes change the old SendAdminMessage to this
Just add the new params to everywhere you used it
Well, you code becames
Quote:
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) |
Well, you code becames
PHP код:
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;
}