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

TF2 add metal to upgraded buildings + change time


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rushy
AlliedModders Donor
Join Date: Jul 2015
Location: Melbourne, Australia
Old 07-01-2017 , 06:32   TF2 add metal to upgraded buildings + change time
Reply With Quote #1

I am having some issues getting code to work to buildings which are upgraded in tf2, by adding metal to the upgrade.

The part where it is first built works fine, adds the 100 metal. But on upgraded nothing happens apart from the 'test' message and nothing in console.

On a side note, does anyone know which entprop value to change for build time?

Code:
public OnPluginStart()
{
HookEvent("player_builtobject", event_playerbuilt, EventHookMode_Post);
HookEvent("player_upgradedobject", event_playerbuiltupgrade, EventHookMode_Post);
}
public Action:event_playerbuilt(Handle:event, const String:name[], bool:dontBroadcast)
{
	new obj_built = GetEventInt(event, "index");
	SetEntProp(obj_built, Prop_Send, "m_iUpgradeMetal", 100);
        return Plugin_Continue;
}

public Action:event_playerbuiltupgrade(Handle:event, const String:name[], bool:dontBroadcast)
{
	new obj_built2 = GetEventInt(event, "index");	
	SetEntProp(obj_built2, Prop_Send, "m_iUpgradeMetal", 100);
	PrintCenterTextAll("test");
        return Plugin_Continue;
}
__________________

Last edited by Rushy; 07-01-2017 at 06:36.
Rushy 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 19:37.


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