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, 10:31 AM #11
B777x
Hurah!
Originally posted by Knife View Post
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?


maybe ??
    
public static float ReadSingle(uint offset)
{
byte[] bytes = DEX.GetMemory(offset, 4);
Array.Reverse(bytes, 0, 4);
return BitConverter.ToSingle(bytes, 0);
}
05-10-2014, 10:38 AM #12
Mango_Knife
In my man cave
Originally posted by B777x View Post
maybe ??
    
public static float ReadSingle(uint offset)
{
byte[] bytes = DEX.GetMemory(offset, 4);
Array.Reverse(bytes, 0, 4);
return BitConverter.ToSingle(bytes, 0);
}


Same shit, just change the name of it, its not really matter..
05-10-2014, 01:23 PM #13
Shark
Retired.
Originally posted by Knife View Post
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?


oh my bad, forgot it takes a float[] arg, ya just use other read single function, the readfloat function in ps3lib works to :p
05-11-2014, 03:58 AM #14
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 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


These functions are fucked up lol. The teleport gun makes my dude jump. lol
05-12-2014, 03:42 PM #15
Jannik007
Do a barrel roll!
Nice functions but where you got the Trace from?

You must login or register to view this content.
05-15-2014, 04:55 AM #16
Shark
Retired.
Originally posted by Jannik007 View Post
Nice functions but where you got the Trace from?

You must login or register to view this content.


trace is just where the return information is stored, it can be anywhere just as long as its a free space in the memory.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo