[HELP] command
#1

Hello how can I make in some command that if player has admin level from 2 to 1337 then when he types something to all players on server like Luca_Johnson: Hello then I can make for those admin levels put a red color of text and for head admins as 1338 the same just the text this time is lightblue color if you know what I mean? Thanks
Reply
#2

wtf?, You mean a different text color in chat depending on the level of administration?
Reply
#3

First you can make an "if" to check if the admins level is above something, with "< (lvl)", and then make it format a string with red color.

Then an else if, to check the same, but with 1338, which formats another string with lightblue color instead.

Then an else, which will find if the player isn't any of these, and format a white message.
That's how i would do it atleast.
pawn Код:
public OnPlayerText(playerid, text[])
{
    new string[128], playername[MAX_PLAYER_NAME];
    if(PlayerInfo[playerid][pAdmin] < 2 && (PlayerInfo[playerid][pAdmin] !< 1338)) format(string, sizeof(string), "{FF0000}%s: %s", playername, text);
    else if(PlayerInfo[playerid][pAdmin] < 1338) format(string, sizeof(string), "{00FFEE}%s: %s", playername, text);
    else format(string, sizeof(string), "%s: %s", playername, params);
    SendClientMessageToAll(0xFFFFFF, string);
    return 0;
}
Haven't tested the above command, might need a little editing.
And replace "PlayerInfo[playerid][pAdmin]" with what you use.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)