Raised This Month: $12 Target: $400
 3% 

Suicide Event


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MacL
Member
Join Date: May 2021
Old 06-25-2021 , 14:44   Suicide Event
Reply With Quote #1

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.

Last edited by MacL; 06-25-2021 at 14:45.
MacL is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-25-2021 , 15:12   Re: Suicide Event
Reply With Quote #2

For fall suicide, attacker = 0, IIRC
__________________
Bugsy is offline
MacL
Member
Join Date: May 2021
Old 06-26-2021 , 06:39   Re: Suicide Event
Reply With Quote #3

Quote:
Originally Posted by Bugsy View Post
For fall suicide, attacker = 0, IIRC
Worked once. But after that nope.
MacL is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-26-2021 , 10:24   Re: Suicide Event
Reply With Quote #4

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." );
    }

__________________

Last edited by Bugsy; 06-26-2021 at 10:25.
Bugsy is offline
MacL
Member
Join Date: May 2021
Old 06-26-2021 , 17:56   Re: Suicide Event
Reply With Quote #5

Quote:
Originally Posted by Bugsy View Post
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.
MacL is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-26-2021 , 20:19   Re: Suicide Event
Reply With Quote #6

Quote:
Originally Posted by MacL View Post
It did not work again. problem was in main code. But thanks chief, you lovely american.
Any time, sport.
__________________
Bugsy is offline
Reply


Thread Tools
Display Modes

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 14:50.


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