Post: Advanced Warfare C++ Script Thread
11-05-2014, 04:48 AM #1
(adsbygoogle = window.adsbygoogle || []).push({});
Welcome and feel free to post yours below Smile
TOC:
0x994F68
Some Addresses
    
Updating...

Client Functions:

Fair Aimbot
    
namespace Aimbot
{
int G_Client(int clientIndex) {return Offsets::G_Client + ( clientIndex * Offsets::G_Client_Size ); }
int G_Entity(int clientIndex) {return Offsets::G_Entity + ( clientIndex * Offsets::G_Entity_Size ); }

bool CheckTeam(int Client, int OtherClient)
{
int Attacker = *(int*)(G_Client(Client) + Offsets::Team);
int Victim = *(int*)(G_Client(OtherClient) + Offsets::Team);
if(Attacker == Victim)
{
return true;
}
else
{
return false;
}
}

float GetStance(int client)
{
if(*(int*)(G_Client(client) + 0x5A) == 262144 || *(int*)(G_Client(client) + 0x5A) == 393216)
{
return 24;//crouched
}
else if(*(int*)(G_Client(client) + 0x5A) == 655360 || *(int*)(G_Client(client) + 0x5A) == 52428Cool Man (aka Tustin)
{
return 42;//prone
}
else if(*(int*)(G_Client(client) + 0x5A) == 0 || *(int*)(G_Client(client) + 0x5A) == 131072)
{
return -3;//standing
}
}

bool CheckIfLiving(int client)
{
if(*(int*)(G_Entity(client) + Offsets::Health) != 0)
{
return true;
}
else return false;
}

bool ClientIsInGame(int clientIndex)
{
if(*(int*)G_Client(clientIndex) != 0)
return true;
else return false;
}

struct Vec3
{
float x, y, z;
};

Vec3 Difference;
Vec3 GetVec(Vec3 Attacker, Vec3 Target)
{
Difference.x = (Target.x - Attacker.x);
Difference.y = (Target.y - Attacker.y);
Difference.z = (Target.z - Attacker.z);
return Difference;
}

float dx, dy, dz;
float Get3dDistance( Vec3 c1, Vec3 c2 )
{
float dx = c2.x - c1.x;
float dy = c2.y - c1.y;
float dz = c2.z - c1.z;

return sqrt((float)((dx * dx) + (dy * dy) + (dz * dz)));
}

Vec3 vec;
Vec3 GetPlayerOrigin(int Client)
{
vec = *(Vec3*)(G_Client(Client) + Offsets::Origin);
return vec;
}

Vec3 VecV;
Vec3 GetPlayerOriginVictim(int Client)
{
VecV = *(Vec3*)(G_Client(Client) + Offsets::Origin);
VecV.z -= GetStance(Client);
return VecV;
}

int Nearest;
int GetNearestPlayer(int Client)
{
float MaxDistance = 99999999;
for (int i = 0; i < 12; i ++)
{
Vec3 Attacker = GetPlayerOrigin(Client);
Vec3 Vic = GetPlayerOrigin(i);
float ActualDistance = Get3dDistance(Attacker, Vic);
if ((i != Client) && CheckIfLiving(i) && ClientIsInGame(i))
{
if(cstrcmp(Func:Happyvar_GetString("ui_gametype"), "dm") == 0)
{
if (ActualDistance < MaxDistance)
{
Nearest = i;
MaxDistance = ActualDistance;
}
}
else
{
if(!CheckTeam(Client, i))
{
if (ActualDistance < MaxDistance)
{
Nearest = i;
MaxDistance = ActualDistance;
}
}
}
}
}
return Nearest;
}

float angles[3];
float* vectoangles(Vec3 Angles)
{
float forward;
float yaw, pitch;
float PI = 3.1415926535897931;
if (Angles.x == 0 && Angles.y == 0)
{
yaw = 0;
if (Angles.z > 0) pitch = 90.00;
else pitch = 270.00;
}
else
{
if (Angles.x != -1) yaw = (float)(atan2((double)Angles.y, (double)Angles.x) * 180.00 / PI);
else if (Angles.y > 0) yaw = 90.00;
else yaw = 270;
if (yaw < 0) yaw += 360.00;

forward = (float)sqrt((double)(Angles.x * Angles.x + Angles.y * Angles.y));
pitch = (float)(atan2((double)Angles.z, (double)forward) * 180.00 / PI);
if (pitch < 0) pitch += 360.00;
}
angles[0] = -pitch;
angles[1] = yaw;
angles[2] = 0;

return angles;
}

opd_s Setangles_t = { Offsets::SetClientViewAngles, TOC };
void(*SetClientViewAnlges)(int Ent, float* Angles) = (void(*)(int , float*))&Setangles_t;

void SetViewAngles(int Client)
{
int Victim = GetNearestPlayer(Client);
float* Angles = vectoangles(GetVec(GetPlayerOrigin(Client), GetPlayerOriginVictim(Victim)));
SetClientViewAnlges(G_Entity(Client), Angles);
}
};


Health Bar
    
// add these to your spawn huds:
Vars::ClientHUD[i].HealthBar = HUDS::SetShader(i, 88, 202, 15, 210, 400, 0, 0, 0, 0, 0);
Vars::ClientHUD[i].HealthBar1 = HUDS::SetShader(i, 88, 200, 11, 211, 402, 0, 255, 255, 255, 0);
void HealthBar(int client)
{
if(!Vars::Client[client].HealthBar)
{
HUDS::FadeOverTime(Vars::ClientHUD[client].HealthBar, 100, 0, 0, 0, 160);
HUDS::FadeOverTime(Vars::ClientHUD[client].HealthBar1, 100, 255, 255, 255, 160);
Func::iPrintlnBold(client, "Health bar: [ ^2Enabled ^7]");
Vars::Client[client].HealthBar = true;
}
else
{
HUDS::FadeOverTime(Vars::ClientHUD[client].HealthBar, 100, 0, 0, 0, 0);
HUDS::FadeOverTime(Vars::ClientHUD[client].HealthBar1, 100, 255, 255, 255, 0);
Func::iPrintlnBold(client, "Health bar: [ ^1Disabled ^7]");
Vars::Client[client].HealthBar = false;
}
}

void DoHealthBar(int client)
{
int Health = *(int*)(G_Entity(client) + Offsets::Health);
if(Vars::Client[client].HealthSet != Health)
{
HUDS::ScaleWidth(Vars::ClientHUD[client].HealthBar1, (Health * 2));
Vars::Client[client].HealthSet = Health;
}
}


Third Person
    
void ThirdPerson(int client)
{
if(!Vars::Client[client].ThirdPerson)
{
SetDvar(client, "4 1");
iPrintlnBold(client, "ThirdPerson: [ ^2Enabled ^7]");
Vars::Client[client].ThirdPerson = true;
}
else
{
SetDvar(client, "4 0");
iPrintlnBold(client, "ThirdPerson: [ ^1Disabled ^7]");
Vars::Client[client].ThirdPerson = false;
}
}


Button monitoring
    
namespace Buttons //Credits to Zim Zam Bim Bam
{
enum Buttons
{
L1 = 526336,
L2 = 32768,
L3 = 8194,
R1 = 1,
R2 = 16384,
R3 = 67108868,
Cross = 1024,
Square = 48,
Crouch = 512,
Prone = 256,
Start = 8388608,
};

bool DetectBtn(int client, int Buttons)
{
if (*(int*)(G_Client(client) + 0x3DB4) == Buttons)
return true;
else return false;
}
};

G_GivePlayerWeapon
    
opd_s Add_Ammo_t = { Offsets::Add_Ammo, TOC };
void(*Add_Ammo)(int* G_Entity, unsigned int WeaponIndex, char WeaponModel, int Count, int FillClip) = (void(*)(int*, unsigned int, char, int, int))&Add_Ammo_t;

opd_s G_GivePlayerWeapon_t = { Offsets::G_GivePlayerWeapon, TOC };
void(*G_GivePlayerWeapon)(int* G_Client, int WeaponIndex, char ModelIndex) = (void(*)(int*, int, char))&G_GivePlayerWeapon_t;

opd_s BG_FindWeaponIndexForName_t = { Offsets::BG_FindWeaponIndexForName, TOC };
void(*BG_FindWeaponIndexForName)(int buffer, const char* Weapon) = (void(*)(int, const char*))&BG_FindWeaponIndexForName_t;

int GetWeaponIndex(const char* Weapon)
{
BG_FindWeaponIndexForName(0x1100000, Weapon);
return *(int*)0x1100000;
}

void GiveWeapon(int Client, const char* Weapon, int Akimbo = 0)
{
int Index = GetWeaponIndex(Weapon);
G_GivePlayerWeapon((int*)G_Client(Client), Index, Akimbo);
Add_Ammo((int*)G_Entity(Client), Index, 0, 9999, 1);
char buf[100];
Com_sprintf(buf, 100, "a %i \"", Index, "\"");
SV_GSSC(Client, buf);
}



SV_GameSendServerCommand
    
opd_s SV = { Offsets::Sv_GameSendServerCommand, TOC };
void(*svgssc)(int client, int type, char* cmd) = (void(*)(int, int, char*))&SV;
#pragma region SV_GameSendServerCommand
void SV_GSSC(int client, char* command)
{
svgssc(client, 0, command);
}

void iPrintlnBold(int client, char* text)
{
char buf[100];
Com_sprintf(buf, 100, "c \"%s%s", text, "\"");
SV_GSSC(client, buf);
}

void iPrintln(int client, char* text)
{
char buf[100];
Com_sprintf(buf, 100, "f \"%s%s", text, "\"");
SV_GSSC(client, buf);
}

void SetBlur(int client, int BlurAmount)
{
char buf[100];
Com_sprintf(buf, 100, "i _ %i", BlurAmount);
SV_GSSC(client, buf);
}

void SetVision(int client, char* Vision)
{
char buf[100];
Com_sprintf(buf, 100, "J \"%s%s", Vision, "\"");
SV_GSSC(client, buf);
}

void SetDvar(int client, char* Dvar)
{
char buf[100];
Com_sprintf(buf, 100, "q \"%s%s", Dvar, "\"");
SV_GSSC(client, buf);
}
#pragma endregion



Game Functions:


Dvar_GetString
    
opd_s Dvar_GetString_t = { Offsets:Happyvar_GetString, TOC };
const char*(*Dvar_GetString)(const char* Dvar) = (const char*(*)(const char*))&Awesome facevar_GetString_t;


Dvar_GetBool
    
opd_s Dvar_GetBool_t = { Offsets:Happyvar_GetBool, TOC };
bool(*Dvar_GetBool)(const char* Dvar) = (bool(*)(const char*))&Awesome facevar_GetBool_t;


Com_Sprintf
    
opd_s Com_sprintf_t = { Offsets::Com_Sprintf, TOC };
int(*Com_sprintf)(char *dest, int size, const char *fmt, ...) = (int(*)(char* , int, char const *, ...))&Com_sprintf_t;


G_FindConfigstringIndex
    
opd_s G_FindConfigstringIndex_t = { Offsets::G_FindConfigstringIndex, TOC };
int(*G_FindConfigstringIndex)(const char *name, int start, int max, int create, const char *errormsg) = (int(*)(const char*, int, int, int, const char*))&G_FindConfigstringIndex_t;

int G_MaterialIndex(const char *name)
{
return G_FindConfigstringIndex(name, 0xD95, 0x190, 1, "material");
}

int G_LocalizedStringIndex(const char *name)
{
return G_FindConfigstringIndex(name, 0x217, 0x28A, 1, "localized string");
}




Hud Elements
    
union hudelem_color_t
{
struct
{
unsigned char r;
unsigned char g;
unsigned char b;
unsigned char a;
};
int rgba;
};

struct hudelem_s
{
int Active;
int font;
int alignOrg;
int alignScreen;
float x;
float y;
float z;
int type;
float FontScale;
int FromFontScale;
int FontScaleStartTime;
int FontScaleTime;
hudelem_color_t color;
hudelem_color_t fromColor;
int fadeStartTime;
int fadeTime;
int label;
int Width;
int Height;
int MaterialIndex;
int fromWidth;
int fromHeight;
int moveStartTime;
int moveTime;
float fromX;
float fromY;
int fromAlignOrg;
int fromAlignScreen;
int scaleStartTime;
int scaleTime;
int time;
int duration;
float value;
int text;
float sort;
hudelem_color_t glowColor;
int fxBirthTime;
int fxLetterTime;
int fxDecayStartTime;
int fxDecayDuration;
int soundID;
int unknown;
int flags;
};

struct game_hudelem_s
{
hudelem_s elem;
int ClientNum;
int team;
int archived;
int showInKillcam;
};

opd_s G_LocalizedStringIndex_t = { Offsets::G_LocalizedStringIndex, TOC };
int(*G_LocalizedStringIndex)(const char* Text) = (int(*)(const char*))&G_LocalizedStringIndex_t;

game_hudelem_s* HudElem_Alloc()
{
for (int i = 120; i < 1024; i++)
{
game_hudelem_s* elem = (game_hudelem_s*)(Offsets::G_HudElems + (i * 0xBC));
if (!elem->elem.type) return elem;
}
return (game_hudelem_s*)-1;
}

int GetLevelTime()
{
return *(int*)0x179D5C0;
}

game_hudelem_s* SetShader(int clientIndex, int Shader, int Width, int Height, float X, float Y, int Allign = 0, unsigned char R = 0, unsigned char G = 0, unsigned char B = 0, unsigned char A = 0)
{
game_hudelem_s* elem = HudElem_Alloc();
elem->ClientNum = clientIndex;
elem->elem.type = 4;
elem->elem.MaterialIndex = Shader;
elem->elem.Width = Width;
elem->elem.Height = Height;
elem->elem.x = X;
elem->elem.y = Y;
elem->elem.alignOrg = Allign;
elem->elem.color.r = R;
elem->elem.color.g = G;
elem->elem.color.b = B;
elem->elem.color.a = A;
elem->elem.Active = 1;
return elem;
}

game_hudelem_s* SetText(int clientIndex, const char* Text, int Font, float FontScale, float X, float Y, int Allign, float Sort, unsigned char R = 0, unsigned char G = 0, unsigned char B = 0, unsigned char A = 0, unsigned char glowR = 0, unsigned char glowG = 0, unsigned char glowB = 0, unsigned char glowA = 0)
{
game_hudelem_s* Elem = HudElem_Alloc();
Elem->ClientNum = clientIndex;
Elem->elem.type = 1;
Elem->elem.font = Font;
Elem->elem.FontScale = FontScale;
if (Allign != 0)
{ Elem->elem.alignOrg = 5; Elem->elem.alignScreen = Allign; Elem->elem.x = X; Elem->elem.y = Y; }
else
{ Elem->elem.x = X; Elem->elem.y = Y; }
Elem->elem.color.r = R;
Elem->elem.color.g = G;
Elem->elem.color.b = B;
Elem->elem.color.a = A;
Elem->elem.glowColor.r = glowR;
Elem->elem.glowColor.g = glowG;
Elem->elem.glowColor.b = glowB;
Elem->elem.glowColor.a = glowA;
Elem->elem.text = G_LocalizedStringIndex(Text);
Elem->elem.Active = 1;
return Elem;
}

void ChangeText(game_hudelem_s* elemIndex, const char* Text)
{
elemIndex->elem.Text = G_LocalizedStringIndex(Text);
}

void MoveOverTime(game_hudelem_s* elemIndex, int time, float X, float Y)
{
elemIndex->elem.FromX = elemIndex->elem.x;
elemIndex->elem.FromY = elemIndex->elem.y;
elemIndex->elem.MoveStartTime = GetLevelTime();
elemIndex->elem.MoveTime = time;
elemIndex->elem.x = X;
elemIndex->elem.y = Y;
}

void MoveShaderXY(game_hudelem_s* elemIndex, float X, float Y)
{
elemIndex->elem.x = X;
elemIndex->elem.y = Y;
}

void ScaleOverTime(game_hudelem_s* elemIndex, int time, int width, int height)
{
elemIndex->elem.FromHeight = elemIndex->elem.Height;
elemIndex->elem.FromWidth = elemIndex->elem.Width;
elemIndex->elem.ScaleStartTime = GetLevelTime();
elemIndex->elem.ScaleTime= time;
elemIndex->elem.Width = width;
elemIndex->elem.Height = height;
}

void FontScaleOverTime(game_hudelem_s* elemIndex, float FontSize, int time)
{
elemIndex->elem.FromFontScale = elemIndex->elem.FontScale;
elemIndex->elem.FontScale = FontSize;
elemIndex->elem.FontScaleTime = time;
elemIndex->elem.FontScaleStartTime = GetLevelTime();
}

void SetGlow(game_hudelem_s* Text, int GlowR, int GlowG, int GlowB, int GlowA)
{
Text->elem.GlowColor.r = GlowR;
Text->elem.GlowColor.g = GlowG;
Text->elem.GlowColor.b = GlowB;
Text->elem.GlowColor.a = GlowA;
}

void FadeOverTime(game_hudelem_s* Elem, int Time, unsigned char R, unsigned char G, unsigned char B, unsigned char A)
{
Elem->elem.FromColor = Elem->elem.Color;
Elem->elem.Color.r = R;
Elem->elem.Color.g = G;
Elem->elem.Color.b = B;
Elem->elem.Color.a = A;
Elem->elem.FadeTime = Time;
Elem->elem.FadeStartTime = GetLevelTime();
}


Credits:
    
BlackPanther
SC58
BadLuckBrian
Shark
Seb


(adsbygoogle = window.adsbygoogle || []).push({});

The following 32 users say thank you to OLDSCHOOLMODZHD for this useful post:

Absolute Zero, Albus, BaSs_HaXoR, Boliberrys, Chinx Drugz, Defc0n_xD, Dynasty Modz, Eddie Mac, ErasedDev, Full-Evil, FusionIsDaName, iProgeny, Welsh, Jannik007, NickBeHaxing, NotALegitPlayer, ReqLobbies, SaberNGU, SC58, ScaRzModZ, smashedya, Smoky420, subkiller369, Swaqq, TheModedHacker, Tipton_Modz, top_top, TotalModzHD, xDebugKiller, xhevanlyx, zRayz-
01-27-2015, 02:06 AM #47
sambuck
Space Ninja
come on dude its been 3 day since the login failed please fix this bro its on ghost and AW i have email u meg u on skype and on here not trying to spam u but please fix it plz thanks
01-27-2015, 02:16 AM #48
Originally posted by sambuck View Post
the login say fail to login plz fix bro


Originally posted by sambuck View Post
login failed on aw bro and on ghost failed to login please fix bro plz thanks


What are you talking about...?
01-27-2015, 06:33 AM #49
SyGnUs
Give a F*** About Your Lifestyle
Originally posted by Black
What are you talking about...?


Maybe he bought that SPRX from OSM, who knows. Nice release btw.
01-27-2015, 03:31 PM #50
Can anyone give me a modded account master prestige on aw
01-27-2015, 11:18 PM #51
LBK
Little One
Originally posted by Boliberrys View Post
The ones used here You must login or register to view this content.


Hi Smile

0xD075E0 - clientActive_t

0x219620- CL_SetViewAngles(int localClientNum, const float *angles)

If CL_SetViewAngle is wrong : 0x219640

Your Welcome Bro Smile
01-28-2015, 04:23 AM #52
Boliberrys
^^ Sexy ^^
How did you got them? Please teach me :3
Originally posted by Lebigkilleur View Post
Hi Smile

0xD075E0 - clientActive_t

0x219620- CL_SetViewAngles(int localClientNum, const float *angles)

If CL_SetViewAngle is wrong : 0x219640

Your Welcome Bro Smile
01-28-2015, 08:08 PM #53
LBK
Little One
Originally posted by Boliberrys View Post
How did you got them? Please teach me :3


I just took the SC58 address and I are update with IDA Smile
02-02-2015, 01:00 AM #54
Swaqq
Professional Thanker
I think your dvar_GetBool function has a mistake in it. My thread freezes :fa:
02-02-2015, 01:05 AM #55
SyGnUs
Give a F*** About Your Lifestyle
Originally posted by Swaqq View Post
I think your dvar_GetBool function has a mistake in it. My thread freezes :fa:


It should work fine, your offset is probably wrong.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo