AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved The sound is not playing when the game is over! (https://forums.alliedmods.net/showthread.php?t=310195)

MihaiGamerXD 08-23-2018 10:48

The sound is not playing when the game is over!
 
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 && iVictim && 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)
        }
        }
    }



MihaiGamerXD 08-23-2018 10:49

Re: The sound is not playing when the game is over!
 
Can anyone help me pls?

OciXCrom 08-23-2018 13:41

Re: The sound is not playing when the game is over!
 
Did you just bump your thread in less than a minute? You should get a medal for this.

MihaiGamerXD 08-23-2018 14:07

Re: The sound is not playing when the game is over!
 
No.

Natsheh 08-23-2018 14:20

Re: The sound is not playing when the game is over!
 
Could you explain what event is this?
register_event("30","TheEnd","a")
}

MihaiGamerXD 08-23-2018 15:00

Re: The sound is not playing when the game is over!
 
This is the Intermission Event!

MihaiGamerXD 08-23-2018 15:01

Re: The sound is not playing when the game is over!
 
That means Game End Event!

MihaiGamerXD 08-23-2018 15:02

Re: The sound is not playing when the game is over!
 
Don't understand? In this event you'll see team score when the game is over, or the time's up!

iceeedr 08-23-2018 15:14

Re: The sound is not playing when the game is over!
 
Is it difficult to write everything in a single post?

MihaiGamerXD 08-23-2018 15:35

Re: The sound is not playing when the game is over!
 
No. But I FORGOT to write into a single post! I'm Just Sorry!


All times are GMT -4. The time now is 03:30.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.