SA-MP Forums Archive
[HELP] command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] command (/showthread.php?tid=553835)



[HELP] command - Luca12 - 31.12.2014

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


Respuesta: [HELP] command - Cerealguy - 31.12.2014

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


Re: [HELP] command - CalvinC - 31.12.2014

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.