Oh no its xpaw here
PHP Code:
#include <amxmodx>
new g_pTimelimit;
new g_szMapname[ 32 ];
new bool:g_bSawMotd[ 33 ];
public plugin_init( ) {
register_plugin( "MOTD System", "1.0", "xPaw" );
if( !file_exists( "motd.txt" ) )
pause( "ad" );
g_pTimelimit = get_cvar_pointer( "mp_timelimit" );
get_mapname( g_szMapname, 31 );
register_dictionary( "timeleft.txt" );
register_message( get_user_msgid( "MOTD" ), "MessageMOTD" );
}
public client_connect( id )
g_bSawMotd[ id ] = false;
public MessageMOTD( const MsgId, const MsgDest, const id ) {
if( g_bSawMotd[ id ] )
return PLUGIN_CONTINUE;
new szText[ 128 ], szName[ 40 ], bSet;
get_msg_arg_string( 2, szText, 127 );
if( contain( szText, "%username%" ) != 1 ) {
get_user_name( id, szName, 31 );
replace( szText, 127, "%username%", szName );
bSet = true;
}
if( contain( szText, "%servname%" ) != 1 ) {
get_user_name( 0, szName, 39 );
replace( szText, 127, "%servname%", szName );
bSet = true;
}
if( contain( szText, "%currmap%" ) != 1 ) {
replace( szText, 127, "%currmap%", g_szMapname );
bSet = true;
}
if( contain( szText, "%timeleft%" ) != 1 ) {
if( get_pcvar_float( g_pTimelimit ) ) {
new iTimeleft = get_timeleft( );
formatex( szName, 39, "%d:%02d", iTimeleft / 60, iTimeleft % 60 );
} else
formatex( szName, 39, "%L", LANG_PLAYER, "NO_T_LIMIT" );
replace( szText, 127, "%timeleft%", szName );
bSet = true;
}
if( bSet )
set_msg_arg_string( 2, szText );
if( get_msg_arg_int( 1 ) == 1 )
g_bSawMotd[ id ] = true;
return PLUGIN_CONTINUE;
}
Any changes / suggestions?
__________________