This should not have any issues
PHP Code:
#include <amxmodx>
#define TASK_ID 6514515
#define TASK_TIME 10.0
new g_MaxPlayers
public plugin_init()
{
register_plugin("Auto Ready Command" , "0.01" , "LearninG")
register_event("TextMsg", "Event_TextMsg_Restarting", "a", "2=#Game_will_restart_in")
g_MaxPlayers = get_maxplayers()
}
public client_putinserver(id)
{
set_task(TASK_TIME , "client_start_command" , id + TASK_ID)
}
public Event_TextMsg_Restarting()
{
set_task(TASK_TIME , "client_start_command2")
}
public client_start_command(TASK)
{
new id = TASK - TASK_ID
client_cmd(id , "say .ready")
}
public client_start_command2()
{
for (new i = 1; i<= g_MaxPlayers; i++)
{
if (is_user_connected(i))
{
client_cmd(i , "say .ready")
}
}
}