Quote:
Originally Posted by HisHighnessSajjad
I want the name of the plugin which shows the specified chat messages automatically after a specified period of time.
For example:
"Contact the server admin via BlackBerry Messenger (PIN: 2010****)"
This messages should be displayed as a chat message after every 120 seconds. The word 'BlackBerry Messenger' must be in green.. all the other words must be yellow or of any other color.
Can I have the name of this plugin?
|
Hi there,
Sorry, I don't know the name of the plugin you were talking about. So I make it for you.
PHP Code:
#include < amxmodx >
#define DELAY 120.0 // Note: Edit here to set the delay.
new g_iMsgSayText
public plugin_init( )
{
register_plugin( "Display Message", "1.0", "Rampage.Scent" )
set_task( DELAY, "Display_Message", 0, _, _, "b" )
g_iMsgSayText = get_user_msgid( "SayText" )
}
public Display_Message( id )
{
client_printcolor( id, "/yContact the server admin via /gBlackBerry Messenger/y (PIN: 2010****)" )
}
stock client_printcolor( const id, const input[ ], any:... )
{
new iCount = 1, iPlayers[ 32 ]
static szMsg[ 191 ]
vformat( szMsg, charsmax( szMsg ), input, 3 )
replace_all( szMsg, 190, "/g", "^4" )
replace_all( szMsg, 190, "/y", "^1" )
replace_all( szMsg, 190, "/ctr", "^3" )
replace_all( szMsg, 190, "/w", "^0" )
if ( id ) iPlayers[ 0 ] = id
else get_players( iPlayers, iCount, "ch" )
for ( new i = 0; i < iCount; i++ )
{
if ( is_user_connected( iPlayers[ i ] ) )
{
message_begin( MSG_ONE_UNRELIABLE, g_iMsgSayText, _, iPlayers[ i ] )
write_byte( iPlayers[i] )
write_string( szMsg )
message_end( )
}
}
}
__________________