Quote:
Originally Posted by mug1wara
PHP Code:
#include <sourcemod>
public void OnMapStart() { CreateTimer(300.0, Timer_Callback, _, TIMER_REPEAT); /* eg. 5 * 60 = 300 = = 5 min = 300 sec */ }
public Action Timer_Callback(Handle hTimer) { ServerCommand("sm_rainiman @all"); return Plugin_Handled; }
|
You are not returning Plugin_Continue, which will prevent the timer from repeating. Also, you are creating a timer OnMapStart, yet you are not using the TIMER_FLAG_NO_MAPCHANGE flag with the timer.
Use this code instead:
PHP Code:
#include <sourcemod>
public void OnMapStart()
{
CreateTimer(300.0, Timer_Callback, _, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
}
public Action Timer_Callback(Handle timer)
{
ServerCommand("sm_rainiman @all");
return Plugin_Continue;
}
If you want more than one command to be executed, simply add a semicolon after the first command and enter your next command.
Example:
PHP Code:
ServerCommand("sm_rainiman @all;sm_slay @all");