Post: [SPRX]SV_GameSendServerCommand Troubles
01-17-2016, 11:36 PM #1
gopro_2027
Vault dweller
(adsbygoogle = window.adsbygoogle || []).push({}); I seem to be missing something because I can never get functions to work.
Functions like:
SV_GameSendServerCommand
AimTarget_IsTargetVisible
G_SetModel

They almost always crash my game whether I call them from a separate thread or from a hooked function.
Here is an example of how I use sv_gamesendservercommand from the offset theads:
    
opd_s svg = {0x003E95F0,TOC};
void (*SV_GameSendServerCommand_t)(int clientNum, int type, const char *text) = (void(*)(int, int, const char *))&svg;
void SV_GameSendServerCommand(int client, char *command) {
SV_GameSendServerCommand_t(client,1,command);
}

But it crashes my game no matter where I call it from.
(adsbygoogle = window.adsbygoogle || []).push({});
01-17-2016, 11:48 PM #2
Jim Halpert
Bounty hunter
Originally posted by pro View Post
I seem to be missing something because I can never get functions to work.
Functions like:
SV_GameSendServerCommand
AimTarget_IsTargetVisible
G_SetModel

They almost always crash my game whether I call them from a separate thread or from a hooked function.
Here is an example of how I use sv_gamesendservercommand from the offset theads:
    
opd_s svg = {0x003E95F0,TOC};
void (*SV_GameSendServerCommand_t)(int clientNum, int type, const char *text) = (void(*)(int, int, const char *))&svg;
void SV_GameSendServerCommand(int client, char *command) {
SV_GameSendServerCommand_t(client,1,command);
}

But it crashes my game no matter where I call it from.


Just from looking at my MW3 SV_GameSendServerCommand function, its third parameter is just char*, not const char*. So try doing

    void (*SV_GameSendServerCommand_t)(int clientNum, int type, char *text) = (void(*)(int, int, char *))&svg;


Instead. Just a thought though
01-18-2016, 09:54 PM #3
01cedricv2
NGU Elite Lifetime Mermber
Originally posted by pro View Post
I seem to be missing something because I can never get functions to work.
Functions like:
SV_GameSendServerCommand
AimTarget_IsTargetVisible
G_SetModel

They almost always crash my game whether I call them from a separate thread or from a hooked function.
Here is an example of how I use sv_gamesendservercommand from the offset theads:
    
opd_s svg = {0x003E95F,TOC};
void (*SV_GameSendServerCommand_t)(int clientNum, int type, const char *text) = (void(*)(int, int, const char *))&svg;
void SV_GameSendServerCommand(int client, char *command) {
SV_GameSendServerCommand_t(client,1,command);
}

But it crashes my game no matter where I call it from.


This should work:
    void SV_GameSendServerCommand(int Client, int type, char* Command)
{
opd_s SV1 = { 0x3E95F0, TOC };
void(*SVGSSC)(int client, int type, char* cmd) = (void(*)(int, int, char*))&SV1;
SVGSSC(Client, 0, Command);
}
01-18-2016, 10:03 PM #4
Sabotage
Gaming Squad
AimTarget_IsTargetVisible, this function can only be called from a hook, and if I remember correctly, it takes centity as one of the params.
so that might be why

(remember, the centity has to be the one of the client you want to check visibility for)
01-18-2016, 11:18 PM #5
gopro_2027
Vault dweller
Originally posted by Sabotage View Post
AimTarget_IsTargetVisible, this function can only be called from a hook, and if I remember correctly, it takes centity as one of the params.
so that might be why

(remember, the centity has to be the one of the client you want to check visibility for)


Yea I got it to not crash by calling it through the hook but the actual function does not work (returns true even if I can't see them)
01-18-2016, 11:19 PM #6
Sabotage
Gaming Squad
Originally posted by pro View Post
Yea I got it to not crash by calling it through the hook but the actual function does not work (returns true even if I can't see them)


it either takes a mask or a visbone on one of the params, break point it and see what it takes, r3 is your first param Smile
01-18-2016, 11:24 PM #7
gopro_2027
Vault dweller
Originally posted by Sabotage View Post
it either takes a mask or a visbone on one of the params, break point it and see what it takes, r3 is your first param Smile


I still can't work ida tbh lol. I tried but I can't even find AimTarget_IsTargetVisible by myself. From what I can tell the first param is local client (0), the second one is the centity, which I believe I did correctly, and the third is a body part.
Milky from the original snow engine:
Originally posted by milky4444 View Post
if anyone wants to expand on the aimbot these addresses should help you:
Aiming at centin locations:
    
void AimTarget_GetTagPos_0(centity_s *ent, unsigned int tagName, float *pos) = 0x58100
unsigned int __cdecl GScr_AllocString(const char *s) = 0x317B28

example:
    
float* headpos;
unsigned int head = GScr_AllocString("j_head");//use this or the enum below
AimTarget_GetTagPos_0(targent,head,headpos);//stores in headpos

Stealth mode:
    
enum aimtags
{
HITLOC_NONE = 0,
HITLOC_HELMET = 1,
HITLOC_HEAD = 2,
HITLOC_NECK = 3,
HITLOC_TORSO_UPR = 4,
HITLOC_TORSO_LWR = 5,
HITLOC_R_ARM_UPR = 6,
HITLOC_L_ARM_UPR = 7,
HITLOC_R_ARM_LWR = 8,
HITLOC_L_ARM_LWR = 9,
HITLOC_R_HAND = 0xA,
HITLOC_L_HAND = 0xB,
HITLOC_R_LEG_UPR = 0xC,
HITLOC_L_LEG_UPR = 0xD,
HITLOC_R_LEG_LWR = 0xE,
HITLOC_L_LEG_LWR = 0xF,
HITLOC_R_FOOT = 0x10,
HITLOC_L_FOOT = 0x11,
HITLOC_GUN = 0x12,
HITLOC_NUM = 0x13
};
bool AimTarget_IsTargetVisible(int localClientNum, centity_s *targetEnt, unsigned int visBone) = 0x58640

example:
    
if(AimTarget_IsTargetVisible(0,targetEnt,TORSO_UPR))
{
//do aimbot
}

also here is the centity if your to lazy to go through the source :P
    
centity pointer: 0xC3DFC0
centity size: 0x31C
01-18-2016, 11:26 PM #8
Sabotage
Gaming Squad
Originally posted by pro View Post
I still can't work ida tbh lol. I tried but I can't even find AimTarget_IsTargetVisible by myself. From what I can tell the first param is local client (0), the second one is the centity, which I believe I did correctly, and the third is a body part.
Milky from the original snow engine:


i mean I don't know if that is right.
01-20-2016, 11:47 PM #9
gopro_2027
Vault dweller
Originally posted by 01cedricv2 View Post
This should work:
    void SV_GameSendServerCommand(int Client, char* Command)
{
opd_s SV1 = { 0x3E95F0, TOC };
void(*SVGSSC)(int client, int type, char* cmd) = (void(*)(int, int, char*))&SV1;
SVGSSC(Client, 0, Command);
}


I tried calling SV_GameSendServerCommand(0,"c \"^1Hello there!\""); but it froze my game. I also tried < instead of the c. All of it freezes me. I am calling from the hook too btw.
01-21-2016, 10:36 PM #10
gopro_2027
Vault dweller
Originally posted by Sabotage View Post
i mean I don't know if that is right.


Okay I had the wrong toc. Well, milky had the wong toc :P Anyways I got the new one and it fixed the sv_gamesendservercommand (at least, it kept it from freezing so I guess it works now). I can't get it to print text on the screen tho. Hopefully I get that worked out.
Also I am having problems with the precached shaders now. When I try to set my players model it kicks me to the main screen with the error that says the model is now precached.
Any help? Smile
Thanks

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo