diff --git a/plugins/l4d2_hats.smx b/plugins/l4d2_hats.smx index b7be2b9..92224d2 100644 Binary files a/plugins/l4d2_hats.smx and b/plugins/l4d2_hats.smx differ diff --git a/scripting/include/hats/hats.sp b/scripting/include/hats/hats.sp index e51ef96..1c93451 100644 --- a/scripting/include/hats/hats.sp +++ b/scripting/include/hats/hats.sp @@ -336,7 +336,6 @@ Action Command_DoAHat(int client, int args) { // Find a new hatable entity int flags = 0; if(args > 0 && isForced) { - char arg[16]; entity = GetCmdArgInt(1); } else { entity = GetLookingEntity(client, Filter_ValidHats); @@ -814,10 +813,6 @@ void EquipHat(int client, int entity, const char[] classname = "", int flags = H SetParentAttachment(modifyEntity, attachPoint, true); } - if(HasFlag(client, HAT_COMMANDABLE)) { - ChooseRandomPosition(hatData[client].offset); - L4D2_CommandABot(entity, client, BOT_CMD_MOVE, hatData[client].offset); - } } else { SetParent(entity, client); SetParentAttachment(modifyEntity, attachPoint, true); diff --git a/scripting/l4d2_hats.sp b/scripting/l4d2_hats.sp index 13020f4..63b775b 100644 --- a/scripting/l4d2_hats.sp +++ b/scripting/l4d2_hats.sp @@ -15,6 +15,7 @@ static float EMPTY_ANG[3] = { 0.0, 0.0, 0.0 }; #include #include #include +#include #include @@ -48,7 +49,6 @@ public Plugin myinfo = { url = "https://github.com/Jackzmc/sourcemod-plugins" }; -ArrayList NavAreas; public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max) { return APLRes_Success; } @@ -343,10 +343,10 @@ void Event_PlayerOutOfIdle(Event event, const char[] name, bool dontBroadcast) { void Frame_FixClient(int client) { if(IsClientConnected(client) && GetClientTeam(client) == 2) { - ClearParent(client); - SetEntProp(client, Prop_Send, "m_CollisionGroup", 5); - SetEntProp(client, Prop_Send, "m_nSolidType", 2); - SetEntityMoveType(client, MOVETYPE_WALK); + ClearParent(client); + SetEntProp(client, Prop_Send, "m_CollisionGroup", 5); + SetEntProp(client, Prop_Send, "m_nSolidType", 2); + SetEntityMoveType(client, MOVETYPE_WALK); } // SetEntProp(client, Prop_Send, "movetype", MOVETYPE_ISOMETRIC); } @@ -574,12 +574,21 @@ public void OnMapStart() { tempGod[i] = false; } GetCurrentMap(g_currentMap, sizeof(g_currentMap)); - NavAreas = GetSpawnLocations(); +} + +stock bool L4D_IsPlayerCapped(int client) { + if(GetEntPropEnt(client, Prop_Send, "m_pummelAttacker") > 0 || + GetEntPropEnt(client, Prop_Send, "m_carryAttacker") > 0 || + GetEntPropEnt(client, Prop_Send, "m_pounceAttacker") > 0 || + GetEntPropEnt(client, Prop_Send, "m_jockeyAttacker") > 0 || + GetEntPropEnt(client, Prop_Send, "m_pounceAttacker") > 0 || + GetEntPropEnt(client, Prop_Send, "m_tongueOwner") > 0) + return true; + return false; } public void OnMapEnd() { - delete NavAreas; ClearHats(); } public void OnPluginEnd() {