Last active
December 28, 2024 04:03
-
-
Save Rainyan/cb37490b73560e7989c4d90ce91ccf6c to your computer and use it in GitHub Desktop.
Hit groups test for Neotokyo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <sourcemod> | |
| #include <sdkhooks> | |
| #pragma semicolon 1 | |
| #pragma newdecls required | |
| enum HitGroup { | |
| Generic = 0, | |
| Head, | |
| Chest, | |
| Stomach, | |
| LeftArm, | |
| RightArm, | |
| LeftLeg, | |
| RightLeg, | |
| Gear, | |
| NumHitGroups | |
| } | |
| char hitgroups[NumHitGroups][] = { | |
| "Generic", | |
| "Head", | |
| "Chest", | |
| "Stomach", | |
| "LeftArm", | |
| "RightArm", | |
| "LeftLeg", | |
| "RightLeg", | |
| "Gear", | |
| }; | |
| public Action OnTakeDamage(int victim, int& attacker, int& inflictor, float& damage, int& damagetype) | |
| { | |
| int hg = GetEntProp(victim, Prop_Data, "m_LastHitGroup"); | |
| PrintToServer("Hit: %d (%s)", hg, hitgroups[hg]); | |
| return Plugin_Continue; | |
| } | |
| public void OnClientPutInServer(int client) | |
| { | |
| if (!SDKHookEx(client, SDKHook_OnTakeDamage, OnTakeDamage)) | |
| { | |
| SetFailState("SDK Hook failed"); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment