AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Just Loking for a Plugin (https://forums.alliedmods.net/showthread.php?t=342238)

QuickDroLLL 03-20-2023 16:20

Just Loking for a Plugin
 
Hello Every one QuickDroLLL, so basicly iam loking for plugin that make the he grenade when it tuch the ground it will explode directly i know there is plugin name Nade Modes but iam loking for plugin do that only you can say specify plugin sorry for my bad english and yeah hope any one find or create it to me bcz iam loking for it so much in my server done :)

Naeciof 03-21-2023 10:28

Re: Just Loking for a Plugin
 
Try this
PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

new amxx_touch_explode_he
new amxx_touch_explode_fb
new amxx_touch_explode_sg

public plugin_init()
{
    
register_plugin("PLUGIN""VERSION""AUTHOR")
    
    
amxx_touch_explode_he register_cvar("amxx_touch_explode_he","1")
    
amxx_touch_explode_fb register_cvar("amxx_touch_explode_fb","1")
    
amxx_touch_explode_sg register_cvar("amxx_touch_explode_sg","1")
    
    
RegisterHam(Ham_Touch,"grenade","cmd_touch")
}

public 
cmd_touch(this)
{
    new 
cvar;
    switch(
Get_Grenade_Type(thisfalse))
    {
        case 
CSW_HEGRENADE:    cvar amxx_touch_explode_he;
        case 
CSW_FLASHBANG:    cvar amxx_touch_explode_fb;
        case 
CSW_SMOKEGRENADEcvar amxx_touch_explode_sg;
    }
    
    if(
cvar && get_pcvar_num(cvar))
    {
        
set_pev(thispev_dmgtime0.0)
    }
}

Get_Grenade_Typeentbool:bCheckClass true 
{
    const 
m_bIsC4 385;
    const 
m_usEvent_Grenade 228;
    
    if( 
bCheckClass 
    { 
        new class[
9
        
pev(entpev_classname, class, charsmax(class)) 
        if( !
equal(class, "grenade") ) 
        { 
            return 

        

    } 

    if( 
get_pdata_bool(entm_bIsC4) ) 
    { 
        return 
CSW_C4 
    


    new 
usEvent get_pdata_int(entm_usEvent_Grenade
    if( !
usEvent 
    { 
        return 
CSW_FLASHBANG 
    


    static 
m_usHgrenExplom_usSmokeExplo 
    
if( !m_usHgrenExplo 
    { 
        
m_usHgrenExplo engfunc(EngFunc_PrecacheEvent1"events/createexplo.sc"
        
m_usSmokeExplo engfunc(EngFunc_PrecacheEvent1"events/createsmoke.sc"
    } 

    return 
usEvent == m_usHgrenExplo CSW_HEGRENADE CSW_SMOKEGRENADE 
}

#define SHORT_BYTES      2
#define INT_BYTES        4 
#define BYTE_BITS        8 

stock bool:get_pdata_bool(entcharbased_offsetintbase_linuxdiff 5

    return !!( 
get_pdata_int(entcharbased_offset INT_BYTESintbase_linuxdiff) & (0xFF<<((charbased_offset INT_BYTES) * BYTE_BITS)) ) 
}

stock get_pdata_short(entshortbased_offsetintbase_linuxdiff 5

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



QuickDroLLL 03-21-2023 12:51

Re: Just Loking for a Plugin
 
Quote:

Originally Posted by Naeciof (Post 2801603)
Try this
PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

new amxx_touch_explode_he
new amxx_touch_explode_fb
new amxx_touch_explode_sg

public plugin_init()
{
    
register_plugin("PLUGIN""VERSION""AUTHOR")
    
    
amxx_touch_explode_he register_cvar("amxx_touch_explode_he","1")
    
amxx_touch_explode_fb register_cvar("amxx_touch_explode_fb","1")
    
amxx_touch_explode_sg register_cvar("amxx_touch_explode_sg","1")
    
    
RegisterHam(Ham_Touch,"grenade","cmd_touch")
}

public 
cmd_touch(this)
{
    new 
cvar;
    switch(
Get_Grenade_Type(thisfalse))
    {
        case 
CSW_HEGRENADE:    cvar amxx_touch_explode_he;
        case 
CSW_FLASHBANG:    cvar amxx_touch_explode_fb;
        case 
CSW_SMOKEGRENADEcvar amxx_touch_explode_sg;
    }
    
    if(
cvar && get_pcvar_num(cvar))
    {
        
set_pev(thispev_dmgtime0.0)
    }
}

Get_Grenade_Typeentbool:bCheckClass true 
{
    const 
m_bIsC4 385;
    const 
m_usEvent_Grenade 228;
    
    if( 
bCheckClass 
    { 
        new class[
9
        
pev(entpev_classname, class, charsmax(class)) 
        if( !
equal(class, "grenade") ) 
        { 
            return 

        

    } 

    if( 
get_pdata_bool(entm_bIsC4) ) 
    { 
        return 
CSW_C4 
    


    new 
usEvent get_pdata_int(entm_usEvent_Grenade
    if( !
usEvent 
    { 
        return 
CSW_FLASHBANG 
    


    static 
m_usHgrenExplom_usSmokeExplo 
    
if( !m_usHgrenExplo 
    { 
        
m_usHgrenExplo engfunc(EngFunc_PrecacheEvent1"events/createexplo.sc"
        
m_usSmokeExplo engfunc(EngFunc_PrecacheEvent1"events/createsmoke.sc"
    } 

    return 
usEvent == m_usHgrenExplo CSW_HEGRENADE CSW_SMOKEGRENADE 
}

#define SHORT_BYTES      2
#define INT_BYTES        4 
#define BYTE_BITS        8 

stock bool:get_pdata_bool(entcharbased_offsetintbase_linuxdiff 5

    return !!( 
get_pdata_int(entcharbased_offset INT_BYTESintbase_linuxdiff) & (0xFF<<((charbased_offset INT_BYTES) * BYTE_BITS)) ) 
}

stock get_pdata_short(entshortbased_offsetintbase_linuxdiff 5

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



its working thank you very much <3


All times are GMT -4. The time now is 07:13.

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