Help me with OnPlayertext
#1

i have this on my OnPlayerText

pawn Код:
public OnPlayerText(playerid, text[])
{
    if (InAFK[playerid] == 1)
    {
        SendClientMessage(playerid, COLOR_RED, "{323299}[oXS]{FF0000} You are Now in AFK/BRB Mode! Try /back to speak!");
        return 0;
    }

   
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
   
    if(PlayerInfo[playerid][AdminLevel] == 0)
    {
    new msg[256];
    format(msg, sizeof(msg), "{323299}[Player]{FFFFFF} %s:{FFFFFF} %s",pname, text);
    SendPlayerMessageToAll(GetPlayerColor(playerid), msg);
    }
   
    else if(PlayerInfo[playerid][AdminLevel] == 0 && PlayerInfo[playerid][VIPLevel] != 0)
    {
    new msg[256];
    format(msg, sizeof(msg), "{323299}[VIP]{CC00FF} %s:{FFFFFF} %s",pname, text);
    SendPlayerMessageToAll(GetPlayerColor(playerid), msg);
    }

    else if(PlayerInfo[playerid][AdminLevel] == 1)
    {
    new msg[256];
    format(msg, sizeof(msg), "{323299}[Trial Admin]{82CAFA} %s:{FFFFFF} %s",pname, text);
    SendPlayerMessageToAll(GetPlayerColor(playerid), msg);
    }

    else if(PlayerInfo[playerid][AdminLevel] == 2)
    {
    new msg[256];
    format(msg, sizeof(msg), "{323299}[Admin]{82CAFA} %s:{FFFFFF} %s",pname, text);
    SendPlayerMessageToAll(GetPlayerColor(playerid), msg);
    }

    else if(PlayerInfo[playerid][AdminLevel] == 3)
    {
    new msg[256];
    format(msg, sizeof(msg), "{323299}[Moderator]{82CAFA} %s:{FFFFFF} %s",pname, text);
    SendPlayerMessageToAll(GetPlayerColor(playerid), msg);
    }

    else if(PlayerInfo[playerid][AdminLevel] == 4)
    {
    new msg[256];
    format(msg, sizeof(msg), "{323299}[Head Admin]{3BB9FF} %s:{FFFFFF} %s",pname, text);
    SendPlayerMessageToAll(GetPlayerColor(playerid), msg);
    }

    else if(PlayerInfo[playerid][AdminLevel] == 5)
    {
    new msg[256];
    format(msg, sizeof(msg), "{323299}[Lead Admin]{3BB9FF} %s:{FFFFFF} %s",pname, text);
    SendPlayerMessageToAll(GetPlayerColor(playerid), msg);
    }

    else if(PlayerInfo[playerid][AdminLevel] == 6)
    {
    new msg[256];
    format(msg, sizeof(msg), "{323299}[Co-Owner]{008000} %s:{FFFFFF} %s",pname, text);
    SendPlayerMessageToAll(GetPlayerColor(playerid), msg);
    }

    else if(PlayerInfo[playerid][AdminLevel] == 7)
    {
    new msg[256];
    format(msg, sizeof(msg), "{323299}[Owner]{008000} %s:{FFFFFF} %s",pname, text);
    SendPlayerMessageToAll(GetPlayerColor(playerid), msg);
    }


return 0;
}
i want that when a player send a message it should be

[Player] SAMP: HI

but it is displaying as

SAMP:[Player] SAMP: Hi

please help me to fix this
please
Reply
#2

Change your SendPlayerMessageToAll to SendClientMessageToAll.
Reply
#3

Quote:
Originally Posted by kesarthakur
Посмотреть сообщение
[Player] SAMP: HI

but it is displaying as

SAMP:[Player] SAMP: Hi

please help me to fix this
please
GOt confused on what you want to say. Can you send screenshots?
Reply
#4

Quote:
Originally Posted by RenovanZ
Посмотреть сообщение
Change your SendPlayerMessageToAll to SendClientMessageToAll.
Thanks bro fixed it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)