All pastes #369737 Raw Edit

objeditor.pwn

public text v1 · immutable
#369737 ·published 2007-02-24 00:39 UTC
rendered paste body
// Echo addition for private messages

new HidePM[SLOTS];

public OnPlayerPrivmsg(senderid, playerid, text[] )
{
	new string[256];
	new name[24]; // Reciever
	new name2[24]; // Sender
	GetPlayerName( playerid, name, 24 );
	GetPlayerName( senderid, name2, 24 );
	//format(string, sizeof(string), "[pm] %s %d %s %d %s", name, playerid, name2, senderid, text); Only needed if you want to log to IRC
	//add_log( string );
	format(string, sizeof(string), "PM sent to %s (ID:%d): %s", name, playerid, text);
	SendClientMessage(senderid, 0xFCF54500, string);
	format(string, sizeof(string), "PM from %s (ID:%d): %s", name2, senderid, text);
	SendClientMessage(playerid, 0xFFDC1800, string);
	format( string, sizeof( string ), "PM from %s(ID:%d) to %s(ID:%d): %s", name2, senderid, name, playerid, text );
	// Now inform admins about it
	for( new i = 0; i < MAX_PLAYERS; i ++ )
	{
		if( IsPlayerConnected( i ) )
		{
		    if( PNS_UserLevel( i ) >= 3 ) // Edit this
		    {
		        // Level 3 admin or higher, may see PM. Well... do we want to see PM's?
		        // Oh, and the recieving player shouldn't see this either.
		        if( HidePM[ i ] != 1 && i != playerid )
				{
				    // Yay, send the notice.
				    SendClientMessage( i, COLOR_LIGHTBLUE, string );
				}
			}
		}
	}
	return 0;
}