PHP Code:
#include < amxmodx >
public plugin_init ( )
{
register_plugin ( "Connect MOTD", "1.0", "You" )
}
public client_putinserver ( index )
{
if ( is_user_bot ( index ) || is_user_hltv ( index ) )
{
return PLUGIN_HANDLED
}
// Remeber to put 'your_file.txt' in 'cstrike/' folder.
// You can change the header of the MOTD, see the second param.
show_motd ( index, "your_file.txt", "MOTD header" )
return PLUGIN_HANDLED
}
If the first don't work, try this:
PHP Code:
#include < amxmodx >
#include < cstrike >
#define MOTD_TASK 13579
public plugin_init ( )
{
register_plugin ( "Connect MOTD", "1.0", "You" )
}
public client_putinserver ( index )
{
if ( is_user_bot ( index ) || is_user_hltv ( index ) )
{
return PLUGIN_HANDLED
}
// You can change here the time to recheck the player team.
set_task ( 2.5, "show_motd_file", index + MOTD_TASK, _, _, "b" )
}
public show_motd_file ( index )
{
index - MOTD_TASK
// If the player has a team, show the MOTD and remove the task.
if ( cs_get_user_team ( index ) != CS_TEAM_UNASSIGNED )
{
// Remeber to put 'your_file.txt' in 'cstrike/' folder.
// And you also can change the MOTD header ( second param ) .
show_motd ( index, "your_file.txt", "MOTD header" )
remove_task ( index + MOTD_TASK )
}
// If is already unassigned, wait and continue the task.
return PLUGIN_HANDLED
}
public player_disconnect ( index )
{
// Remove the task if the player disconnect.
remove_task ( index + MOTD_TASK )
}