SendClientMessageToAll(format) problem
#6

C_WHI is defined correctly. Is C_RED defined as?
pawn Код:
#define C_RED "{FF0000}"
Quote:
Originally Posted by Twizted
Посмотреть сообщение
pawn Код:
szString[64],
Change the , to ; and the problem should be resolved, therefore being:

pawn Код:
szString[64];
He uses "," because at the next line there's 1 more variable.

Quote:
Originally Posted by Mike.FTW
Посмотреть сообщение
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new
        szString[64],
        name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    switch(reason)
    {
        case 0: format(szString, sizeof szString, "{C_RED}%s{C_WHI} has been disconnected in the server. (Timed Out/Crashed)", name);
        case 1: format(szString, sizeof szString, "{C_RED}%s{C_WHI} has been disconnected in the server. (Quit)", name);
        case 2: format(szString, sizeof szString, "{C_RED}%s{C_WHI} has been disconnected in the server. (Kicked/Banned)", name);
    }
    SendClientMessageToAll(-1, szString);
    return 1;
}
And change
pawn Код:
#define C_WHI "{FFFFFF}"
to
pawn Код:
#define C_WHI 0xFFFFFFAA
You defined it bad.
Do the same with the other color.
You have to use "" around the C_RED and C_WHI, otherwise they'll be taken as text. Also C_WHI must be defined as "{FFFFFF}" because it's a string, not an integer.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)