Custom Text Sending Error
#1

pawn Код:
public OnPlayerText(playerid, text[])
{
    new string[128];
    new name[24];
    GetPlayerName(playerid, name, sizeof(name));
    if(!hasDied[playerid]) {
        if(gTeam[playerid] == TEAM_GROVE) {
            format(string, sizeof(string), "{00FF00}%s: {FFFFFF}%s", GetPlayerColor(playerid), name,COLOR_WHITE, text);
            for(new i; i>playersOnlineCount; i++) {
                if(gTeam[playerid] == gTeam[i])
                {
                    format(string, sizeof(string), "{00FF00}%s: {FFFFFF}%s", GetPlayerColor(playerid), name,COLOR_WHITE, text);
                    SendClientMessage(i, 0xFFFFFFFF, string);
                }
            }
            SendClientMessage(playerid, 0xFFFFFFFF, string);
        }
        else if(gTeam[playerid] == TEAM_BALLA) {
            format(string, sizeof(string), "{FF00FF}%s: {FFFFFF}%s", GetPlayerColor(playerid), name,COLOR_WHITE, text);
            for(new i; i>playersOnlineCount; i++) {
                if(gTeam[playerid] == gTeam[i])
                {
                    format(string, sizeof(string), "{FF00FF}%s: {FFFFFF}%s", GetPlayerColor(playerid), name,COLOR_WHITE, text);
                    SendClientMessage(i, 0xFFFFFFFF, string);
                }
            }
            SendClientMessage(playerid, 0xFFFFFFFF, string);
        }
    } else {
        format(string, sizeof(string), "{808080}%s: {FFFFFF}%s", COLOR_GREY,name,COLOR_WHITE, text);
        for(new i; i>playersOnlineCount; i++) {
            if(hasDied[i]) {
                format(string, sizeof(string), "{808080}%s: {FFFFFF}%s", COLOR_GREY,name,COLOR_WHITE, text);
                SendClientMessage(i, 0xFFFFFFFF, string);
            }
        }
        SendClientMessage(playerid, 0xFFFFFFFF, string);
    }
    return 0;
}
That is my code, and theoretically, if I join the server under the name of "James" and say "Hello!", and join under the Grove team, I should get this message:
Quote:
James: Hello!
But for some reason, it says this:
Reply
#2

it is because you only have two placeholders and four vars at the end of the format. change the colours etween curly brackets to the hexx placeholder... i dont have a fucking percent key on ma phone...
Reply
#3

Ah crap, I'm stupid. Sorry, lock this please.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)