OnPlayerText ??
#1

How can i make it so when a ADMIN chats to other player it comes up with
EXAMPLE
[ADMIN] hello

i mean where do i put the FORMAT
under OnPlayerText or ?

CODE
pawn Код:
//Does this goto OnPlayerText ?
if(PlayerInfo[playerid][PlayerAdmin] >= 1)
{
/*And what shell i do here?
just make a FORMAT like this ? */

new string[128];
format(string,sizeof(string),"[ADMIN] %s",cmdtext);
}
Reply
#2

pawn Код:
public OnPlayerText(playerid,text[])
{
if(PlayerInfo[playerid][PlayerAdmin] >= 1)
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
format(string,sizeof(string),"[ADMIN] %s : %s",pname,text[0]);
SendClientMessageToAll(COLOR,string);
}
Reply
#3

Put in OnPlayerText callback:

pawn Код:
if(PlayerInfo[playerid][PlayerAdmin] >= 1)
    {
        new string[128];
        format(string,sizeof(string),"{33CCFF}[ADMIN] {FFFFFF}%s",text);
        SendClientMessageToAll(0xFFFFFFAA, string);
        return 0;//It will stop the normal message that appears when you talk.It will happen only for admins.
    }
I hope that i have helped
Reply
#4

Not really, it sends MSG to everyone.
pawn Код:
public OnPlayerText(playerid, text[])
{
    if( text[ 0 ] == '#' || text[ 0 ] == '.' && PlayerInfo[ playerid ][ PlayerAdmin ] >= 1 )
    {      
        new string[ 128 ];
        new pName[ 24 ];
        GetPlayerName( playerid, pName, 24 );
        for( new i; i < MAX_PLAYERS; i++ )
        {
            if( PlayerInfo[ i ][ PlayerAdmin ] >= 1 )
            {
                format( string, sizeof string, "[ADMINCHAT]: %s: %s ", pName, text[1] );
                SendClientMessage( i, 0xAAAAAA, string ); // You can change da color.
            }
        }
    }
    return 0;
}
EDIT: Misunderstood your post, but still there's a piece of code you could use ^^. .
Reply
#5

SOLVED THANK YOU ALLL
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)