View Single Post
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