AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   win sound problem (https://forums.alliedmods.net/showthread.php?t=146941)

DoviuX 01-03-2011 11:37

win sound problem
 
I need that if Terrorist team won then to terrorists play success.wav , and to ct's you_failed.wav, if ct's win to terrorists you_failed.wav , to ct's success.wav.

PHP Code:

public message_SendAudio(msg_idmsg_destid)
{
    new 
AudioCode[22]; 
    
get_msg_arg_string(2AudioCodecharsmax(AudioCode) )
    
    if(
equal(AudioCode"%!MRAD_terwin"))
    {
        if(
cs_get_user_team(id) == CS_TEAM_T)
        {
            
set_msg_arg_string(2"gungame/success.wav")
        }
        else if(
cs_get_user_team(id) == CS_TEAM_CT)
        {
            
set_msg_arg_string(2"gungame/you_failed.wav")
        }
    }    
    else if(
equal(AudioCode"%!MRAD_ctwin"))
    {
        if(
cs_get_user_team(id) == CS_TEAM_CT)
        {
            
set_msg_arg_string(2"gungame/success.wav")
        }
        else if(
cs_get_user_team(id) == CS_TEAM_T)
        {
            
set_msg_arg_string(2"gungame/you_failed.wav")        
        }
    }
    return 
PLUGIN_CONTINUE



reinert 01-03-2011 13:04

Re: win sound problem
 
you have to get ct and t players with get_players...

GXLZPGX 01-03-2011 13:06

Re: win sound problem
 
Quote:

Originally Posted by DoviuX (Post 1385218)
I need that if Terrorist team won then to terrorists play success.wav , and to ct's you_failed.wav, if ct's win to terrorists you_failed.wav , to ct's success.wav.

PHP Code:

public message_SendAudio(msg_idmsg_destid)
{
    new 
AudioCode[22]; 
    
get_msg_arg_string(2AudioCodecharsmax(AudioCode) )
    
    if(
equal(AudioCode"%!MRAD_terwin"))
    {
        if(
cs_get_user_team(id) == CS_TEAM_T)
        {
            
set_msg_arg_string(2"gungame/success.wav")
        }
        else if(
cs_get_user_team(id) == CS_TEAM_CT)
        {
            
set_msg_arg_string(2"gungame/you_failed.wav")
        }
    }    
    else if(
equal(AudioCode"%!MRAD_ctwin"))
    {
        if(
cs_get_user_team(id) == CS_TEAM_CT)
        {
            
set_msg_arg_string(2"gungame/success.wav")
        }
        else if(
cs_get_user_team(id) == CS_TEAM_T)
        {
            
set_msg_arg_string(2"gungame/you_failed.wav")        
        }
    }
    return 
PLUGIN_CONTINUE



Loop through the players.


All times are GMT -4. The time now is 02:06.

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