forked from Pelipoika/The-unfinished-and-abandoned
-
Notifications
You must be signed in to change notification settings - Fork 0
/
UtilsExtGaveMeAids.sp
48 lines (40 loc) · 2.02 KB
/
UtilsExtGaveMeAids.sp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <sdktools>
#pragma newdecls required
public Plugin myinfo =
{
name = "[TF2] ",
author = "Pelipoika",
description = "",
version = "1.0",
url = "http://www.sourcemod.net/plugins.php?author=Pelipoika&search=1"
};
Handle g_hLookupBone;
Handle g_hGetBonePosition;
public void OnPluginStart()
{
//CBaseAnimating::LookupBone( const char *szName )
StartPrepSDKCall(SDKCall_Entity);
PrepSDKCall_SetSignature(SDKLibrary_Server, "\x55\x8B\xEC\x56\x8B\xF1\x80\xBE\x41\x03\x00\x00\x00\x75\x2A\x83\xBE\x6C\x04\x00\x00\x00\x75\x2A\xE8\x2A\x2A\x2A\x2A\x85\xC0\x74\x2A\x8B\xCE\xE8\x2A\x2A\x2A\x2A\x8B\x86\x6C\x04\x00\x00\x85\xC0\x74\x2A\x83\x38\x00\x74\x2A\xFF\x75\x08\x50\xE8\x2A\x2A\x2A\x2A\x83\xC4\x08\x5E", 68);
PrepSDKCall_AddParameter(SDKType_String, SDKPass_Pointer);
PrepSDKCall_SetReturnInfo(SDKType_PlainOldData, SDKPass_Plain);
if ((g_hLookupBone = EndPrepSDKCall()) == INVALID_HANDLE) SetFailState("Failed to create SDKCall for CBaseAnimating::LookupBone signature!");
//void CBaseAnimating::GetBonePosition ( int iBone, Vector &origin, QAngle &angles )
StartPrepSDKCall(SDKCall_Entity);
PrepSDKCall_SetSignature(SDKLibrary_Server, "\x55\x8B\xEC\x83\xEC\x30\x56\x8B\xF1\x80\xBE\x41\x03\x00\x00\x00", 16);
PrepSDKCall_AddParameter(SDKType_PlainOldData, SDKPass_Plain);
PrepSDKCall_AddParameter(SDKType_Vector, SDKPass_ByRef, _, VENCODE_FLAG_COPYBACK);
PrepSDKCall_AddParameter(SDKType_QAngle, SDKPass_ByRef, _, VENCODE_FLAG_COPYBACK);
if ((g_hGetBonePosition = EndPrepSDKCall()) == INVALID_HANDLE) SetFailState("Failed to create SDKCall for CBaseAnimating::GetBonePosition signature!");
for (int i = 1; i <= MaxClients; i++)
{
if(IsClientInGame(i))
{
int iBone = SDKCall(g_hLookupBone, i, "weapon_bone");
if(iBone == -1)
continue;
float origin[3], angles[3];
SDKCall(g_hGetBonePosition, i, iBone, origin, angles);
PrintToChatAll("%N bone %i origin %f %f %f angles %f %f %f", i, iBone, origin[0], origin[1], origin[2], angles[0], angles[1], angles[2]);
}
}
}