Post: [1.16/C++] Script Thread
03-04-2015, 01:09 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Hey NGU, Here are some C++ Scripts for Ghosts 1.16 Enjoy!

TOC: = 0xA7F3C8

opd_s:

    
struct opd_s
{
uint32_t sub;
uint32_t toc;
};



Dvar_GetBool:

    
opd_s ParseAddr(int Address)
{
opd_s GLS = { Address, 0xA7F3C8 };
return GLS;
}
#define Dvar_GetBool(dvar) ((bool(*)(const char*))&ParseAddr(0x04CE50C))(dvar)



SV_GameSendServerCommand:

    
opd_s ParseAddr(int Address)
{
opd_s GLS = { Address, 0xA7F3C8 };
return GLS;
}
#define SV_GameSendServerCommand(client, type, text) ((void(*)(int, int, const char*))&ParseAddr(0x672444))(client, type, text)



Useful SV_GameSendServerCommands:

    
void iPrintln(int client, char* text)
{
char buf[100];
strcpy(buf, "f "");
strcat(buf, text);
SV_GameSendServerCommand(client, 0, buf);
}
void iPrintlnBold(int client, char* text)
{
char buf[100];
strcpy(buf, "c "");
strcat(buf, text);
SV_GameSendServerCommand(client, 0, buf);
}
void SetVision(int client, char* Vision)
{
char buf[100];
strcpy(buf, "J "");
strcat(buf, Vision);
SV_GameSendServerCommand(client, 0, buf);
}



cl_ingame:

    
bool InGame()
{
if (*(char*)0x2357DF0 != 1)
return false;
return true;
}



Get Name: (All Clients)

    
char byteArray[100];
char* ReadBytes(int address, int length)
{
for (int i = 0; i < length; i++)
{
byteArray[i] = *(char*)(address + (i));
}
return byteArray;
}
char returnRead[100];
char* ReadString(int address)
{
memset(&returnRead[0], 0, sizeof(returnRead));
int strlength = 100;
char* StrBytes = ReadBytes(address, strlength);
for (int i = 0; i < strlength; i++)
{
if (StrBytes[i] != 0x00)
returnRead[i] = StrBytes[i];
else
break;
}
return returnRead;
}
char* getClientName(int clientIndex)
{
char* Name = ReadString((0xF47A1C + (clientIndex * 0x3700)));
if(!strcmp(Name, ""))
{
return "Not Connected";
}
else
{
return Name;
}
}



God Mode:

    
bool GM[12];
void GodMode(int client)
{
if(!GM[client])
{
*(char*)(0xE04B2A + (0x280 * client)) = 0x0FFFFFFF;
iPrintln(client, "God Mode ^2ON");
GM[client] = true;
}
else
{
*(char*)(0xE04B2A + (0x280 * client)) = 0x64000000;
iPrintln(client, "God Mode ^1OFF");
GM[client] = false;
}
}



Infinite Ammo:

    
bool IA[12];
void InfiniteAmmo(int client)
{
if(!IA[client])
{
*(char*)(0xF44EDA + (0x3700 * client)) = 0x0FFFFFFF;
*(char*)(0xF44EEA + (0x3700 * client)) = 0x0FFFFFFF;
*(char*)(0xF44ECA + (0x3700 * client)) = 0x0FFFFFFF;
*(char*)(0xF44EBA + (0x3700 * client)) = 0x0FFFFFFF;
*(char*)(0xF44EFA + (0x3700 * client)) = 0x0FFFFFFF;
iPrintln(client, "Infinite Ammo ^2ON");
IA[client] = true;
}
else
{
*(char*)(0xF44EDA + (0x3700 * client)) = 0x00, 0x00, 0x00, 0x64;
*(char*)(0xF44EEA + (0x3700 * client)) = 0x00, 0x00, 0x00, 0x64;
*(char*)(0xF44ECA + (0x3700 * client)) = 0x00, 0x00, 0x00, 0x64;
*(char*)(0xF44EBA + (0x3700 * client)) = 0x00, 0x00, 0x00, 0x64;
*(char*)(0xF44EFA + (0x3700 * client)) = 0x00, 0x00, 0x00, 0x64;
iPrintln(client, "Infinite Ammo ^1OFF");
IA[client] = false;
}
}



mFlags: (NoClip, UFO, Freeze)

    
bool NC[12];
void NoClip(int client)
{
if(!NC[client])
{
*(char*)(0xF47C9F + (0x3700 * client)) = 0x01;
iPrintln(client, "No Clip ^2ON");
NC[client] = true;
}
else
{
*(char*)(0xF47C9F + (0x3700 * client)) = 0x00;
iPrintln(client, "No Clip ^1OFF");
NC[client] = false;
}
}
bool UFO[12];
void UFOMode(int client)
{
if(!UFO[client])
{
*(char*)(0xF47C9F + (0x3700 * client)) = 0x02;
iPrintln(client, "UFO Mode ^2ON");
UFO[client] = true;
}
else
{
*(char*)(0xF47C9F + (0x3700 * client)) = 0x00;
iPrintln(client, "UFO Mode ^1OFF");
UFO[client] = false;
}
}
bool Freeze[12];
void FreezePlayer(int client)
{
if(!Freeze[client])
{
*(char*)(0xF47C9F + (0x3700 * client)) = 0x04;
iPrintln(client, "^1Frozen");
Freeze[client] = true;
}
else
{
*(char*)(0xF47C9F + (0x3700 * client)) = 0x00;
iPrintln(client, "^2Unfrozen");
Freeze[client] = false;
}
}



Uav:

    
bool CU[12];
void Uav(int client)
{
if(!CU[client])
{
*(char*)(0x140A3A + (0x3700 * client)) = 0x02;
iPrintln(client, "Uav ^2ON");
CU[client] = true;
}
else
{
*(char*)(0x140A3A + (0x3700 * client)) = 0x01;
iPrintln(client, "Uav ^1OFF");
CU[client] = false;
}
}



Useful Links:
You must login or register to view this content.
You must login or register to view this content.
Last edited by oStankyModz ; 03-04-2015 at 01:16 PM.

The following 3 users say thank you to oStankyModz for this useful post:

anxify, FusionIsDaName, ItzMatriix
03-04-2015, 05:09 PM #2
ItzMatriix
Are you high?
FINALLY! ive needed the TOC for this game forever! the only other thing i dont have now if how to determine the Host
03-04-2015, 08:13 PM #3
Originally posted by ItzMatriix View Post
FINALLY! ive needed the TOC for this game forever! the only other thing i dont have now if how to determine the Host


Use Dvar_GetString("sv_hostname")
Just look for the address yourself. This returns the host, just compare it to local client name to see if you're host.
03-04-2015, 09:29 PM #4
ItzMatriix
Are you high?
Originally posted by Joren. View Post
Use Dvar_GetString("sv_hostname")
Just look for the address yourself. This returns the host, just compare it to local client name to see if you're host.


whats the offset for local client name?
03-14-2015, 03:40 PM #5
Originally posted by ItzMatriix View Post
whats the offset for local client name?


Look for it in Debugger, just go in a random game and search for your name.

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo