Post: BulletTrace [Teleport Gun + Get Ent Your Aiming At]
05-10-2014, 04:05 AM #1
Shark
Retired.
(adsbygoogle = window.adsbygoogle || []).push({}); hey guys, I have had this for a while but I'm deciding to release it because some people might find it useful for forge mode or whatever

Pastebin Link: You must login or register to view this content.

C# Code
    
class Offsets
{
public static uint
//G_Client
G_Client = 0x1780F28,
ClientOrigin = 0x28,
ClientAngles = 0x56BC,

//Entity
G_Entity = 0x16B9F20,
G_EntitySize = 0x31C,
G_SetOrigin = 0x279698,
Trace_GetEntityHitID = 0x306F30,
G_GetPlayerViewOrigin = 0x1E60D0,
G_LocationalTrace = 0x35C598;


public class Funcs
{
public static uint G_Client(int clientIndex, uint Mod = 0x00)
{
return (Offsets.G_Client + (UInt32)Mod) + ((uint)clientIndex * 0x580Cool Man (aka Tustin);
}
public static uint G_Entity(int entityIndex, uint Mod = 0x00)
{
return (Offsets.G_Entity + (UInt32)Mod) + ((uint)entityIndex * 0x31C);
}
}

public static byte[] ReverseBytes(byte[] toReverse)
{
Array.Reverse(toReverse);
return toReverse;
}

public static void WriteSingle(uint address, float[] input)
{
int length = input.Length;
byte[] array = new byte[length * 4];
for (int i = 0; i < length; i++)
{
ReverseBytes(BitConverter.GetBytes(input[i])).CopyTo(array, (int) (i * 4));
}
PS3.SetMemory(address, array);
}

public static float ReadFloat(uint offset)
{
byte[] bytes = PS3.GetMemory(offset, 4);
Array.Reverse(bytes, 0, 4);
return BitConverter.ToSingle(bytes, 0);
}

public static float[] ReadSingle(uint address, int length)
{
byte[] memory = PS3.GetMemory(address, length * 4);
ReverseBytes(memory);
float[] numArray = new float[length];
for (int i = 0; i < length; i++)
{
numArray[i] = BitConverter.ToSingle(memory, ((length - 1) - i) * 4);
}
return numArray;
}

public static float[] PlayerAnglesToForward(int clientIndex, float Distance = 200f)
{
float[] Angles = ReadSingle(Offsets.Funcs.G_Client(clientIndex, Offsets.ClientAngles), 3);
float[] Position = ReadSingle(Offsets.Funcs.G_Client(clientIndex, Offsets.ClientOrigin), 3);
float angle, sr, sp, sy, cr, cp, cy, PiDiv;
PiDiv = ((float)Math.PI / 180f);
angle = Angles[1] * PiDiv;
sy = (float)Math.Sin(angle);
cy = (float)Math.Cos(angle);
angle = Angles[0] * PiDiv;
sp = (float)Math.Sin(angle);
cp = (float)Math.Cos(angle);
angle = Angles[2] * PiDiv;
sr = (float)Math.Sin(angle);
cr = (float)Math.Cos(angle);
float[] Forward = new float[] { (cp * cy * Distance) + Position[0], (cp * sy * Distance) + Position[1], (-sp * Distance) + Position[2] };
return Forward;
}

public static void setPlayerPosition(int clientIndex, float[] Pos)
{
WriteSingle(Offsets.Funcs.G_Client(clientIndex, Offsets.ClientOrigin), Pos);
}

public static float[] G_GetPlayerViewOrigin(int clientIndex)
{
PS3.SetMemory(0x2600250, new byte[0xC]);
RPC.Call(Offsets.G_GetPlayerViewOrigin, Offsets.Funcs.G_Client(clientIndex), 0x2600250);
return ReadSingle(0x2600250, 3);
}

public static void G_LocationalTrace(int clientIndex, int Trace, float[] Start, float[] End)
{
RPC.Call(Offsets.G_LocationalTrace, Trace, Start, End, clientIndex, 0x280E8B3, 0);
}

public static int Trace_GetEntityHitId(int Trace)
{
return RPC.Call(Offsets.Trace_GetEntityHitID, Trace);
}

public static int TraceEntity(int clientIndex, float TracerDistance)
{
int Trace = 0x25D2B00;
float[] Start = G_GetPlayerViewOrigin(clientIndex);
float[] End = PlayerAnglesToForward(clientIndex, TracerDistance);
G_LocationalTrace(clientIndex, Trace, Start, End);
int Entity = Trace_GetEntityHitId(Trace) & 0xFFFF;
if (Entity < 0x3FE)
{ Entity = (int)Offsets.Funcs.G_Entity(Entity); }
else
{ Entity = 0; }
return Entity;
}

public static float[] TraceBullet(int clientIndex, float TracerDistance)
{
int Trace = 0x25D2B00;
float[] Start = G_GetPlayerViewOrigin(clientIndex);
float[] End = PlayerAnglesToForward(clientIndex, TracerDistance);
G_LocationalTrace(clientIndex, Trace, Start, End);
float[] BulletTrace = new float[3];
BulletTrace = new float[] { (((End[0] - Start[0]) * ReadFloat((uint)Trace + 0x10) + Start[0])), (((End[1] - Start[1]) * ReadFloat((uint)Trace + 0x10) + Start[1])), (((End[2] - Start[2]) * ReadFloat((uint)Trace + 0x10) + Start[2])) };
return BulletTrace;
}


How To Use
    
[B]Teleport Gun[/B]
------------------------
SetPlayerPosition(clientIndex, TraceBullet(clientIndex, TracerDistance));

[B]Get Ent ID[/B]
------------------------
MessageBox.Show("Ent ISad Awesome " + TraceEntity(clientIndex, TracerDistance));
//If It returns 0 then you are not looking at an entity... but I'm sure you know this already.


Explanation of The Args
    
clientIndex = If you don't know what this is then go back to OFW.
TracerDistance = The Distance the trace will go before it ends, I use 999999 for teleport gun.


What You Can Use This For
    
Teleport Gun, like in Enstone's menu.
Forge Mode
Teleport To Crosshairs
Spawning Entities To Your Crosshair
MagicBullet
Shoot FX
Lots of other things.... just use your imagination

Credits
    
James - For helping me with this on ghosts and his C++ AnglesToForward Function
Therifboy - For bullet trace struct and GetEntID on ghost
(adsbygoogle = window.adsbygoogle || []).push({});

The following 18 users say thank you to Shark for this useful post:

B777x, FusionIsDaName, Green Haze, ImPiffHD, Jannik007, Mango_Knife, milky4444, NotALegitPlayer, Notorious, OLDSCHOOLMODZHD, RGaming, seanhellen, SnaY, Hash847, xReaperv3, xSynthetic-oJ
05-10-2014, 04:08 AM #2
Hash847
Purple God
Nice job :fa:
05-10-2014, 04:08 AM #3
great job as usual Tustin
05-10-2014, 04:14 AM #4
good shit shark! Tiphat
05-10-2014, 07:32 AM #5
B777x
Hurah!
Originally posted by Shark View Post
hey guys, I have had this for a while but I'm deciding to release it because some people might find it useful for forge mode or whatever

Pastebin Link: You must login or register to view this content.

C# Code
    
class Offsets
{
public static uint
//G_Client
G_Client = 0x1780F28,
ClientOrigin = 0x28,
ClientAngles = 0x56BC,

//Entity
G_Entity = 0x16B9F20,
G_EntitySize = 0x31C,
G_SetOrigin = 0x279698,
Trace_GetEntityHitID = 0x306F30,
G_GetPlayerViewOrigin = 0x1E60D0,
G_LocationalTrace = 0x35C598;


public class Funcs
{
public static uint G_Client(int clientIndex, uint Mod = 0x00)
{
return (Offsets.G_Client + (UInt32)Mod) + ((uint)clientIndex * 0x580Cool Man (aka Tustin);
}
public static uint G_Entity(int entityIndex, uint Mod = 0x00)
{
return (Offsets.G_Entity + (UInt32)Mod) + ((uint)entityIndex * 0x31C);
}
}

public static byte[] ReverseBytes(byte[] toReverse)
{
Array.Reverse(toReverse);
return toReverse;
}

public static void WriteSingle(uint address, float[] input)
{
int length = input.Length;
byte[] array = new byte[length * 4];
for (int i = 0; i < length; i++)
{
ReverseBytes(BitConverter.GetBytes(input[i])).CopyTo(array, (int) (i * 4));
}
PS3.SetMemory(address, array);
}

public static float[] ReadSingle(uint address, int length)
{
byte[] memory = PS3.GetMemory(address, length * 4);
ReverseBytes(memory);
float[] numArray = new float[length];
for (int i = 0; i < length; i++)
{
numArray[i] = BitConverter.ToSingle(memory, ((length - 1) - i) * 4);
}
return numArray;
}

public static float[] PlayerAnglesToForward(int clientIndex, float Distance = 200f)
{
float[] Angles = Lib.ReadSingle(Offsets.Funcs.G_Client(clientIndex, Offsets.ClientAngles), 3);
float[] Position = Lib.ReadSingle(Offsets.Funcs.G_Client(clientIndex, Offsets.ClientOrigin), 3);
float angle, sr, sp, sy, cr, cp, cy, PiDiv;
PiDiv = ((float)Math.PI / 180f);
angle = Angles[1] * PiDiv;
sy = (float)Math.Sin(angle);
cy = (float)Math.Cos(angle);
angle = Angles[0] * PiDiv;
sp = (float)Math.Sin(angle);
cp = (float)Math.Cos(angle);
angle = Angles[2] * PiDiv;
sr = (float)Math.Sin(angle);
cr = (float)Math.Cos(angle);
float[] Forward = new float[] { (cp * cy * Distance) + Position[0], (cp * sy * Distance) + Position[1], (-sp * Distance) + Position[2] };
return Forward;
}

public static void setPlayerPosition(int clientIndex, float[] Pos)
{
Lib.WriteSingle(Offsets.Funcs.G_Client(clientIndex, Offsets.ClientOrigin), Pos);
}

public static float[] G_GetPlayerViewOrigin(int clientIndex)
{
PS3.SetMemory(0x2600250, new byte[0xC]);
RPC.Call(Offsets.G_GetPlayerViewOrigin, Offsets.Funcs.G_Client(clientIndex), 0x2600250);
return Lib.ReadSingle(0x2600250, 3);
}

public static void G_LocationalTrace(int clientIndex, int Trace, float[] Start, float[] End)
{
RPC.Call(Offsets.G_LocationalTrace, Trace, Start, End, clientIndex, 0x280E8B3, 0);
}

public static int Trace_GetEntityHitId(int Trace)
{
return RPC.Call(Offsets.Trace_GetEntityHitID, Trace);
}

public static int TraceEntity(int clientIndex, float TracerDistance)
{
int Trace = 0x25D2B00;
float[] Start = G_GetPlayerViewOrigin(clientIndex);
float[] End = PlayerAnglesToForward(clientIndex, TracerDistance);
G_LocationalTrace(clientIndex, Trace, Start, End);
int Entity = Trace_GetEntityHitId(Trace) & 0xFFFF;
if (Entity < 0x3FE)
{ Entity = (int)Offsets.Funcs.G_Entity(Entity); }
else
{ Entity = 0; }
return Entity;
}

public static float[] TraceBullet(int clientIndex, float TracerDistance)
{
int Trace = 0x25D2B00;
float[] Start = G_GetPlayerViewOrigin(clientIndex);
float[] End = PlayerAnglesToForward(clientIndex, TracerDistance);
G_LocationalTrace(clientIndex, Trace, Start, End);
float[] BulletTrace = new float[3];
BulletTrace = new float[] { (((End[0] - Start[0]) * Lib.ReadSingle((uint)Trace + 0x10) + Start[0])), (((End[1] - Start[1]) * Lib.ReadSingle((uint)Trace + 0x10) + Start[1])), (((End[2] - Start[2]) * Lib.ReadSingle((uint)Trace + 0x10) + Start[2])) };
return BulletTrace;
}


How To Use
    
[B]Teleport Gun[/B]
------------------------
SetPlayerPosition(clientIndex, TraceBullet(clientIndex, TracerDistance));

[B]Get Ent ID[/B]
------------------------
MessageBox.Show("Ent ISad Awesome " + TraceEntity(clientIndex, TracerDistance));
//If It returns 0 then you are not looking at an entity... but I'm sure you know this already.


Explanation of The Args
    
clientIndex = If you don't know what this is then go back to OFW.
TracerDistance = The Distance the trace will go before it ends, I use 999999 for teleport gun.


What You Can Use This For
    
Teleport Gun, like in Enstone's menu.
Forge Mode
Teleport To Crosshairs
Spawning Entities To Your Crosshair
MagicBullet
Shoot FX
Lots of other things.... just use your imagination

Credits
    
James - For helping me with this on ghosts and his C++ AnglesToForward Function
Therifboy - For bullet trace struct and GetEntID on ghost


i got a error

You must login or register to view this content.
05-10-2014, 09:43 AM #6
Jannik007
Do a barrel roll!
Sick !

Good Job Smile
05-10-2014, 09:51 AM #7
Mango_Knife
In my man cave
Originally posted by Shark View Post
hey guys, I have had this for a while but I'm deciding to release it because some people might find it useful for forge mode or whatever

Pastebin Link: You must login or register to view this content.

C# Code
    
class Offsets
{
public static uint
//G_Client
G_Client = 0x1780F28,
ClientOrigin = 0x28,
ClientAngles = 0x56BC,

//Entity
G_Entity = 0x16B9F20,
G_EntitySize = 0x31C,
G_SetOrigin = 0x279698,
Trace_GetEntityHitID = 0x306F30,
G_GetPlayerViewOrigin = 0x1E60D0,
G_LocationalTrace = 0x35C598;


public class Funcs
{
public static uint G_Client(int clientIndex, uint Mod = 0x00)
{
return (Offsets.G_Client + (UInt32)Mod) + ((uint)clientIndex * 0x580Cool Man (aka Tustin);
}
public static uint G_Entity(int entityIndex, uint Mod = 0x00)
{
return (Offsets.G_Entity + (UInt32)Mod) + ((uint)entityIndex * 0x31C);
}
}

public static byte[] ReverseBytes(byte[] toReverse)
{
Array.Reverse(toReverse);
return toReverse;
}

public static void WriteSingle(uint address, float[] input)
{
int length = input.Length;
byte[] array = new byte[length * 4];
for (int i = 0; i < length; i++)
{
ReverseBytes(BitConverter.GetBytes(input[i])).CopyTo(array, (int) (i * 4));
}
PS3.SetMemory(address, array);
}

public static float[] ReadSingle(uint address, int length)
{
byte[] memory = PS3.GetMemory(address, length * 4);
ReverseBytes(memory);
float[] numArray = new float[length];
for (int i = 0; i < length; i++)
{
numArray[i] = BitConverter.ToSingle(memory, ((length - 1) - i) * 4);
}
return numArray;
}

public static float[] PlayerAnglesToForward(int clientIndex, float Distance = 200f)
{
float[] Angles = Lib.ReadSingle(Offsets.Funcs.G_Client(clientIndex, Offsets.ClientAngles), 3);
float[] Position = Lib.ReadSingle(Offsets.Funcs.G_Client(clientIndex, Offsets.ClientOrigin), 3);
float angle, sr, sp, sy, cr, cp, cy, PiDiv;
PiDiv = ((float)Math.PI / 180f);
angle = Angles[1] * PiDiv;
sy = (float)Math.Sin(angle);
cy = (float)Math.Cos(angle);
angle = Angles[0] * PiDiv;
sp = (float)Math.Sin(angle);
cp = (float)Math.Cos(angle);
angle = Angles[2] * PiDiv;
sr = (float)Math.Sin(angle);
cr = (float)Math.Cos(angle);
float[] Forward = new float[] { (cp * cy * Distance) + Position[0], (cp * sy * Distance) + Position[1], (-sp * Distance) + Position[2] };
return Forward;
}

public static void setPlayerPosition(int clientIndex, float[] Pos)
{
Lib.WriteSingle(Offsets.Funcs.G_Client(clientIndex, Offsets.ClientOrigin), Pos);
}

public static float[] G_GetPlayerViewOrigin(int clientIndex)
{
PS3.SetMemory(0x2600250, new byte[0xC]);
RPC.Call(Offsets.G_GetPlayerViewOrigin, Offsets.Funcs.G_Client(clientIndex), 0x2600250);
return Lib.ReadSingle(0x2600250, 3);
}

public static void G_LocationalTrace(int clientIndex, int Trace, float[] Start, float[] End)
{
RPC.Call(Offsets.G_LocationalTrace, Trace, Start, End, clientIndex, 0x280E8B3, 0);
}

public static int Trace_GetEntityHitId(int Trace)
{
return RPC.Call(Offsets.Trace_GetEntityHitID, Trace);
}

public static int TraceEntity(int clientIndex, float TracerDistance)
{
int Trace = 0x25D2B00;
float[] Start = G_GetPlayerViewOrigin(clientIndex);
float[] End = PlayerAnglesToForward(clientIndex, TracerDistance);
G_LocationalTrace(clientIndex, Trace, Start, End);
int Entity = Trace_GetEntityHitId(Trace) & 0xFFFF;
if (Entity < 0x3FE)
{ Entity = (int)Offsets.Funcs.G_Entity(Entity); }
else
{ Entity = 0; }
return Entity;
}

public static float[] TraceBullet(int clientIndex, float TracerDistance)
{
int Trace = 0x25D2B00;
float[] Start = G_GetPlayerViewOrigin(clientIndex);
float[] End = PlayerAnglesToForward(clientIndex, TracerDistance);
G_LocationalTrace(clientIndex, Trace, Start, End);
float[] BulletTrace = new float[3];
BulletTrace = new float[] { (((End[0] - Start[0]) * Lib.ReadSingle((uint)Trace + 0x10) + Start[0])), (((End[1] - Start[1]) * Lib.ReadSingle((uint)Trace + 0x10) + Start[1])), (((End[2] - Start[2]) * Lib.ReadSingle((uint)Trace + 0x10) + Start[2])) };
return BulletTrace;
}


How To Use
    
[B]Teleport Gun[/B]
------------------------
SetPlayerPosition(clientIndex, TraceBullet(clientIndex, TracerDistance));

[B]Get Ent ID[/B]
------------------------
MessageBox.Show("Ent ISad Awesome " + TraceEntity(clientIndex, TracerDistance));
//If It returns 0 then you are not looking at an entity... but I'm sure you know this already.


Explanation of The Args
    
clientIndex = If you don't know what this is then go back to OFW.
TracerDistance = The Distance the trace will go before it ends, I use 999999 for teleport gun.


What You Can Use This For
    
Teleport Gun, like in Enstone's menu.
Forge Mode
Teleport To Crosshairs
Spawning Entities To Your Crosshair
MagicBullet
Shoot FX
Lots of other things.... just use your imagination

Credits
    
James - For helping me with this on ghosts and his C++ AnglesToForward Function
Therifboy - For bullet trace struct and GetEntID on ghost


Are you sure, that ReadSingle is taking 1 Argument?
    Lib.ReadSingle((uint)Trace + 0x10)

it need to be
    Lib.ReadSingle(((uint)Trace + 0x10),3)
? Dosent it?
05-10-2014, 10:16 AM #8
Shark
Retired.
Originally posted by B777x View Post
i got a error

You must login or register to view this content.


Originally posted by Knife View Post
Are you sure, that ReadSingle is taking 1 Argument?
    Lib.ReadSingle((uint)Trace + 0x10)

it need to be
    Lib.ReadSingle(((uint)Trace + 0x10),3)
? Dosent it?


mango the library has 2 types of readsingle, but doing Lib.ReadSingle((uint)Trace + 0x10, 1) is the same thing.
05-10-2014, 10:24 AM #9
Mango_Knife
In my man cave
Originally posted by Shark View Post
mango the library has 2 types of readsingle, but doing Lib.ReadSingle((uint)Trace + 0x10, 1) is the same thing.


when im doing what you said, im getting this:
You must login or register to view this content.
but when im not using the ",1" im getting an error, because the ReadSingle is taking 2 arguments, sooo how exectly i code it?
05-10-2014, 10:31 AM #10
Mango_Knife
In my man cave
mm never mind, i just used other ReadSingle Function:
                            private static float ReadSingle_1(uint address)
{
byte[] memory = GetMemory(address, 4);
Array.Reverse(memory, 0, 4);
return BitConverter.ToSingle(memory, 0);
}

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo