mirror of
https://github.com/fedddddd/iw5-gsc-utils.git
synced 2025-07-03 09:41:51 +00:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
9ca07aca55 | |||
10b45027d0 | |||
d5c0063fee
|
@ -416,6 +416,22 @@ namespace gsc
|
||||
return {};
|
||||
});
|
||||
|
||||
method::add("isbot", [](const game::scr_entref_t ent, const function_args& args) -> scripting::script_value
|
||||
{
|
||||
if (ent.classnum != 0)
|
||||
{
|
||||
throw std::runtime_error("Invalid entity");
|
||||
}
|
||||
|
||||
const auto client = ent.entnum;
|
||||
if (game::g_entities[client].client == nullptr)
|
||||
{
|
||||
throw std::runtime_error("entity is not a player");
|
||||
}
|
||||
|
||||
return game::svs_clients[client].bIsTestClient;
|
||||
});
|
||||
|
||||
utils::hook::jump(0x56C8EB, call_builtin_stub);
|
||||
utils::hook::jump(0x56CBDC, call_builtin_method_stub);
|
||||
}
|
||||
|
@ -5,8 +5,8 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv
|
||||
{
|
||||
if (ul_reason_for_call == DLL_PROCESS_ATTACH)
|
||||
{
|
||||
const auto value = *reinterpret_cast<DWORD*>(0x20900000);
|
||||
if (value != 0xF0681B6A)
|
||||
const auto value = *reinterpret_cast<DWORD*>(0x21000000);
|
||||
if (value != 0x7AC6)
|
||||
{
|
||||
MessageBoxA(NULL,
|
||||
"This version of iw5-gsc-utils is outdated.\n" \
|
||||
|
@ -327,4 +327,15 @@ namespace game
|
||||
int flags;
|
||||
char __pad2[0xEC];
|
||||
};
|
||||
|
||||
struct client_s
|
||||
{
|
||||
char __pad0[0x41CB2];
|
||||
unsigned __int16 scriptId; // 269490
|
||||
int bIsTestClient; // 269492
|
||||
int serverId; // 269496
|
||||
char __pad1[0x369DC];
|
||||
};
|
||||
|
||||
static_assert(sizeof(client_s) == 0x78698);
|
||||
}
|
@ -79,13 +79,15 @@ namespace game
|
||||
WEAK symbol<gentity_s> g_entities{0x1A66E28};
|
||||
WEAK symbol<unsigned int> levelEntityId{0x208E1A4};
|
||||
|
||||
WEAK symbol<client_s> svs_clients{0x4B5CF90};
|
||||
|
||||
namespace plutonium
|
||||
{
|
||||
WEAK symbol<std::unordered_map<std::string, std::uint16_t>> function_map_rev{0x20693038};
|
||||
WEAK symbol<std::unordered_map<std::string, std::uint16_t>> method_map_rev{0x20693058};
|
||||
WEAK symbol<std::unordered_map<std::string, std::uint16_t>> token_map_rev{0x20693098};
|
||||
WEAK symbol<int(const char* fmt, ...)> printf{0x208879B0};
|
||||
WEAK symbol<void*> function_table{0x2068BCF0};
|
||||
WEAK symbol<void*> method_table{0x2068C4C0};
|
||||
WEAK symbol<std::unordered_map<std::string, std::uint16_t>> function_map_rev{0x206964D0};
|
||||
WEAK symbol<std::unordered_map<std::string, std::uint16_t>> method_map_rev{0x206964F0};
|
||||
WEAK symbol<std::unordered_map<std::string, std::uint16_t>> token_map_rev{0x20696530};
|
||||
WEAK symbol<int(const char* fmt, ...)> printf{0x20887840};
|
||||
WEAK symbol<void*> function_table{0x2068F210};
|
||||
WEAK symbol<void*> method_table{0x2068F9E0};
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user