Raised This Month: $ Target: $400
 0% 

Solved (HELP) Detect self grenade kill


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 06-07-2018 , 14:09   Re: (HELP) Detect self grenade kill
Reply With Quote #1

Quote:
Originally Posted by instinctpt1 View Post
Yes its possible, here it is :

PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin("Self Nade Kill""1.0""DiGiTaL")
    
register_event("DeathMsg""onDeathMsgEvent""a");
}

public 
onDeathMsgEvent()
{
    new 
id read_data(2)
    new 
szWeapon[32];
    
read_data(4szWeaponcharsmax(szWeapon));
    if(
equal(szWeapon"grenade"))
        
client_print(idprint_chat"Self Nade kill xD")

where is the part that check for the killer and victim? LOL

PHP Code:
#include <amxmodx>
#include <csx>
#include <cstrike>

public plugin_init()
{
    
register_plugin("AL AKHBAR","0.0.1","SmileY");
}

public 
client_death(Killer,Victim,WeaponId,HitPlace,TK)
{
    if(
Killer == Victim && WeaponId == CSW_HEGRENADE)
    {
        new 
Name[32];
        
get_user_name(Victim,Name,charsmax(Name));

        
client_print(0,print_chat,"%s says: AL AKHBAR",Name);
    }

Not Tested
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 06-07-2018 at 14:13. Reason: Name
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Question x Mark
Junior Member
Join Date: May 2018
Old 06-07-2018 , 14:13   Re: (HELP) Detect self grenade kill
Reply With Quote #2

Quote:
Originally Posted by ^SmileY View Post
where is the part that check for the killer and victim? LOL

PHP Code:
#include <amxmodx>
#include <csx>
#include <cstrike>

public plugin_init()
{
    
register_plugin("AL AKHBAR","0.0.1","SmileY");
}

public 
client_death(Killer,Victim,WeaponId,HitPlace,TK)
{
    if(
Killer == Victim && WeaponId == CSW_HEGRENADE)
    {
        new 
Name[32];
        
get_user_name(Victim,Name,charsmax(Name));

        
client_print(0,print_chat,"%s says: AL AKHBAR");
    }

Not Tested
I already said that I want to use it with DeathMsg
Question x Mark is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 06-07-2018 , 14:16   Re: (HELP) Detect self grenade kill
Reply With Quote #3

Quote:
Originally Posted by Question x Mark View Post
I already said that I want to use it with DeathMsg
Why only with DeathMsg?

anyway is here

PHP Code:
#include <amxmodx>
#include <cstrike>

public plugin_init()
{
    
register_plugin("Self Detonate Check","0.0.1","SmileY");

    
register_event("DeathMsg","DeathMsg","a");
}

public 
DeathMsg()
{
    new 
Killer read_data(1);
    new 
Victim read_data(2);

    if(
Killer == Victim && get_user_weapon(Killer) == CSW_HEGRENADE)
    {
        new 
Name[32];
        
get_user_name(Victim,Name,charsmax(Name));

        
client_print(0,print_chat,"%s says: AL AKHBAR",Name);
    }

Ps. using csx will use less natives call
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 06-07-2018 at 14:19.
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
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 04:40.


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