Variables! Arrays in this case.
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
new song_on[33] = { 1, ... };
public plugin_init()
{
register_plugin("Theme Music Player", "0.1", "Demonic")
register_cvar("play_song","1")
register_logevent("play_theme_song",2,"0=World triggered","1=Round_Start")
register_clcmd("say /song","cmdSong")
}
public cmdSong(id)
{
if(song_on[id] == 0)
{
song_on[id] = 1
client_print(id,print_chat,"* You will now hear the song on round start")
}
else
{
song_on[id] = 0
client_print(id,print_chat,"* You will no longer hear the song on round start")
}
return PLUGIN_HANDLED
}
// reset variables when user leaves
public client_disconnect(id)
{
song_on[id] = 1;
}
public play_theme_song()
{
if(get_cvar_num("play_song") == 0)
{
return PLUGIN_HANDLED
}
new players[32], num, i
get_players(players,num)
for(i=0;i<num;i++)
{
new player = players[i]
if(song_on[player] == 1) {
client_cmd(id,"spk misc/CDC2562.wav")
}
}
client_print(0,print_chat,"Welcome to *Team-@[CoDc] Clan Server. Got POONED?")
return PLUGIN_HANDLED
}
public plugin_precache()
{
precache_sound("misc/CDC2562.wav")
}
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS