Raised This Month: $12 Target: $400
 3% 

[TF2] Changing ammopacks and healthkit models


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ShadowMarioBR
Member
Join Date: Feb 2018
Old 12-22-2018 , 19:55   [TF2] Changing ammopacks and healthkit models
Reply With Quote #1

I tried using OnEntityCreated to change the models, didn't worked.
Then i tried using OnEntityCreated to hook SpawnPost to change the models.
And lastly, i tried using OnEntityCreated to hook RequestFrame, but it only worked partially (only ammopacks dropped by players and sandviches would have models changed)
Anyone could help me with this question?
ShadowMarioBR is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 12-22-2018 , 21:02   Re: [TF2] Changing ammopacks and healthkit models
Reply With Quote #2

Since Pyrovision became a thing in 2012 or so, medkits and ammo boxes have their models overriden on the client side.

Having said that, you can change the powerup_model keyvalue (or m_iszModel datamap) to override this behavior and force all players to see a specific model.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
ShadowMarioBR
Member
Join Date: Feb 2018
Old 12-23-2018 , 12:41   Re: [TF2] Changing ammopacks and healthkit models
Reply With Quote #3

How exactly can i change m_iszModel? I tried finding it in the netprops list but couldn't find it...
ShadowMarioBR is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 12-23-2018 , 15:34   Re: [TF2] Changing ammopacks and healthkit models
Reply With Quote #4

Quote:
Originally Posted by ShadowMarioBR View Post
How exactly can i change m_iszModel? I tried finding it in the netprops list but couldn't find it...
Quote:
Originally Posted by Powerlord View Post
Since Pyrovision became a thing in 2012 or so, medkits and ammo boxes have their models overriden on the client side.

Having said that, you can change the powerup_model keyvalue (or m_iszModel datamap) to override this behavior and force all players to see a specific model.
i.e. use DispatchKeyValue to set it or SetEntPropString with Prop_Data as the second argument
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 12-23-2018 at 15:37.
Powerlord is offline
ShadowMarioBR
Member
Join Date: Feb 2018
Old 12-23-2018 , 17:13   Re: [TF2] Changing ammopacks and healthkit models
Reply With Quote #5

I tried using SetEntPropString(entity, Prop_Data, "m_iszModel", giftModel); but it said that m_iszModel don't exist.

Then i tried this:
Code:
public void OnEntityCreated(int entity, const char[] classname)
{
	if(GetConVarBool(cvarHp)) if(StrContains(classname, "item_healthkit") != -1) SDKHook(entity, SDKHook_SpawnPost, HealthKit_Change);
	
	if(GetConVarBool(cvarMetal)) if(StrContains(classname, "item_ammopack") != -1 || StrEqual(classname, "tf_ammo_pack")) SDKHook(entity, SDKHook_SpawnPost, AmmoPack_Change);
}

public void HealthKit_Change(int entity)
{
	if(IsValidEntity(entity)) DispatchKeyValue(entity, "powerup_model", giftFest);
}

public void AmmoPack_Change(int entity)
{
	if(IsValidEntity(entity)) DispatchKeyValue(entity, "powerup_model", giftModel);
}
but it just does nothing.
ShadowMarioBR is offline
ThatKidWhoGames
Veteran Member
Join Date: Jun 2013
Location: IsValidClient()
Old 12-24-2018 , 21:11   Re: [TF2] Changing ammopacks and healthkit models
Reply With Quote #6

Check out this plugin, it might help you: https://forums.alliedmods.net/showthread.php?p=2416912
ThatKidWhoGames is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-25-2018 , 00:53   Re: [TF2] Changing ammopacks and healthkit models
Reply With Quote #7

...you can do this with Stripper

*edit
https://forums.alliedmods.net/showpo...3&postcount=11
__________________
Do not Private Message @me

Last edited by Bacardi; 12-25-2018 at 00:59.
Bacardi is offline
Reply


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 14:54.


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