Raised This Month: $ Target: $400
 0% 

[Help] CS1.6: Get nade type in Ham_Spawn forward.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 09-19-2013 , 04:11   [Help] CS1.6: Get nade type in Ham_Spawn forward.
Reply With Quote #1

Hi, i tried to get grenade type in Ham_Spawn forward but the it seem my method is not correct:
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <engine>

public plugin_init()
{
    
register_plugin("HamGrenadeTrail""0.0.1""wbyokomo")
    
    
RegisterHam(Ham_Spawn"grenade""OnSpawnGrenade"1)
}

public 
OnSpawnGrenade(ent)
{
    new 
szModel[32]
    
entity_get_string(entEV_SZ_modelszModel31)
    
client_print(0print_chat"[NADE] Model: %s"szModel)

I use:
PHP Code:
    entity_get_string(entEV_SZ_modelszModel31)
    
client_print(0print_chat"[NADE] Model: %s"szModel
to get grenade model, but the result is always: weapons/grenade.mdl. Why not it print "weapons/w_hegrenade.mdl" or "weapons/w_flashbang.mdl" ?
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 09-19-2013 , 04:22   Re: [Help] CS1.6: Get nade type in Ham_Spawn forward.
Reply With Quote #2

Quote:
Originally Posted by yokomo View Post
Hi, i tried to get grenade type in Ham_Spawn forward but the it seem my method is not correct:
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <engine>

public plugin_init()
{
    
register_plugin("HamGrenadeTrail""0.0.1""wbyokomo")
    
    
RegisterHam(Ham_Spawn"grenade""OnSpawnGrenade"1)
}

public 
OnSpawnGrenade(ent)
{
    new 
szModel[32]
    
entity_get_string(entEV_SZ_modelszModel31)
    
client_print(0print_chat"[NADE] Model: %s"szModel)

I use:
PHP Code:
    entity_get_string(entEV_SZ_modelszModel31)
    
client_print(0print_chat"[NADE] Model: %s"szModel
to get grenade model, but the result is always: weapons/grenade.mdl. Why not it print "weapons/w_hegrenade.mdl" or "weapons/w_flashbang.mdl" ?
1. Use FM_SetModel
2. Because it's grenade, just a grenade.
__________________
simanovich is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 09-19-2013 , 06:42   Re: [Help] CS1.6: Get nade type in Ham_Spawn forward.
Reply With Quote #3

If you need to determine grenade type use this stocks. Search for misc stocks.
__________________


Last edited by NiHiLaNTh; 09-19-2013 at 06:43.
NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 09-19-2013 , 08:21   Re: [Help] CS1.6: Get nade type in Ham_Spawn forward.
Reply With Quote #4

Quote:
Originally Posted by NiHiLaNTh View Post
If you need to determine grenade type use this stocks. Search for misc stocks.
Cool found it:
PHP Code:
GetGrenadeTypeentbool:bCheckClass true 

    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_short(entm_usEvent_Grenade
    if( !
usEvent 
    { 
        return 
CSW_FLASHBANG 
    


    static 
m_usHgrenExplo // , m_usSmokeExplo 
    
if( !m_usHgrenExplo 
    { 
        
m_usHgrenExplo engfunc(EngFunc_PrecacheEvent1"events/createexplo.sc"
        
// m_usSmokeExplo = engfunc(EngFunc_PrecacheEvent, 1, "events/createsmoke.sc") 
    


    return 
usEvent == m_usHgrenExplo CSW_HEGRENADE CSW_SMOKEGRENADE 

Sorry i don't want FM_SetModel, it called too much.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 06-18-2014 , 08:41   Re: [Help] CS1.6: Get nade type in Ham_Spawn forward.
Reply With Quote #5

Bring back my old post.

Ok now i want to know is there any forward instead of "FM_SetModel" so we can get the grenade owner id? "FM_SetModel" call to often. It would be better if it can be done with Orpheu since i'm using Orpheu on server.

Thanks.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 06-18-2014 , 09:44   Re: [Help] CS1.6: Get nade type in Ham_Spawn forward.
Reply With Quote #6

grenade_throw from csx
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
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 18:49.


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