Raised This Month: $32 Target: $400
 8% 

[REQ] Grenade explodes when touch player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xairgeo
Member
Join Date: Oct 2014
Old 09-21-2018 , 03:45   [REQ] Grenade explodes when touch player
Reply With Quote #1

I need a impact grenade plugin that immediately explodes when it hits another player after its thrown, but not when it hits the ground.

Last edited by xairgeo; 09-21-2018 at 04:04.
xairgeo is offline
shauli
Member
Join Date: Jun 2018
Old 09-21-2018 , 05:10   Re: [REQ] Grenade explodes when touch player
Reply With Quote #2

https://forums.alliedmods.net/showpo...85&postcount=5
https://forums.alliedmods.net/showthread.php?t=75322
shauli is offline
xairgeo
Member
Join Date: Oct 2014
Old 09-21-2018 , 10:10   Re: [REQ] Grenade explodes when touch player
Reply With Quote #3

I need it to impact only when it hits another play not when it touches other objects.
xairgeo is offline
generalmemer
Member
Join Date: Sep 2017
Old 09-21-2018 , 10:35   Re: [REQ] Grenade explodes when touch player
Reply With Quote #4

Quote:
Originally Posted by xairgeo View Post
I need it to impact only when it hits another play not when it touches other objects.
PHP Code:
#include < amxmodx >
#include < hamsandwich >
#include < fakemeta >

#define PLUGIN  "Nade explode on touch"
#define VERSION "0.1"
#define AUTHOR  "HamletEagle"

const m_usEvent 228 
const SHORT_BYTES 
const BYTE_BITS 

new m_usHeGrenade

public plugin_precache( )
{
    
m_usHeGrenade engfuncEngFunc_PrecacheEvent1"events/createexplo.sc" )    
}

public 
plugin_init( )
{
    
register_plugin
    
(
        .
plugin_name PLUGIN,
        .
version     VERSION,
        .
author      AUTHOR
    
)
    
    
RegisterHamHam_Touch"grenade""CGrenade_Touch" )
}

public 
CGrenade_TouchiTouchediToucher )
{
    static 
szClassName20 ]; peviTouchedpev_classnameszClassNamecharsmaxszClassName ) )
    
    if( 
equalszClassName"grenade" ) && is_user_connectediToucher ) )
    {
        static 
usEventusEvent get_pdata_shortiTouchedm_usEvent )
        
        if( !
usEvent || usEvent == m_usHeGrenade )
        {
            
set_peviTouchedpev_dmgtime0.0 )
        }
    }
}

stock get_pdata_short(entshortbased_offsetintbase_linuxdiff 5

    return ( 
get_pdata_int(entshortbased_offset SHORT_BYTESintbase_linuxdiff)>>>((shortbased_offset SHORT_BYTES) * BYTE_BITS) ) & 0xFFFF 

generalmemer is offline
xairgeo
Member
Join Date: Oct 2014
Old 09-21-2018 , 11:42   Re: [REQ] Grenade explodes when touch player
Reply With Quote #5

Quote:
Originally Posted by generalmemer View Post
PHP Code:
#include < amxmodx >
#include < hamsandwich >
#include < fakemeta >

#define PLUGIN  "Nade explode on touch"
#define VERSION "0.1"
#define AUTHOR  "HamletEagle"

const m_usEvent 228 
const SHORT_BYTES 
const BYTE_BITS 

new m_usHeGrenade

public plugin_precache( )
{
    
m_usHeGrenade engfuncEngFunc_PrecacheEvent1"events/createexplo.sc" )    
}

public 
plugin_init( )
{
    
register_plugin
    
(
        .
plugin_name PLUGIN,
        .
version     VERSION,
        .
author      AUTHOR
    
)
    
    
RegisterHamHam_Touch"grenade""CGrenade_Touch" )
}

public 
CGrenade_TouchiTouchediToucher )
{
    static 
szClassName20 ]; peviTouchedpev_classnameszClassNamecharsmaxszClassName ) )
    
    if( 
equalszClassName"grenade" ) && is_user_connectediToucher ) )
    {
        static 
usEventusEvent get_pdata_shortiTouchedm_usEvent )
        
        if( !
usEvent || usEvent == m_usHeGrenade )
        {
            
set_peviTouchedpev_dmgtime0.0 )
        }
    }
}

stock get_pdata_short(entshortbased_offsetintbase_linuxdiff 5

    return ( 
get_pdata_int(entshortbased_offset SHORT_BYTESintbase_linuxdiff)>>>((shortbased_offset SHORT_BYTES) * BYTE_BITS) ) & 0xFFFF 

Works perfectly thanks!
xairgeo 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 09:50.


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