SA-MP Forums Archive
newbie chat - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: newbie chat (/showthread.php?tid=246149)



newbie chat - Max_Coldheart - 03.04.2011

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?


Re: newbie chat - armyoftwo - 03.04.2011

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;
}



Re: newbie chat - Hiddos - 03.04.2011

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


Re: newbie chat - Max_Coldheart - 03.04.2011

oh. Thanks Hiddy & ArmyOfTwo