[Tutorial] Simple /announce command.
#5

Why is the announce text 265 cells big? You can only have around ~150 characters in a message (different for other resolutions).

You could of done this without sscanf either.

pawn Код:
CMD:announce(playerid, params[])
{
    new  
        string[152],
        pName[MAX_PLAYER_NAME]
    ;
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFFFFFF, "You are not admin");
    if (isnull(params)) return SendClientMessage(playerid, COLOR_WHITE,"/announce [text]");
    GetPlayerName(playerid, pName, sizeof(pName));
    format(string, sizeof(string), "{F2240D}[Admin] %s:{09F7C7} %s", pName, params);
    SendClientMessageToAll(0xFFFFFFF, string);
    return 1;
}
Reply


Messages In This Thread
Simple /announce command. - by PaulDinam - 24.10.2012, 19:11
Re: Simple /announce command. - by thefatshizms - 24.10.2012, 21:28
Re: Simple /announce command. - by PaulDinam - 24.10.2012, 21:39
Re: Simple /announce command. - by JaKe Elite - 25.10.2012, 00:34
Re: Simple /announce command. - by Emmet_ - 25.10.2012, 00:39

Forum Jump:


Users browsing this thread: 1 Guest(s)