asay command doubled message
#9

Quote:
Originally Posted by Calisthenics
Посмотреть сообщение
The color will depend on the level of the admin who executes the command? If yes, it is true that you do not need a loop. For only 1 parameter that is string, use isnull macro- no need for sscanf.
Max client message is 144 characters.
pawn Код:
CMD:asay(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Error: {FFFFFF}Unknown command, type /cmds for the list of commands.");
    if (isnull(params)) return SendClientMessage(playerid, COLOR_GRAY, "Syntax: /asay [message]");

    new text[145], color_of_text;

    switch (PlayerInfo[playerid][pAdmin])
    {
        case 1: color_of_text = COLOR_LEVEL1;
        case 2: color_of_text = COLOR_LEVEL2;
        case 3: color_of_text = COLOR_LEVEL3;
    }

    format(text, sizeof (text), "Admin: %s", params);
    SendClientMessageToAll(color_of_text, text);
    return 1;
}
Thanks, + rep.
Reply


Messages In This Thread
asay command doubled message - by Mike861 - 04.07.2018, 13:52
Re: asay command doubled message - by Exhibit - 04.07.2018, 13:57
Re: asay command doubled message - by Slawi - 04.07.2018, 14:07
Re: asay command doubled message - by Banditul18 - 04.07.2018, 14:08
Re: asay command doubled message - by Mike861 - 04.07.2018, 14:09
Re: asay command doubled message - by Lokii - 04.07.2018, 14:32
Re: asay command doubled message - by Calisthenics - 04.07.2018, 14:46
Re: asay command doubled message - by Slawi - 04.07.2018, 14:49
Re: asay command doubled message - by Mike861 - 04.07.2018, 14:52

Forum Jump:


Users browsing this thread: 3 Guest(s)