mirror of
https://github.com/ineedbots/cod2m.git
synced 2025-04-19 16:02:53 +00:00
add isbot
This commit is contained in:
parent
9a3b953478
commit
9b1f27c258
@ -157,6 +157,10 @@ namespace Components
|
||||
Utils::Hook(0x501E0D, G_SelectWeaponIndex_Stub, HOOK_CALL).install()->quick();
|
||||
Utils::Hook(0x52B166, PlayerCmd_setSpawnWeapon_Stub, HOOK_JUMP).install()->quick();
|
||||
|
||||
Script::AddMethod("isbot", [](Game::scr_entref_t ent)
|
||||
{
|
||||
Game::Scr_AddInt(Game::svs->clients[ent].bot);
|
||||
});
|
||||
|
||||
Script::AddMethod("botaction", [](Game::scr_entref_t ent)
|
||||
{
|
||||
|
@ -203,6 +203,18 @@ namespace Game
|
||||
return answer;
|
||||
}
|
||||
|
||||
void Scr_AddInt(int num)
|
||||
{
|
||||
int func_loc = 0x483580;
|
||||
|
||||
__asm
|
||||
{
|
||||
push num;
|
||||
call func_loc;
|
||||
add esp, 4;
|
||||
}
|
||||
}
|
||||
|
||||
void G_SelectWeaponIndex(int wpIdx, int clNum)
|
||||
{
|
||||
int func_loc = 0x5282E0;
|
||||
|
@ -86,6 +86,7 @@ namespace Game
|
||||
|
||||
extern const char* Scr_GetString(unsigned int);
|
||||
extern int Scr_GetInt(unsigned int);
|
||||
extern void Scr_AddInt(int);
|
||||
extern void G_SelectWeaponIndex(int, int);
|
||||
extern void SV_ClientThink(Game::usercmd_s*, Game::client_t*);
|
||||
extern void SV_DropClient(Game::client_t*, const char*);
|
||||
|
@ -812,9 +812,9 @@ namespace Game
|
||||
|
||||
typedef int fileHandle_t;
|
||||
|
||||
typedef void (__stdcall *xfunction_t)();
|
||||
typedef void (__cdecl *xfunction_t)();
|
||||
|
||||
typedef void (__stdcall *xmethod_t)(scr_entref_t);
|
||||
typedef void (__cdecl *xmethod_t)(scr_entref_t);
|
||||
|
||||
typedef void (*xcommand_t)(void);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user