#include <sourcemod>
#include <tf2>
#include <freak_fortress_2>
#pragma semicolon 1
int saxtonclientid = -1;
int saxtonhealth = -1;
public OnPluginStart()
{
HookEvent("player_death", Event_Playerdeath);
HookEvent("arena_win_panel", Event_ArenaWin);
}
public Action Event_Playerdeath(Event event, const char[] name, bool dontBroadcast)
{
int useridhale = 0;
saxtonclientid = GetClientOfUserId(useridhale);
if (saxtonclientid == -1 || IsPlayerAlive(saxtonclientid) == false || IsClientInGame(saxtonclientid) == false)
{
return Plugin_Handled;
}
saxtonhealth = GetClientHealth(saxtonclientid);
if (saxtonhealth <= 10000)
{
TF2_AddCondition(saxtonclientid, TFCond_SpeedBuffAlly, TFCondDuration_Infinite, 0);
PrintToChatAll("The boss has been given a speed boost!");
return Plugin_Handled;
}
return Plugin_Handled;
}
public Action Event_ArenaWin(Event event, const char[] name, bool dontBroadcast)
{
TF2_RemoveCondition(saxtonclientid, TFCond_SpeedBuffAlly);
return Plugin_Handled;
}
Ok, so what this does is basically when hale's health goes below 10,000 he gets a speed boost (like from the Disciplinary Action). This isn't necessarily going to be implemented, and I don't even know if it works (it should, but I don't have any experience to tell you that this will work).
It probably won't even work on a game level, with this being a practical nightmare for players going against hale. It's just a test to see if I can code for VSH.
Any critiques would be helpful.
I think, I THINK, it would work though.
#include <tf2>
#include <freak_fortress_2>
#pragma semicolon 1
int saxtonclientid = -1;
int saxtonhealth = -1;
public OnPluginStart()
{
HookEvent("player_death", Event_Playerdeath);
HookEvent("arena_win_panel", Event_ArenaWin);
}
public Action Event_Playerdeath(Event event, const char[] name, bool dontBroadcast)
{
int useridhale = 0;
saxtonclientid = GetClientOfUserId(useridhale);
if (saxtonclientid == -1 || IsPlayerAlive(saxtonclientid) == false || IsClientInGame(saxtonclientid) == false)
{
return Plugin_Handled;
}
saxtonhealth = GetClientHealth(saxtonclientid);
if (saxtonhealth <= 10000)
{
TF2_AddCondition(saxtonclientid, TFCond_SpeedBuffAlly, TFCondDuration_Infinite, 0);
PrintToChatAll("The boss has been given a speed boost!");
return Plugin_Handled;
}
return Plugin_Handled;
}
public Action Event_ArenaWin(Event event, const char[] name, bool dontBroadcast)
{
TF2_RemoveCondition(saxtonclientid, TFCond_SpeedBuffAlly);
return Plugin_Handled;
}
Ok, so what this does is basically when hale's health goes below 10,000 he gets a speed boost (like from the Disciplinary Action). This isn't necessarily going to be implemented, and I don't even know if it works (it should, but I don't have any experience to tell you that this will work).
It probably won't even work on a game level, with this being a practical nightmare for players going against hale. It's just a test to see if I can code for VSH.
Any critiques would be helpful.
I think, I THINK, it would work though.