diff --git a/plugins/l4d2_detections.smx b/plugins/l4d2_detections.smx index d8f3d74..fa6728c 100644 Binary files a/plugins/l4d2_detections.smx and b/plugins/l4d2_detections.smx differ diff --git a/scripting/l4d2_detections.sp b/scripting/l4d2_detections.sp index 0943847..7207eb3 100644 --- a/scripting/l4d2_detections.sp +++ b/scripting/l4d2_detections.sp @@ -35,7 +35,7 @@ Bile Detections: */ stock bool IsPlayerBoomed(int client) { - return GetEntPropFloat(%0, Prop_Send, "m_vomitStart") + 20.1 > GetGameTime(); + return GetEntPropFloat(client, Prop_Send, "m_vomitStart") + 20.1 > GetGameTime(); } stock bool IsAnyPlayerBoomed() { for(int i = 1; i <= MaxClients; i++) { @@ -50,7 +50,7 @@ stock bool AnyRecentBileInPlay(int ignore) { return false; } -stock int GetEntityCountNear(const float[3] srcPos, float radius = 50000.0) { +stock int GetEntityCountNear(const float srcPos[3], float radius = 50000.0) { float pos[3]; int count; int entity = -1; @@ -74,7 +74,7 @@ stock int L4D_SpawnCommonInfected2(const float vPos[3], const float vAng[3] = { return entity; } -PlayerDetections[MAXPLAYERS+1] detections; +PlayerDetections detections[MAXPLAYERS+1]; GlobalForward fwd_PlayerDoubleKit, fwd_NoHordeBileWaste, fwd_DoorFaceCloser, fwd_CheckpointDoorFaceCloser; @@ -100,6 +100,7 @@ public void OnPluginStart() { HookEvent("item_pickup", Event_ItemPickup); HookEvent("door_close", Event_DoorClose); + HookEvent("heal_success", Event_HealSuccess); } // Called on map changes too, we want this: @@ -107,7 +108,7 @@ public void OnClientDisconnect(int client) { detections[client].Reset(); } -public Action Event_ItemPickup(Event event, const char[] name, bool dontBroadcast) { +public void Event_ItemPickup(Event event, const char[] name, bool dontBroadcast) { int client = GetClientOfUserId(event.GetInt("userid")); if(client && L4D_IsInLastCheckpoint(client)) { static char itmName[32]; @@ -123,7 +124,16 @@ public Action Event_ItemPickup(Event event, const char[] name, bool dontBroadcas } } -public Action Event_DoorClose(Event event, const char[] name, bool dontBroadcast) { +public void Event_HealSuccess(Event event, const char[] name, bool dontBroadcast) { + int client = GetClientOfUserId(event.GetInt("userid")); + if(client) { + int target = GetClientOfUserId(event.GetInt("subject")); + int amount = event.GetInt("health_restored"); + PrintToConsoleAll("[Debug] %N healed %N (+%d health)", client, target, amount); + } +} + +public void Event_DoorClose(Event event, const char[] name, bool dontBroadcast) { int client = GetClientOfUserId(event.GetInt("userid")); if(fwd_DoorFaceCloser.FunctionCount > 0 && client) { bool isCheckpoint = event.GetBool("checkpoint");