|
Great Tester of Whatever
|
04-03-2021
, 21:13
Re: [L4D2] Scripted HUD [v1.0.1 | 13-March-2021]
|
#8
|
I'm not sure it will help but it's worth a try
Spoiler
PHP Code:
#pragma semicolon 1
#pragma newdecls required
#include <sourcemod>
#include <sdktools>
int g_iOffset;
Address g_pGameRules;
public void OnPluginStart()
{
g_iOffset = FindSendPropInfo("CTerrorGameRulesProxy", "m_szScriptedHUDStringSet");
GetGameRulesPtr();
}
public void OnGameFrame()
{
static const char str[] = "txt";
for (int idx = 0; idx < 15; idx++)
{
GameRules_SetProp("m_iScriptedHUDFlags", 8512, _, idx);
GameRules_SetPropFloat("m_fScriptedHUDPosX", 0.750000 * idx / 10.0, idx);
GameRules_SetPropFloat("m_fScriptedHUDPosY", 0.349999 * idx / 10.0, idx);
GameRules_SetPropFloat("m_fScriptedHUDWidth", 1.500000 * idx / 10.0, idx);
GameRules_SetPropFloat("m_fScriptedHUDHeight", 0.026000 * idx / 10.0, idx);
StoreToAddressStr(LoadFromAddress(g_pGameRules, NumberType_Int32) + g_iOffset + (idx * 128), str, sizeof str);
}
}
void StoreToAddressStr (Address ptr, const char[] source, const int len)
{
for (int i; i < len; i++)
{
StoreToAddress(ptr + i, view_as<int>(source[i]), NumberType_Int8);
}
}
void GetGameRulesPtr() { GameData date = new GameData("gamerules"); g_pGameRules = date.GetAddress("gamerules"); delete date; }
PHP Code:
"Games"
{
"left4dead2"
{
"Addresses"
{
"gamerules"
{
"signature" "gamerules"
"read" "1"
}
}
"Signatures"
{
"gamerules"
{
"library" "server"
"windows" "\xA1\x2A\x2A\x2A\x2A\x57\x8B\xF9\x85\xC0"
"linux" "@_ZL19map_showspawnpointsRK8CCommand"
}
}
}
}
__________________
|
|
|
|