View Single Post
Author Message
dacisco
Junior Member
Join Date: Aug 2018
Old 08-15-2018 , 16:17   Custom Minigun Property
Reply With Quote #1

Hi, I want to create a simple script that applies the "TFCond_SpeedBuffAlly" (Disciplinary Action) buff to Miniguns immediately when they begin to wind down. The code below passes the compiler but nothing happens in-game, despite it being properly loaded and reloaded. Any advice would be greatly appreciated, thank you.


Code:
#include <sourcemod>
#include <tf2>

public Plugin myinfo =
{
	name = "Custom Property",
	author = "dacisco",
	description = "Adds Speed Boost",
	version = "1.0",
	url = "NA"
};

public void OnPluginStart()
{
	HookEvent("localplayer_winddown", Event_LocalPlayerWindDown);
}

public void Event_LocalPlayerWindDown(Event event, const char[] name, bool dontBroadcast)
{
	 int target_id = event.GetInt("userid");
	 int target = GetClientOfUserId(target_id);
	 TF2_AddCondition(target, TFCond_SpeedBuffAlly, 2.0, 0);
}
dacisco is offline