newbie chat
#1

Okay, I just created newbie chat, else its working fine, but text doesnt show up ?
How to fix it?
my code:
pawn Код:
CMD:newbie(playerid, params[])
{
    new text[128], name[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid, name, sizeof(name));
    if(PlayerInfo[playerid][pNMuted] == 1) return SendClientMessage(playerid, COLOR_GREY, " You are muted from talking in this channel.");
    if(PlayerInfo[playerid][pHelperLevel] == 1)
    {
        format(string, sizeof(string), "** Junior Helper %s: %s", name, text);
        SendClientMessageToAll(COLOR_PURPLE, string);
    }
    else if(PlayerInfo[playerid][pHelperLevel] == 2)
    {
        format(string, sizeof(string), "** Helper %s: %s", name, text);
        SendClientMessageToAll(COLOR_PURPLE, string);
    }
    else if(PlayerInfo[playerid][pHelperLevel] == 3)
    {
        format(string, sizeof(string), "** Senior Helper %s: %s", name, text);
        SendClientMessageToAll(COLOR_PURPLE, string);
    }
    else if(PlayerInfo[playerid][pHelperLevel] == 4)
    {
        format(string, sizeof(string), "** Head Helper %s: %s", name, text);
        SendClientMessageToAll(COLOR_PURPLE, string);
    }
    else if(PlayerInfo[playerid][pHelperLevel] == 5)
    {
        format(string, sizeof(string), "** Community Advisor %s: %s", name, text);
        SendClientMessageToAll(COLOR_PURPLE, string);
    }
    else if(PlayerInfo[playerid][pAdmin] == 1)
    {
        format(string, sizeof(string), "** Moderator %s: %s", name, text);
        SendClientMessageToAll(COLOR_PURPLE, string);
    }
    else if(PlayerInfo[playerid][pAdmin] == 2)
    {
        format(string, sizeof(string), "** Administrator %s: %s", name, text);
        SendClientMessageToAll(COLOR_PURPLE, string);
    }
    else if(PlayerInfo[playerid][pAdmin] == 3)
    {
        format(string, sizeof(string), "** Senior Administrator %s: %s", name, text);
        SendClientMessageToAll(COLOR_PURPLE, string);
    }
    else if(PlayerInfo[playerid][pAdmin] == 4)
    {
        format(string, sizeof(string), "** Co-owner %s: %s", name, text);
        SendClientMessageToAll(COLOR_PURPLE, string);
    }
    else if(PlayerInfo[playerid][pAdmin] == 5)
    {
        format(string, sizeof(string), "** Owner %s: %s", name, text);
        SendClientMessageToAll(COLOR_PURPLE, string);
    }
    else
    {
        format(string, sizeof(string), "** Newbie %s: %s", name, text);
        SendClientMessageToAll(COLOR_PURPLE, string);
    }
    return 1;
}
no errors but prints out like this:
Quote:
Originally Posted by Max_Coldheart
Newbie Max_Coldheart:
but there should be text. Whats wrong?
Reply
#2

pawn Код:
CMD:newbie(playerid, params[])
{
    new name[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid, name, sizeof(name));
    if(PlayerInfo[playerid][pNMuted] == 1) return SendClientMessage(playerid, COLOR_GREY, " You are muted from talking in this channel.");
    if(PlayerInfo[playerid][pHelperLevel] == 1)
    {
        format(string, sizeof(string), "** Junior Helper %s: %s", name, params);
        SendClientMessageToAll(COLOR_PURPLE, string);
    }
    else if(PlayerInfo[playerid][pHelperLevel] == 2)
    {
        format(string, sizeof(string), "** Helper %s: %s", name, params);
        SendClientMessageToAll(COLOR_PURPLE, string);
    }
    else if(PlayerInfo[playerid][pHelperLevel] == 3)
    {
        format(string, sizeof(string), "** Senior Helper %s: %s", name, params);
        SendClientMessageToAll(COLOR_PURPLE, string);
    }
    else if(PlayerInfo[playerid][pHelperLevel] == 4)
    {
        format(string, sizeof(string), "** Head Helper %s: %s", name, params);
        SendClientMessageToAll(COLOR_PURPLE, string);
    }
    else if(PlayerInfo[playerid][pHelperLevel] == 5)
    {
        format(string, sizeof(string), "** Community Advisor %s: %s", name, params);
        SendClientMessageToAll(COLOR_PURPLE, string);
    }
    else if(PlayerInfo[playerid][pAdmin] == 1)
    {
        format(string, sizeof(string), "** Moderator %s: %s", name, params);
        SendClientMessageToAll(COLOR_PURPLE, string);
    }
    else if(PlayerInfo[playerid][pAdmin] == 2)
    {
        format(string, sizeof(string), "** Administrator %s: %s", name, params);
        SendClientMessageToAll(COLOR_PURPLE, string);
    }
    else if(PlayerInfo[playerid][pAdmin] == 3)
    {
        format(string, sizeof(string), "** Senior Administrator %s: %s", name, params);
        SendClientMessageToAll(COLOR_PURPLE, string);
    }
    else if(PlayerInfo[playerid][pAdmin] == 4)
    {
        format(string, sizeof(string), "** Co-owner %s: %s", name, params);
        SendClientMessageToAll(COLOR_PURPLE, string);
    }
    else if(PlayerInfo[playerid][pAdmin] == 5)
    {
        format(string, sizeof(string), "** Owner %s: %s", name, params);
        SendClientMessageToAll(COLOR_PURPLE, string);
    }
    else
    {
        format(string, sizeof(string), "** Newbie %s: %s", name, params);
        SendClientMessageToAll(COLOR_PURPLE, string);
    }
    return 1;
}
Reply
#3

You're not assigning any value to the 'text' string.
Reply
#4

oh. Thanks Hiddy & ArmyOfTwo
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)