how can i put a cvar to this plugin for off/on with /turnon /turnoff commands. And how to add multiple sound becouse something is wrong only plays 1 sound.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Round Start/End"
#define AUTHOR "DoviuX"
#define VERSION "1.3"
new const STARTSOUND[]=
{
"RoundStart/Start/Start1.wav",
"RoundStart/Start/Start2.wav",
"RoundStart/Start/Start3.wav"
}
new const ENDSOUND[]=
{
"RoundStart/End/End1.wav",
"RoundStart/End/End2.wav",
"RoundStart/End/End3.wav"
}
/*================================================================================
[Plugin Start]
=================================================================================*/
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_logevent("logevent_round_start", 2, "1=Round_Start")
register_logevent("logevent_round_end", 2, "1=Round_End")
register_clcmd("say /turnoff","turnoff")
register_clcmd("say_team /turnoff","turnoff")
register_clcmd("say /turnon","turnon")
register_clcmd("say_team /turnon","turnon")
}
public plugin_precache()
{
precache_sound(STARTSOUND)
precache_sound(ENDSOUND)
}
public logevent_round_start(id) {
set_task(10.0, "1=Round_Start")
client_cmd(id, "spk %s", STARTSOUND)
set_hudmessage(225, 225, 225, -1.0, 0.29, 2, 6.0, 12.0 );
show_hudmessage(0, "The Ultimate Battle Has Begun !");
}
public logevent_round_end(id) {
set_task(10.0, "1=Round_End")
client_cmd(id, "spk %s", ENDSOUND)
set_hudmessage(225, 225, 225, -1.0, 0.29, 2, 6.0, 12.0 );
show_hudmessage(0, "The Ultimate Battle Has ended !");
}