AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   play sound on team kill (https://forums.alliedmods.net/showthread.php?t=54860)

flyeni6 05-05-2007 19:46

play sound on team kill
 
how do i play a sound on team kill?

thx

scrtxxcaz 05-06-2007 02:33

Re: play sound on team kill
 
Code:

public plugin_int(){
        register_event("DeathMsg","event_death","a","1>0")
}
plubic event_death(id){
        new Killer = read_data(1)
        new Victim = read_data(2)
        new teamA = get_user_team(Killer)
        new teamB = get_user_team(Victim)
        if(teamA == teamB)
        {
                  //play sound
          }
}


flyeni6 05-06-2007 12:34

Re: play sound on team kill
 
thank you

Orangutanz 05-06-2007 12:51

Re: play sound on team kill
 
If your using ATAC3 RC2+ system:

Code:
#include <amxmodx> #include <atac> #define PLUGIN "PLUGIN_NAME" #define VERSION "1.0" #define AUTHOR "YOUR_NAME" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     atac_register_addon() } public atac_team_kill(killer, victim) {     //play sound }
:mrgreen:

flyeni6 05-06-2007 15:24

Re: play sound on team kill
 
Quote:

Originally Posted by scrtxxcaz (Post 473917)
Code:

public plugin_int(){
        register_event("DeathMsg","event_death","a","1>0")
}
plubic event_death(id){
        new Killer = read_data(1)
        new Victim = read_data(2)
        new teamA = get_user_team(Killer)
        new teamB = get_user_team(Victim)
        if(teamA == teamB)
        {
                  //play sound
          }
}


there is something wrong with this because when i suicide the sound plays

regalis 05-06-2007 16:32

Re: play sound on team kill
 
Quote:

Originally Posted by flyeni6 (Post 474097)
there is something wrong with this because when i suicide the sound plays

If you are in Terrorist team and make suicide, then you are killed by a Terrorist --> there is nothing wrong! :P

But maybe you would like to extend this little code...

Try something like this:
Code:

public plugin_int()
{
    register_event("DeathMsg","event_death","a","1>0")
}

plubic event_death(id)
{
    new Killer = read_data(1)
    new Victim = read_data(2)
    if(!equal(Killer, Victim))
    {
        new teamA = get_user_team(Killer)
        new teamB = get_user_team(Victim)
        if(teamA == teamB)
        {
            //play sound
        }
    }
}


flyeni6 05-06-2007 16:48

Re: play sound on team kill
 
Quote:

Originally Posted by regalis (Post 474116)
If you are in Terrorist team and make suicide, then you are killed by a Terrorist --> there is nothing wrong! :P

But maybe you would like to extend this little code...

Try something like this:
Code:

public plugin_int()
{
    register_event("DeathMsg","event_death","a","1>0")
}
 
plubic event_death(id)
{
    new Killer = read_data(1)
    new Victim = read_data(2)
    if(!equal(Killer, Victim))
    {
        new teamA = get_user_team(Killer)
        new teamB = get_user_team(Victim)
        if(teamA == teamB)
        {
            //play sound
        }
    }
}


Code:

/home/groups/amxmodx/tmp3/textkK55u1.sma(16) : error 035: argument type mismatch (argument 1)

teame06 05-06-2007 16:55

Re: play sound on team kill
 
equal native is only for strings.

Code:
if(Victim != Killer)

flyeni6 05-06-2007 17:28

Re: play sound on team kill
 
Quote:

Originally Posted by teame06 (Post 474124)
equal native is only for strings.


Code:
</p><p>if(Victim != Killer)</p><p>

thank you and thanks for the people who helped


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

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