Raised This Month: $ Target: $400
 0% 

Play MP3 to victims teammates only


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-13-2010 , 05:42   Re: Play MP3 to victims teammates only
Reply With Quote #1

Loop through all players or using get_players() then check the team.
__________________
Arkshine is offline
Rirre
Veteran Member
Join Date: Nov 2006
Old 05-13-2010 , 06:30   Re: Play MP3 to victims teammates only
Reply With Quote #2

I have no clue how that works.

EDIT:
Alright, currently got this:
PHP Code:
#include <amxmodx>
#include <cstrike>

#define music 4

new g_MaxPlayers;

new 
mp3list[music][] = 
{
    
"file1.mp3",
    
"file2.mp3",
    
"file3.mp3",
    
"file4.mp3"
}

public 
plugin_init ()
{
    
register_plugin"Sound On Death""1.0""Biscuit" );
    
register_event"DeathMsg""Event_PlayerKilled""a" );
    
register_logevent("round_end_event"2"1=Round_End");
    
g_MaxPlayers get_maxplayers();
}

public 
round_end_event()
    
client_cmd(0,"mp3 stop");

public 
Event_PlayerKilled (id)
{
new 
random_num(0,music-1);

    for (new 
Client 1Client <= g_MaxPlayersClient++)
    {
        if (!
is_user_connected(Client))
            continue;

        switch (
get_user_team(Client))
        {
            case 
1// Terrorist
            
{
                
client_cmd(id,"mp3 play %s",mp3list[r]);
            }
            case 
2// CT
            
{
                
client_cmd(id,"mp3 play %s",mp3list[r]);
            }
        }
    }

The problem with this one is if I kill a enemy, it play the song to me.
Supposed to be contrary.

Right now I have no idea how to fix this.
Appreciate help.

Last edited by Rirre; 05-13-2010 at 07:43.
Rirre is offline
Reply



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 03:49.


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