OnPlayerText Problem
#1

I am trying to make an Administrator Chat and a VIP Chat. But for some reason, it's bugged.
Look picture. It doesn't show me the text and it's bugged with the OnPlayerText from my FS. Ignore the double message, it's because I am admin and Vip to test it.

Here is the code.
pawn Код:
public OnPlayerText(playerid, text[])
{
    GetPlayerName(playerid, pname, sizeof(pname));
/*==============================================================================
                                Administrator Chat
==============================================================================*/

    if(text[0] == '#' && PlayerInfo[playerid][Level] >= 1) {
        format(str2, sizeof(str2), "[Admin Chat]: %s (%d): %s", pname, playerid, text[1]);
        MessageToAdmins(COLOR_YELLOW, str2);
        return 0;
    }
/*==============================================================================
                                Vip Chat
==============================================================================*/

    if(text[0] == '*' && PlayerInfo[playerid][Vip] == 1 || PlayerInfo[playerid][Level] >= 1) {
        format(str3, sizeof(str3), "[Vip Chat]: %s: %s", pname, playerid, text[1]);
        MessageToVips(COLOR_CYAN, str3);
        MessageToAdmins(COLOR_CYAN, str3);
        return 0;
    }
        // Rest Of Code
Reply
#2

pawn Код:
format(str3, sizeof(str3), "[Vip Chat]: %s: %s", pname, playerid, text[1]);
you forgot the %d^^
pawn Код:
format(str3, sizeof(str3), "[Vip Chat]: %s (%d): %s", pname, playerid, text[1]);
Reply
#3

The text fixed and appears like that
PHP код:
[Vip Chat]: [i99]Kostas (0): test 
but still bugged with the FS.

Any number I wrote it's like it is same as *
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)