19.07.2017, 11:01
Hello, here I want help with /asay color. I want different colors for different admin level /asay's . There are 6 admin levels in my script, I want their /asay to be changed according to the colors I put.
My /asay command :
My /asay command :
PHP код:
CMD:asay(playerid, params[])
{
new tmp[256], playername[25], string[256], string2[256], moneys=0, moneys1=0;
if (adlvl[playerid] < 1) return 0;
if (sscanf(params, "s[128]", tmp)) return SendClientMessage2(playerid, COLOR_WHITE, "Usage: /asay [message]");
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "* Admin: %s (%s)", tmp, playername);
format(string2, sizeof(string2), "* Admin: %s", tmp);
for(new i=0; i < PLAYERS; i++)
{
if(i == playerid)
{
if(adlvl[i] >= 1 && adminuc[i] == 0)
{
moneys++;
}
if(adlvl[i] >= 1 && adminuc[i] != 0)
{
moneys1++;
}
}
}
if(moneys != 0)
{
if(adlvl[playerid] ==1 || adlvl[playerid]==2)
{
SendMessageToAdmins(COLOR_ADMIN_1, string);
SendMessageToNormal(COLOR_ADMIN_1, string2);
}
if(adlvl[playerid] ==3)
{
SendMessageToAdmins(COLOR_ADMIN_2, string);
SendMessageToNormal(COLOR_ADMIN_2, string2);
}
if(adlvl[playerid] >=4)
{
SendMessageToAdmins(COLOR_ADMIN_3, string);
SendMessageToNormal(COLOR_ADMIN_3, string2);
}
}
if(moneys1 != 0)
{
if(adlvl[playerid] ==1 || adlvl[playerid]==2)
{
SendMessageToAdmins(COLOR_ADMIN_1, string2);
SendMessageToNormal(COLOR_ADMIN_1, string2);
}
if(adlvl[playerid] ==3)
{
SendMessageToAdmins(COLOR_ADMIN_2, string2);
SendMessageToNormal(COLOR_ADMIN_2, string2);
}
if(adlvl[playerid] >=4)
{
SendMessageToAdmins(COLOR_ADMIN_3, string2);
SendMessageToNormal(COLOR_ADMIN_3, string2);
}
}
return 1;
}