Raised This Month: $ Target: $400
 0% 

Change nade model


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ezio_auditore
Senior Member
Join Date: May 2013
Old 05-10-2014 , 06:57   Change nade model
Reply With Quote #1

How can we change the grenade's model when it is thrown.
i tried hooking FM_SetModel and read the frostnade plugin too..
but didn't get anything..
can someone help?
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 05-10-2014 , 08:24   Re: Change nade model
Reply With Quote #2

csx - grenade_throw forward

PHP Code:
public grenade_throwidgreindexwId )
{
   if( 
wId == CSW_HEGRENADE )
   {
       
set_pevgreindexpev_model"models/w_grenade2.mdl" )
   }

Backstabnoob is offline
ezio_auditore
Senior Member
Join Date: May 2013
Old 05-10-2014 , 10:07   Re: Change nade model
Reply With Quote #3

not working..
__________________
ezio_auditore is offline
Send a message via Skype™ to ezio_auditore
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 05-10-2014 , 10:27   Re: Change nade model
Reply With Quote #4

Weird, maybe grenade_throw is called before SetModel so it gets overwritten but I doubt it.

Show your code.
Backstabnoob is offline
EDUTz
Senior Member
Join Date: Jun 2010
Location: Dracula's Homeland
Old 05-10-2014 , 14:56   Re: Change nade model
Reply With Quote #5

it has to be in fw_SetModel !

example from another plugin :

Code:
public fw_SetModel(entity, const model[])
{
	// We don't care
	if (strlen(model) < 8)
		return FMRES_IGNORED  
	
	// Get entity's classname
	static classname[10]
	pev(entity, pev_classname, classname, charsmax(classname))
	
	// Narrow down our matches a bit
	if (model[7] != 'w' || model[8] != '_')
		return FMRES_IGNORED  
	
	// Get damage time of grenade
	static Float:dmgtime
	pev(entity, pev_dmgtime, dmgtime)
	
	// Grenade not yet thrown
	if (dmgtime == 0.0)
		return FMRES_IGNORED  
         if (model[9] == 'h' && model[10] == 'e') 
	{
                        engfunc(EngFunc_SetModel, entity, "w_ model for the hebomb . mdl")    
                        return FMRES_SUPERCEDE  
          }
        else if (model[9] == 'f' && model[10] == 'l')
	{
                        engfunc(EngFunc_SetModel, entity, "w_ model for the flashbang . mdl")    
                        return FMRES_SUPERCEDE  
          }
        else if (model[9] == 's' && model[10] == 'm') 
	{
                        engfunc(EngFunc_SetModel, entity, "w_ model for the smoke . mdl")    
                        return FMRES_SUPERCEDE  
         }

return FMRES_IGNORED  
}

Last edited by EDUTz; 05-10-2014 at 15:04.
EDUTz 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:44.


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