Raised This Month: $ Target: $400
 0% 

Check team's on round end - problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
krysteksulek
Member
Join Date: Aug 2013
Location: Poland
Old 05-27-2014 , 18:46   Check team's on round end - problem
Reply With Quote #1

Hi.
I want to make a plugin, which will play sound for winning and loosing team (2 different sound's).
So i made that code:

Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Test"
#define VERSION "1.0"
#define AUTHOR "Test"


public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_event("SendAudio", "event_roundend_t", "a", "2&%!MRAD_terwin") 
    register_event("SendAudio", "event_roundend_ct", "a", "2&%!MRAD_ctwin") 
}

public plugin_precache()
{
    precache_sound("misc/win.mp3")
    precache_sound("misc/lose.mp3")

}
public event_roundend_t(id)
{
    if (get_user_team(id) == 2)
    {    
        //client_cmd(id, "mp3 play sound/misc/lose")
        client_print(id,print_center, "You are CT")
    }
    if ((get_user_team(id) == 1))
    {    
        //client_cmd(id, "mp3 play sound/misc/win")
        client_print(id,print_center, "You are TT")
    }
}
public event_roundend_ct(id)
{
    if (get_user_team(id) == 1)
    {    
        //client_cmd(id, "mp3 play sound/misc/lose")
        client_print(id,print_center, "You are CT")
    }
    if ((get_user_team(id) == 2))
    {    
        //client_cmd(id, "mp3 play sound/misc/win")
        client_print(id,print_center, "You are TT")
    }
}
When i'm not chcecking team's, sound/print is working, but when i'm doing it, nothing happens (and not error's). I also tried with cs_get_user_team, but same effect.

I tried to save checking team's on spawn, and then add it to MRAD, but nothing:

Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>

#define PLUGIN "Test"
#define VERSION "1.0"
#define AUTHOR "Test"

new CsTeams:xTeam[33]


public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_event("SendAudio", "event_roundend_t", "a", "2&%!MRAD_terwin") 
    //register_event("SendAudio", "event_roundend_ct", "a", "2&%!MRAD_ctwin") 
    
    RegisterHam(Ham_Spawn, "player", "Spawn", 1);
}

public plugin_precache()
{
    precache_sound("misc/win.mp3")
    precache_sound("misc/lose.mp3")

}
public event_roundend_t(id)
{
    if(is_user_connected(id) && xTeam[id] == CS_TEAM_T) 
    {    
        //client_cmd(id, "mp3 play sound/misc/win")
        client_print(id,print_center, "Jestes TT")
    }
}
public Spawn(id) 
{
    xTeam[id] = cs_get_user_team(id)
    if(is_user_connected(id) && xTeam[id] == CS_TEAM_T) 
    client_print(id, print_chat, "You're terro"); 
}
Any ideas? Maybe you know another way to play 2 different sound's when any team lose or win?

Last edited by krysteksulek; 05-27-2014 at 18:47.
krysteksulek is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:48.


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