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


Messages In This Thread
Custom Text Sending Error - by jameskmonger - 30.12.2010, 20:25
Re: Custom Text Sending Error - by legodude - 30.12.2010, 20:37
Re: Custom Text Sending Error - by jameskmonger - 30.12.2010, 20:44

Forum Jump:


Users browsing this thread: 1 Guest(s)