Raised This Month: $ Target: $400
 0% 

Molotov w_ model problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
BeNq!
Senior Member
Join Date: Mar 2009
Old 11-06-2021 , 12:38   Molotov w_ model problem
Reply With Quote #1

Hello,

I have a problem with the molotov w_ model. I'm used this code:

Code:
public void OnEntityCreated( int entity, const char[] classname )
{
	if( IsValidEntity( entity ) ) 
		SDKHook( entity, SDKHook_SpawnPost, OnEntitySpawned );
}

public void OnEntitySpawned( int entity )
{
	char class_name[ 64 ];
	GetEntityClassname( entity, class_name, 64 );
	
	int owner = GetEntPropEnt( entity, Prop_Data, "m_hOwnerEntity" );
	
	if( StrContains( class_name, "projectile" ) != -1 && IsValidEntity( entity ) && IsValidClient( owner ) )
	{
		if( StrContains( class_name, "hegrenade" ) != -1 )
		{			
			SetEntityModel( entity, "models/testmodel/w_red.mdl" );
			PrintToChatAll( "test red %i", entity );
		}
		else if( StrContains( class_name, "decoy" ) != -1 )
		{
			SetEntityModel( entity, "models/testmodel/w_blue.mdl" );
		}
		else if( StrContains( class_name, "incgrenade" ) != -1 )
		{
			SetEntityModel( entity, "models/testmodel/w_orange.mdl");
			PrintToChatAll( "test orange %i", entity );
		}
		
		else if( StrContains( class_name, "molotov" ) != -1 )
		{
			SetEntityModel( entity, "models/testmodel/w_yellow.mdl");
			PrintToChatAll( "test yellow %i", entity );
		}
	}
}
What's problem? Grenade i.e. hegren and decoy works ( model works ) but incegrenade and molotov is showing original model ( models don't change ). Where did I go wrong? Maybe it is impossible to change the model of incendiary grenades?
BeNq! is offline
 


Thread Tools
Display Modes

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 10:07.


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