Hello everybody, I have one more problem: The sound is not playing when the game is over! I tried this code:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fun>
#include <cstrike>
new ct_point = 0
new t_point = 0
new const ct_win[] = "ct_win/yes!.wav"
new const t_win[] = "t_win/no!.wav"
public plugin_init() {
register_event("DeathMsg","onDeath","a")
register_event("30","TheEnd","a")
}
public onDeath() {
new iKiller = read_data(1)
new iVictim = read_data(2)
if (iKiller > 0 && iVictim > 0 && iKiller != iVictim) {
if (is_user_alive(iKiller)) {
if (cs_get_user_team(iKiller) == CS_TEAM_CT) {
bird_point += 1
}
if (cs_get_user_team(iKiller) == CS_TEAM_T) {
pig_point += 1
}
}
}
}
public TheEnd() {
if (is_user_alive(id)) {
new mapname[32]
get_mapname(mapname,31)
if (equal(mapname,"redswar_tdm")) {
if (bird_point > pig_point) {
client_cmd(0,"stopsound")
client_cmd(0,"spk %s",ct_win)
}
else if (bird_point < pig_point) {
client_cmd(0,"stopsound")
client_cmd(0,"spk %s",t_win)
}
}
}
}