Raised This Month: $ Target: $400
 0% 

[ HELP ] Work with grenades?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Depresie
Veteran Member
Join Date: Nov 2013
Old 02-22-2017 , 18:27   Re: [ HELP ] Work with grenades?
Reply With Quote #10

You could also detect grenade launching using FM_SetModel, check there for w_grenade model then check the classname of the entity not to be a weaponbox

PHP Code:
register_forward(FM_SetModel"fw_SetModel")

public 
fw_SetModel(iEntity, const szModel[])
{
    if(!
pev_valid(iEntity))
        return 
FMRES_IGNORED

    
if(strlen(szModel) < 8)
        return 
FMRES_IGNORED

    
if(szModel[7] != 'w' || szModel[8] != '_')
        return 
FMRES_IGNORED

    
if(equal(szModel"models/w_weaponbox.mdl"))
        return 
FMRES_IGNORED

    
static szClass[32]

    
entity_get_string(iEntityEV_SZ_classnameszClasscharsmax(szClass))

    if(!
equal(szClass"weaponbox"))
        return 
FMRES_IGNORED
        
        
// Grenade launched ( you can check for model to get what type of grenade it is, ex w_flashbang, w_smokegrenade, w_hegrenade 
__________________
Depresie is offline
 



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 20:42.


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