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;
}
new A_CHAT_COLORS[60] = { //6 SLOTS IN ARRAY - 10 CHAR EACH FOR HEX CODE (6*10=60arraySize) "{FFFFFF}", //LEVEL 1 "{FFFFFF}", //LEVEL 2 "{FFFFFF}", //LEVEL 3 "{FFFFFF}", //LEVEL 4 "{FFFFFF}", //LEVEL 5 "{FFFFFF}" //LEVEL 6 }; CMD:asay( playerid, params[]) { new grabbedMessage[128], //Message obtained through chatbox adminMessage[256], //Message used to pass to admins normalMessage[256], //Message used to pass to normal players playerName[MAX_PLAYER_NAME] //Holds player name string ; if ( adlvl[playerid] < 1 ) //Checks administration level return SendClientMessage( playerid, -1, "You do not have permission to use this call." ); //If player is not an admin, returns this message if ( sscanf( params, "s[128]", grabbedMessage ) ) //Makes sure you filled out all parameters return SendClientMessage( playerid, -1, "Usage: /asay [message]" ); //Returns this usage format( adminMessage, sizeof( adminMessage ), "* Admin: %s (%s)", grabbedMessage, GetPlayerName( playerid, playerName, MAX_PLAYER_NAME ) ); //Formats adminMessage with player name format( normalMessage, sizeof( normalMessage ), "* Admin: %s", grabbedMessage ); //Formats normalMessage foreach(Player,i) { SendMessageToAdmins( A_CHAT_COLORS[adlvl[playerid] - 1], adminMessage ); //Sends adminMessage to administration SendMessageToNormal( A_CHAT_COLORS[adlvl[playerid] - 1], normalMessage ); //Sends normalMessage to normal players } return 1; }
Well... I already fixed this. Still thanks for the help Daymen.
|