AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Suicide Event (https://forums.alliedmods.net/showthread.php?t=333217)

MacL 06-25-2021 14:44

Suicide Event
 
Hey there alliedmodders, look at this code:
PHP Code:

        new thing[3], attacker read_data(1), victim read_data(2);

        
read_data(4,thing,2);
        if(
thing[1] != 'k'
        {
        
// knife;
        
}  
        if(
attacker == victim)
        {
        
// Suicide;
        
}    
        if(
thing[0] == 'k')
        {
        
// normal kill;
        
}

        
//return 0; 

why i cant get the suicide event? kill or knife works fine but suicide works when i change my team.

Bugsy 06-25-2021 15:12

Re: Suicide Event
 
For fall suicide, attacker = 0, IIRC

MacL 06-26-2021 06:39

Re: Suicide Event
 
Quote:

Originally Posted by Bugsy (Post 2751123)
For fall suicide, attacker = 0, IIRC

Worked once. But after that nope.

Bugsy 06-26-2021 10:24

Re: Suicide Event
 
PHP Code:


#include <amxmodx>

public plugin_init() 
{
    
register_event"DeathMsg" "Event_DeathMsg" "a" );
}

public 
Event_DeathMsg()
{
    new 
iAttacker read_data);
    new 
iVictim read_data);
    
    if ( ( 
iAttacker == ) || ( iAttacker == iVictim ) )
    {
        
client_printiVictim print_chat "Nice suicide, chief." );
    }



MacL 06-26-2021 17:56

Re: Suicide Event
 
Quote:

Originally Posted by Bugsy (Post 2751212)
PHP Code:


#include <amxmodx>

public plugin_init() 
{
    
register_event"DeathMsg" "Event_DeathMsg" "a" );
}

public 
Event_DeathMsg()
{
    new 
iAttacker read_data);
    new 
iVictim read_data);
    
    if ( ( 
iAttacker == ) || ( iAttacker == iVictim ) )
    {
        
client_printiVictim print_chat "Nice suicide, chief." );
    }



It did not work again. problem was in main code. But thanks chief, you lovely american.

Bugsy 06-26-2021 20:19

Re: Suicide Event
 
Quote:

Originally Posted by MacL (Post 2751244)
It did not work again. problem was in main code. But thanks chief, you lovely american.

Any time, sport.


All times are GMT -4. The time now is 11:04.

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