OnPlayerText ?? - 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: OnPlayerText ?? (
/showthread.php?tid=228931)
OnPlayerText ?? -
park4bmx - 20.02.2011
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);
}
Re: OnPlayerText ?? -
Marricio - 20.02.2011
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);
}
Re: OnPlayerText ?? - rjjj - 20.02.2011
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
Re: OnPlayerText ?? -
Mean - 20.02.2011
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 ^^.
.
Re: OnPlayerText ?? -
park4bmx - 20.02.2011
SOLVED THANK YOU ALLL