Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static uint G_Client(int Client, GClient Mod = 0)
- {
- return (Offsets.G_Client + (0x5808 * (uint)Client) + (uint)Mod);
- }
- public enum GClient : uint
- {
- ClientWeapIndex = 0x1B8,
- ClientVelocity = 0x34,
- ClientFriction = 0xC,
- ClientFreeze = 0x5694,
- ClientViewModel = 0x54F4,
- ClientButtonMonitoring = 0x569C,
- ClientPlayerName = 0x5544,
- ClientOrigin = 0x28,
- ClientAngles = 0x56BC,
- ClientTeam = 0x5504,
- ClientIsAlive = 0x55D0,
- ClientStance = 0xFC,
- ClientGodMode = 0x18,
- ClientPerks = 0x548,
- ClientPrimaryCamo = 0x2D8,
- ClientSecondaryCamo = 0x2BC,
- ClientTactical = 0x30C,
- ClientLethal = 0x2F0,
- ClientKillstreak1 = 0x42B,
- ClientKillstreak2 = 0x430,
- ClientKillstreak3 = 0x434,
- PrimaryAmmo = 0x43C,
- SecondaryAmmo = 0x438,
- LethalAmmo = 0x440,
- TacticalAmmo = 0x444,
- LocationSelectorMap = 0x4B0,
- LocationSelectorType = 0x4B4
- }
- public static uint G_Entity(int Client, uint Mod = 0)
- {
- return (Offsets.G_Entity + (0x31C * (uint)Client) + Mod);
- }
- public static int ReturnWeaponIndex(int Client)
- {
- return PS3.ReadInt32(G_Client(Client, GClient.ClientWeapIndex));
- }
- public static float[] ReturnVelocity(int Client)
- {
- return PS3.ReadSingle(G_Client(Client, GClient.ClientVelocity), 3);
- }
- public static void SetOrigin(int Client, float[] Origin)
- {
- PS3.WriteSingle(G_Client(Client, GClient.ClientOrigin), Origin);
- }
- public static float[] TraceBullet(int clientIndex, float TracerDistance)
- {
- int Trace = 0x25D2B00;
- float[] Start = G_GetPlayerViewOrigin(clientIndex);
- float[] End = PlayerAnglesToForward(clientIndex, TracerDistance);
- G_LocationalTrace(Trace, Start, End);
- float[] BulletTrace = new float[3];
- BulletTrace = new float[] { (((End[0] - Start[0]) * PS3.ReadFloat((uint)Trace + 0x10) + Start[0])), (((End[1] - Start[1]) * PS3.ReadFloat((uint)Trace + 0x10) + Start[1])), (((End[2] - Start[2]) * PS3.ReadFloat((uint)Trace + 0x10) + Start[2])) };
- return BulletTrace;
- }
- public static void SetClientViewAngles(int Client, float[] Angles)
- {
- PS3.WriteSingle(0x10004000, Angles);
- RPC.Call(Offsets.SetClientViewAngles, G_Entity(Client), Angles);
- }
- public enum Buttons : uint
- {
- X = 8192,
- O = 16384,
- Square = 4,
- L3 = 1088,
- R3 = 32,
- L2 = 256,
- R2 = 512,
- L1 = 2147487744,
- R1 = 128,
- Crouch = 16384,
- Prone = 32768,
- L1andR1 = L1 + R1
- }
- public static bool ButtonPressed(int clientIndex, Buttons Button)
- {
- byte[] Sticky = PS3.GetMem(Offsets.G_Client + 0x547C + ((uint)clientIndex * 0x5808), 4);
- uint Buttonz = BitConverter.ToUInt32(Sticky, 0);
- if (Buttonz == (uint)Button)
- return true;
- return false;
- }
- //AimBot
- public static void PlayerDie(int Client, int Victim, bool HeadShotsOnly = true)
- {
- if (HeadShotsOnly)
- RPC.Call(0x1FD510, G_Entity(Victim), G_Entity(Client), G_Entity(Client), 0, 9, ReturnWeaponIndex(Client), 0xD0143D6C);
- else
- RPC.Call(0x1FD510, G_Entity(Victim), G_Entity(Client), G_Entity(Client), 0, 0, ReturnWeaponIndex(Client), 0xD0143D6C);
- }
- //Carepackage Gun
- public static void CarePackageGun(int Client)
- {
- if (ButtonPressed(Client, Buttons.R1) || ButtonPressed(Client, Buttons.L1andR1))
- {
- Entity.spawnEntity("t6_wpn_supply_drop_ally", TraceBullet(Client, 9999f), G_GetPlayerViewOrigin(Client));
- }
- //Teleport Gun
- public static void TeleportGun(int Client)
- {
- if (ButtonPressed(Client, Buttons.R1) || ButtonPressed(Client, Buttons.L1andR1))
- {
- SetOrigin(Client, TraceBullet(Client, 9999f));
- }
- }
- //Advanced NoClip
- public static void AdvancedNoclip(int Client)
- {
- SetVelocity(Client, new float[] { ReturnVelocity(Client)[0], ReturnVelocity(Client)[1], 42.5f });
- if (ButtonPressed(Client, Buttons.L3))
- {
- SetOrigin(Client, PlayerAnglesToForward(Client, 85));
- }
- }
- //Spin Mode
- public static void SpinMode(int Client, float Speed, string Direction = "Right")
- {
- if (Direction == "Left")
- {
- for (float X = -180; X < 180; )
- {
- SetClientViewAngles(Client, new float[] { ReturnViewOrigin(Client)[0], X, ReturnViewOrigin(Client)[2] });
- X += (float)Speed;
- }
- }
- else if (Direction == "Right")
- {
- for (float X = 180; X > -180; )
- {
- SetClientViewAngles(Client, new float[] { ReturnViewOrigin(Client)[0], X, ReturnViewOrigin(Client)[2] });
- X += (float)Speed;
- }
- }
- }
- //WeaponDef
- public class Offsets
- {
- //BG_WeaponDef Offsets
- public static UInt32
- WeaponOffset = 0,
- BG_GetNumWeapons = 0x607084,
- BG_GetWeaponDef = 0x607098,
- weapTypet = 0x1C,
- weapClasst = 0x20,
- penetrateType_ = 0x24,
- ImpactType_ = 0x28,
- weapInventoryTypet = 0x2C,
- weapFireTypet = 0x30,
- OffhandClass_ = 0x34,
- weapStancet = 0x38;
- //Weapon Indexes
- public static UInt32
- DefaultWeap = 0,
- MP7 = 2,
- PDW = 4,
- Vector = 6,
- MSMC = 8,
- Chiqom = 10,
- Skorpian = 12,
- Peacekeeper = 14,
- MTAR = 16,
- TYPE25 = 18,
- SWAT = 20,
- FAL = 28,
- M27 = 32,
- SCAR = 36,
- SMR = 40,
- M8A1 = 44,
- AN94 = 48,
- Remington = 52,
- S12 = 53,
- KSG = 54,
- M1216 = 55,
- MK48 = 56,
- QBBLSW = 58,
- LSAT = 60,
- HAMR = 62,
- SVUAS = 64,
- DSR50 = 65,
- Ballista = 66,
- XPR50 = 67,
- KAP40 = 69,
- Tac45 = 71,
- Five7 = 72,
- Executioner = 74,
- B23R = 77,
- FiveSeven = 78,
- Tac45DW = 79,
- B23RDW = 80,
- ExecutionerDW = 81,
- KAP40DW = 82,
- SMAW = 84,
- FHJ18 = 85,
- RPG = 86,
- CombatKnife = 87,
- AssaultShield = 89,
- Crossbow = 90,
- BallisticKnife = 91;
- //WeaponDef classes
- public class weapFireType_t
- {
- public static UInt32
- Full_Auto = 1,
- Single_Shot = 2,
- Round_Burst2 = 3,
- Round_Burst3 = 4,
- Round_Burst4 = 5,
- Round_Burst5 = 6,
- StackedFire = 7,
- Minigun = 8,
- ChargedShot = 9,
- Jetgun = 10;
- }
- public class ImpactType
- {
- public static UInt32
- Impact_None = 1,
- Bullet_Small = 2,
- Bullet_Large = 3,
- Bullet_AP = 4,
- Bullet_Xtreme = 5,
- Shotgun = 6,
- Grenade_Bounce = 7,
- Grenade_Explode = 8,
- Rifle_Gernade = 9,
- Rocket_Explode = 10,
- Rocket_Explode_Xtreme = 11,
- Projectile_dud = 12,
- Mortar_Shell = 13,
- Tank_Shell = 14,
- Bolt = 15,
- Blade = 16,
- Grenade = 17,
- Rocket = 18,
- FlashBang = 19;
- }
- public class OffhandClass
- {
- public static UInt32
- Class_None = 1,
- Frag = 2,
- Smoke = 3,
- Flash = 4,
- Gear = 5,
- SupplyDropMarker = 6;
- }
- public class weapStance_t
- {
- public static UInt32
- Standing = 1,
- Duck = 2,
- Prone = 3;
- }
- public class weapInventoryType_t
- {
- public static UInt32
- Primary = 1,
- Offhand = 2,
- Item = 3,
- AltMode = 4,
- Melee = 5,
- dwLeftHand = 6;
- }
- public class weapClass_t
- {
- public static UInt32
- rifle = 1,
- mg = 2,
- smg = 3,
- spread = 4,
- pistol = 5,
- grenade = 6,
- rocketlauncher = 7,
- turret = 8,
- non_player = 9,
- gas = 10,
- item = 11,
- melee = 12,
- KillstreakStored = 13,
- pistol_Spread = 14;
- }
- public class weapType_t
- {
- public static UInt32
- Bullet = 1,
- Grenade = 2,
- Projectile = 3,
- Binoculars = 4,
- Gas = 5,
- Bomb = 6,
- Mine = 7,
- Melee = 8,
- RiotShield = 9;
- }
- public class penetrateType
- {
- public static UInt32
- none = 1,
- small = 2,
- medium = 3,
- large = 4;
- }
- }
- public static class Call
- {
- public static UInt32 BG_GetWeaponDef(UInt32 WeaponNum)
- {
- return RPC.Call(Offsets.BG_GetWeaponDef, WeaponNum);
- }
- public static UInt32 BG_GetNumWeapons(String WeaponName)
- {
- return RPC.Call(Offsets.BG_GetWeaponDef, WeaponName);
- }
- public static void ChangeweapType_t(UInt32 weapType)
- {
- PS3.Extension.WriteUInt32(Offsets.WeaponOffset + Offsets.weapTypet, weapType - 1);
- }
- public static void ChangeweapClass_t(UInt32 weapClass_t)
- {
- PS3.Extension.WriteUInt32(Offsets.WeaponOffset + Offsets.weapClasst, weapClass_t - 1);
- }
- public static void ChangepenetrateType(UInt32 penetrateType)
- {
- PS3.Extension.WriteUInt32(Offsets.WeaponOffset + Offsets.penetrateType_, penetrateType - 1);
- }
- public static void ChangeImpactType(UInt32 ImpactType)
- {
- PS3.Extension.WriteUInt32(Offsets.WeaponOffset + Offsets.ImpactType_, ImpactType - 1);
- }
- public static void ChangeweapInventoryType_t(UInt32 weapInventoryType_t)
- {
- PS3.Extension.WriteUInt32(Offsets.WeaponOffset + Offsets.weapInventoryTypet, weapInventoryType_t - 1);
- }
- public static void ChangeweapFireType_t(UInt32 weapFireType_t)
- {
- PS3.Extension.WriteUInt32(Offsets.WeaponOffset + Offsets.weapFireTypet, weapFireType_t - 1);
- }
- public static void ChangeOffhandClass(UInt32 OffhandClass)
- {
- PS3.Extension.WriteUInt32(Offsets.WeaponOffset + Offsets.OffhandClass_, OffhandClass - 1);
- }
- public static void ChangeweapStance_t(UInt32 weapStance_t)
- {
- PS3.Extension.WriteUInt32(Offsets.WeaponOffset + Offsets.weapStancet, weapStance_t - 1);
- }
- }
- }
- //G_GetWeaponIndexForName
- public static Int32 G_GetWeaponIndexForName(string Weapon)
- {
- return RPC.Call(0x2A6BE8, 0x2100050, Weapon);
- }
- //cBuff_AddText
- public static void Cbuf_AddText(string Command)
- {
- RPC.Call(0x313E88, 0, Command);
- }
- //SV_GameSendServerCommand
- public static void SV_GameSendServerCommand(Int32 clientIndex, String Command)
- {
- RPC.Call(0x34A1DC, clientIndex, 0, Command);
- }
- //iPrintln/iPrintlnBold
- public static void iPrintln(Int32 client, String Text)
- {
- SV_GameSendServerCommand(client, "O \"" + Text + "\"");
- }
- public static void iPrintlnBold(Int32 client, String Text)
- {
- SV_GameSendServerCommand(client, "< \"" + Text + "\"");
- }
- //Blur Vision
- public static void SetVision(int clientIndex, string Vision, string TransitionTime)
- {
- SV_GameSendServerCommand(clientIndex, "2 1060 \"" + Vision + "\" " + TransitionTime);
- }
- public static void setBlur(Int32 transitionTime, Single Strength)
- {
- SV_GameSendServerCommand(0, "( " + transitionTime + " " + Strength);
- }
- //onPlayerSpawned/onPlayerDied
- //Run This Function In A Loop
- public static Boolean onPlayerDied(Int32 clientIndex)
- {
- if (Lib.ReadInt32(G_Client(clientIndex, 0x55D0)) == 1)
- return true;
- return false;
- }
- public static Boolean onPlayerSpawned(Int32 clientIndex)
- {
- if (onPlayerDied(clientIndex))
- if (Lib.ReadInt32(G_Client(clientIndex, 0x55D0)) == 0)
- return true;
- return false;
- }
- //Play Sound
- public static void playSound(Int32 clientIndex, String soundName)
- {
- Int32 soundIndex = RPC.Call(Offsets.G_SoundAliasIndex, soundName);
- Functions.SV_GameSendServerCommand(clientIndex, "B " + soundIndex);
- }
- //Get Tag Origin
- public static Single[] GetTagOrigin(Int32 entityIndex, String tagName)
- {
- Int32 Entity = (Int32)G_Entity(entityIndex);
- Int32 tagId = RPC.Call(0x48F108, tagName.ToLower(), 0);//SL_GetString
- RPC.Call(0x2781A4, Entity, tagId, 0x2600270);//G_DObjGetWorldTagPos
- return Lib.ReadSingle(0x2600270, 3);//Returns Origin
- }
- //AnglesToForward & PlayerAnglesToForward
- public static float[] AnglesToForward(float[] Angles, float Distance = 200f)
- {
- 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), (cp * sy * Distance), (-sp * Distance) };
- return Forward;
- }
- public static float[] PlayerAnglesToForward(int clientIndex, float Distance = 200f)
- {
- float[] Angles = Lib.ReadSingle(G_Client(clientIndex, 0x56BC), 3);
- float[] Position = Lib.ReadSingle(G_Client(clientIndex, 0x28), 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;
- }
- //Vector Functions
- public static float[] vectoangles(float[] Angles)
- {
- float forward;
- float yaw, pitch;
- float[] angles = new float[3];
- if (Angles[1] == 0 && Angles[0] == 0)
- {
- yaw = 0;
- if (Angles[2] > 0) pitch = 90f;
- else pitch = 270f;
- }
- else
- {
- if (Angles[0] != -1) yaw = (float)(Math.Atan2((double)Angles[1], (double)Angles[0]) * 180f / Math.PI);
- else if (Angles[1] > 0) yaw = 90f;
- else yaw = 270;
- if (yaw < 0) yaw += 360f;
- forward = (float)Math.Sqrt((double)(Angles[0] * Angles[0] + Angles[1] * Angles[1]));
- pitch = (float)(Math.Atan2((double)Angles[2], (double)forward) * 180f / Math.PI);
- if (pitch < 0) pitch += 360f;
- }
- angles[0] = -pitch;
- angles[1] = yaw;
- angles[2] = 0;
- return angles;
- }
- public static float[] getVector(float[] point1, float[] point2)
- {
- return new float[] { (point2[0] - point1[0]), (point2[1] - point1[1]), (point2[2] - point1[2]) };
- }
- public static float Distance3D(float[] point1, float[] point2)
- {
- float deltax = point2[0] - point1[0];
- float deltay = point2[1] - point1[1];
- float deltaz = point2[2] - point1[2];
- return Convert.ToSingle(Math.Sqrt((deltax * deltax) + (deltay * deltay) + (deltaz * deltaz)));
- }
- public static float Distance2D(float[] point1, float[] point2)
- {
- float deltax = point2[0] - point1[0];
- float deltaz = point2[1] - point1[1];
- return Convert.ToSingle(Math.Sqrt((deltax * deltax) + (deltaz * deltaz)));
- }
- public static float VecDistance3D(Single[] Vector)
- {
- return Convert.ToSingle(Math.Sqrt((Vector[0] * Vector[0]) + (Vector[1] * Vector[1]) + (Vector[2] * Vector[2])));
- }
- public static Single[] VecMultiply(Single[] Vector, Single Value)
- {
- return new Single[] { Vector[0] *= Value, Vector[1] *= Value, Vector[2] *= Value };
- }
- public static void vec_scale(float[] vec, float scale, out float[] Forward)
- {
- Forward = new float[] { vec[0] * scale, vec[1] * scale, vec[2] * scale };
- }
- //Fair Aimbot
- public static float[] getPlayerPosition(int clientIndex)
- {
- float[] Position = Lib.ReadSingle(G_Client(clientIndex, 0x28), 3);
- return Position;
- }
- public static uint G_Client(int clientIndex, uint Mod = 0x00)
- {
- return (0x1780F28 + (UInt32)Mod) + ((uint)clientIndex * 0x5808);
- }
- public static uint G_Entity(int entityIndex, uint Mod = 0x00)
- {
- return (0x16B9F20 + (UInt32)Mod) + ((uint)entityIndex * 0x31C);
- }
- public static bool ClientIsSameTeam(int clientIndex, int otherPlayer)
- {
- return (Lib.ReadInt32(G_Client(clientIndex, 0x5504)) == Lib.ReadInt32(G_Client(otherPlayer, 0x5504)));
- }
- public static bool ClientIsInGame(int clientIndex)
- {
- return (Lib.ReadInt32(G_Client(clientIndex, 0x00)) != 0);
- }
- public static bool ClientIsAlive(int clientIndex)
- {
- return (Lib.ReadInt32(G_Client(clientIndex, 0x55D0)) == 0);
- }
- public static float[] vectoangles(float[] Angles)
- {
- float forward;
- float yaw, pitch;
- float[] angles = new float[3];
- if (Angles[1] == 0 && Angles[0] == 0)
- {
- yaw = 0;
- if (Angles[2] > 0) pitch = 90f;
- else pitch = 270f;
- }
- else
- {
- if (Angles[0] != -1) yaw = (float)(Math.Atan2((double)Angles[1], (double)Angles[0]) * 180f / Math.PI);
- else if (Angles[1] > 0) yaw = 90f;
- else yaw = 270;
- if (yaw < 0) yaw += 360f;
- forward = (float)Math.Sqrt((double)(Angles[0] * Angles[0] + Angles[1] * Angles[1]));
- pitch = (float)(Math.Atan2((double)Angles[2], (double)forward) * 180f / Math.PI);
- if (pitch < 0) pitch += 360f;
- }
- angles[0] = -pitch;
- angles[1] = yaw;
- angles[2] = 0;
- return angles;
- }
- public static float[] getVector(float[] point1, float[] point2)
- {
- return new float[] { (point2[0] - point1[0]), (point2[1] - point1[1]), (point2[2] - point1[2]) };
- }
- public static float Distance3D(float[] point1, float[] point2)
- {
- float deltax = point2[0] - point1[0];
- float deltay = point2[1] - point1[1];
- float deltaz = point2[2] - point1[2];
- return Convert.ToSingle(Math.Sqrt((deltax * deltax) + (deltay * deltay) + (deltaz * deltaz)));
- }
- public static float Distance2D(float[] point1, float[] point2)
- {
- float deltax = point2[0] - point1[0];
- float deltaz = point2[1] - point1[1];
- return Convert.ToSingle(Math.Sqrt((deltax * deltax) + (deltaz * deltaz)));
- }
- public static void vec_scale(float[] vec, float scale, out float[] Forward)
- {
- Forward = new float[] { vec[0] * scale, vec[1] * scale, vec[2] * scale };
- }
- public static int GetNearestPlayer(Int32 clientIndex, Boolean EnemyOnly = false)
- {
- int nearestClient = 0;
- float nearestDistance = 99999999;
- for (int i = 0; i < 12; i++)
- {
- if (i != clientIndex)
- {
- if ((ClientIsInGame(i)) && ClientIsAlive(i))
- {
- if (Lib.ReadInt32(G_Client(clientIndex, 0x5504)) != 0 && EnemyOnly)
- {
- if (!ClientIsSameTeam(clientIndex, i))
- {
- float Distance = Distance3D(getPlayerPosition(clientIndex), getPlayerPosition(i));
- if (Distance < nearestDistance)
- {
- nearestDistance = Distance;
- nearestClient = i;
- }
- }
- }
- else
- {
- float Distance = Distance3D(getPlayerPosition(clientIndex), getPlayerPosition(i));
- if (Distance < nearestDistance)
- {
- nearestDistance = Distance;
- nearestClient = i;
- }
- }
- }
- }
- }
- return nearestClient;
- }
- public static bool[] AimbotStatus = new bool[12];
- public static Thread[] AimbotThread = new Thread[12];
- private static float CheckStance(int clientIndex)
- {
- Int32 CurrentStance = Lib.ReadByte(G_Client(clientIndex) + 0xFC + 0x03);
- if (CurrentStance == 0x08 || CurrentStance == 0x0A || CurrentStance == 0x48 || CurrentStance == 0x4A)
- { return 44f; }
- if (CurrentStance == 0x04 || CurrentStance == 0x06 || CurrentStance == 0x44 || CurrentStance == 0x46)
- { return 14f; }
- return 0f;
- }
- private static float CheckStanceAttacker(int clientIndex)
- {
- Int32 CurrentStance = Lib.ReadByte(G_Client(clientIndex) + 0xFC + 0x03);
- if (CurrentStance == 0x08 || CurrentStance == 0x0A || CurrentStance == 0x48 || CurrentStance == 0x4A)
- { return 46f; }
- if (CurrentStance == 0x04 || CurrentStance == 0x06 || CurrentStance == 0x44 || CurrentStance == 0x46)
- { return 18f; }
- return 0f;
- }
- private static void InitializeAimbot(int clientIndex)
- {
- PS3.Reconnect();
- while (AimbotStatus[clientIndex])
- {
- int nearestPlayer = GetNearestPlayer(clientIndex);
- if (nearestPlayer != clientIndex)
- {
- if (UnfairAimbot[clientIndex] == false && AimingRequired[clientIndex] == false)
- {
- SetClientViewAngles(clientIndex, nearestPlayer);
- }
- }
- }
- }
- public static float[] PlayerAnglesToForward(int clientIndex, float Distance = 200f)
- {
- float[] Angles = Lib.ReadSingle(G_Client(clientIndex, 0x56BC), 3);
- float[] Position = Lib.ReadSingle(G_Client(clientIndex, 0x28), 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 float[] AnglesToForward(float[] Angles, float Distance = 200f)
- {
- 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), (cp * sy * Distance), (-sp * Distance) };
- return Forward;
- }
- private static void SetClientViewAngles(int clientIndex, int Victim)
- {
- float[] Vec = getVector(getPlayerPosition(clientIndex), getPlayerPosition(Victim));
- Vec[2] -= CheckStance(Victim);
- Vec[2] += CheckStanceAttacker(clientIndex);
- float[] Angles = vectoangles(Vec);
- setViewAngles((UInt32)clientIndex, Angles);
- }
- public static void setViewAngles(UInt32 clientIndex, float[] Angles)
- {
- Lib.WriteSingle(0x10040000, Angles);
- RPC.Call(0x1E1D90, G_Entity((Int32)clientIndex), 0x10040000);
- }
- public static float[] getViewAngles(int clientIndex)
- {
- return Lib.ReadSingle(G_Client(clientIndex, 0x56BC), 3);
- }
- //Entity Attach
- public static void G_EntAttach(Int32 entityIndex, String modelName, String tagName)
- {
- Int32 tag = RPC.Call(0x48EAB8, tagName);//SL_FindLowercaseString(const char* string)
- RPC.Call(0x27783C, G_Entity(entityIndex), modelName, tag, 0); //G_EntAttach(gentity_s *ent, cont char *modelName, unsigned int tagName, int ignoreCollision);
- }
- //Spawn Entity
- public static UInt32 spawnEntity(String ModelName, Single[] Origin, Single[] Angles)
- {
- UInt32 Entity = (UInt32)RPC.Call(0x278C60);//G_Spawn
- Lib.WriteSingle(Entity + 0x134, Origin);//Sets Entity Origin
- Lib.WriteSingle((Entity + 0x140), Angles);//Sets Entity Angles
- RPC.Call(0x277644, Entity, ModelName);//G_SetModel
- RPC.Call(0x2670E8, Entity);//SP_Script_model
- return Entity;//Returns Entity Index
- }
- //InGameKeyboard
- public static String char_to_wchar(String text)
- {
- String wchar = text;
- for (Int32 i = 0; i < text.Length; i++)
- {
- wchar = wchar.Insert(i * 2, "\0");
- }
- return wchar;
- }
- public static String doKeyboard(Int32 KeyboardType = 2, String Title = "Title", String PresetText = "", Int32 MaxLength = 20)
- {
- WriteByte(0x467507, (Byte)KeyboardType);
- RPC.Call(0x4674AC, 0xD67E980, char_to_wchar(Title), char_to_wchar(PresetText), MaxLength, 0xD57560);
- while (ReadInt32(0xD82140) != 0)
- continue;
- return ReadString(0x03090E22);
- }
- //DPAD Monitoring
- public static UInt32
- DPADUp = 0x34,
- DPADDown = 0x38,
- DPADLeft = 0x3C,
- DPADRight = 0x40;
- public static bool DetectButton(int clientIndex, uint Button)
- {
- Int32 ButtonIndex = PS3.Extensions.ReadInt32(0x94641C + Button);
- Int32 B1 = PS3.Extensions.ReadInt32(G_Client(clientIndex) + 0x56B8);
- Int32 B2 = PS3.Extensions.ReadInt32(G_Client(clientIndex) + 0x56A0);
- if ((B1 == ButtonIndex) || (B2 == ButtonIndex))
- return true;
- return false;
- }
- //BulletTrace
- public static float[] G_GetPlayerViewOrigin(int clientIndex)
- {
- PS3.SetMemory(0x2600250, new byte[0xC]);
- RPC.Call(0x1E60D0, G_Client(clientIndex), 0x2600250);
- return ReadSingle(0x2600250, 3);
- }
- public static void G_LocationalTrace(int Trace, float[] Start, float[] End)
- {
- RPC.Call(0x35C5A8, Trace, Start, End, 0, 0x280E8B3, 0);
- }
- public static int Trace_GetEntityHitId(int Trace)
- {
- return RPC.Call(0x306F30, Trace);
- }
- public static int TraceEntity(int clientIndex, float TracerDistance)
- {
- int Trace = 0x25D2B00;
- float[] Start = G_GetPlayerViewOrigin(clientIndex);
- float[] End = PlayerAnglesToForward(clientIndex, TracerDistance);
- G_LocationalTrace(Trace, Start, End);
- int Entity = Trace_GetEntityHitId(Trace) & 0xFFFF;
- if (Entity < 0x3FE)
- { Entity = (int)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(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;
- }
- //PreCache Shader
- public static int precacheShader(string Shader)
- {
- Lib.WriteInt32(0x1608100 + 0x40, 1);
- return RPC.Call(0x276020, Shader);
- }
- //RPC
- //Enable By Calling Init(); , Not Enable();
- private static uint function_address;
- public static int Call(uint func_address, params object[] parameters)
- {
- int length = parameters.Length;
- int index = 0;
- uint num3 = 0;
- uint num4 = 0;
- uint num5 = 0;
- uint num6 = 0;
- while (index < length)
- {
- if (parameters[index] is int)
- {
- PS3.Extension.WriteInt32(0x10020000 + (num3 * 4), (int)parameters[index]);
- num3++;
- }
- else if (parameters[index] is uint)
- {
- PS3.Extension.WriteUInt32(0x10020000 + (num3 * 4), (uint)parameters[index]);
- num3++;
- }
- else
- {
- uint num7;
- if (parameters[index] is string)
- {
- num7 = 0x10022000 + (num4 * 0x400);
- PS3.Extension.WriteString(num7, Convert.ToString(parameters[index]));
- PS3.Extension.WriteUInt32(0x10020000 + (num3 * 4), num7);
- num3++;
- num4++;
- }
- else if (parameters[index] is float)
- {
- PS3.Extension.WriteFloat(0x10020024 + (num5 * 4), (float)parameters[index]);
- num5++;
- }
- else if (parameters[index] is float[])
- {
- float[] input = (float[])parameters[index];
- num7 = 0x10021000 + (num6 * 4);
- Lib.WriteSingle(num7, input);
- PS3.Extension.WriteUInt32(0x10020000 + (num3 * 4), num7);
- num3++;
- num6 += (uint)input.Length;
- }
- }
- index++;
- }
- PS3.Extension.WriteUInt32(0x1002004C, func_address);
- Thread.Sleep(20);
- return PS3.Extension.ReadInt32(0x10020050);
- }
- public static void Enable()
- {
- PS3.SetMemory(function_address, new byte[] { 0x4E, 0x80, 0x00, 0x20 });
- Thread.Sleep(20);
- byte[] memory = new byte[]
- { 0x7C, 0x08, 0x02, 0xA6, 0xF8, 0x01, 0x00, 0x80, 0x3C, 0x60, 0x10, 0x02, 0x81, 0x83, 0x00, 0x4C,
- 0x2C, 0x0C, 0x00, 0x00, 0x41, 0x82, 0x00, 0x64, 0x80, 0x83, 0x00, 0x04, 0x80, 0xA3, 0x00, 0x08,
- 0x80, 0xC3, 0x00, 0x0C, 0x80, 0xE3, 0x00, 0x10, 0x81, 0x03, 0x00, 0x14, 0x81, 0x23, 0x00, 0x18,
- 0x81, 0x43, 0x00, 0x1C, 0x81, 0x63, 0x00, 0x20, 0xC0, 0x23, 0x00, 0x24, 0xc0, 0x43, 0x00, 0x28,
- 0xC0, 0x63, 0x00, 0x2C, 0xC0, 0x83, 0x00, 0x30, 0xC0, 0xA3, 0x00, 0x34, 0xc0, 0xC3, 0x00, 0x38,
- 0xC0, 0xE3, 0x00, 0x3C, 0xC1, 0x03, 0x00, 0x40, 0xC1, 0x23, 0x00, 0x48, 0x80, 0x63, 0x00, 0x00,
- 0x7D, 0x89, 0x03, 0xA6, 0x4E, 0x80, 0x04, 0x21, 0x3C, 0x80, 0x10, 0x02, 0x38, 0xA0, 0x00, 0x00,
- 0x90, 0xA4, 0x00, 0x4C, 0x90, 0x64, 0x00, 0x50, 0xE8, 0x01, 0x00, 0x80, 0x7C, 0x08, 0x03, 0xA6,
- 0x38, 0x21, 0x00, 0x70, 0x4E, 0x80, 0x00, 0x20 };
- PS3.SetMemory(function_address + 4, memory);
- PS3.SetMemory(0x10020000, new byte[0x2854]);
- PS3.SetMemory(function_address, new byte[] { 0xF8, 0x21, 0xFF, 0x91 });
- }
- public static int Init()
- {
- function_address = 0x7AA1E0;
- Enable();
- return 0;
- }
- //Player_Die
- public static void Player_Die(int Killer, int Victim, int meansOfDeath = 18, int iWeapon = 0)
- {
- UInt32 Attacker = G_Entity(Killer);
- UInt32 Inflictor = G_Entity(Victim);
- RPC.Call(0x248F20, Inflictor, Attacker, Attacker, 0xFF, meansOfDeath, iWeapon, 0xD0300AD4C);
- Thread.Sleep(100);
- }
- //set/get view angles
- public static Single[] getClientViewAngles(Int32 clientIndex)
- {
- return Lib.ReadSingle(Offsets.Funcs.G_Client(clientIndex, 0x56BC), 3);
- }
- public static void setClientViewAngles(Int32 entityIndex, Single[] Angles)
- {
- if (Lib.ReadInt32((UInt32)entityIndex + 0x154) == 0)
- Console.Write("setClientViewAngles can only be called on players\n");
- else
- RPC.Call(Offsets.SetClientViewAngles, G_Entity(entityIndex), Angles);
- }
- //velocity
- //Velocity = Speed In A Certain Direction
- public static Single[] GetVelocity(Int32 clientIndex)
- {
- return Lib.ReadSingle(G_Client(clientIndex, 0x34), 3);
- }
- public static void SetVelocity(Int32 clientIndex, Single[] Velocity)
- {
- Lib.WriteSingle(G_Client(clientIndex, 0x34), 3);
- }
- //vibration
- public static void AddEvent(Int32 clientIndex, Int32 Event, Object eventParams)
- {
- RPC.Call(0x279950, G_Entity(clientIndex), Event, eventParams);
- }
- public static void playRumble(Int32 clientIndex, Int32 RumbleIndex)
- {
- if (RumbleIndex != 0)
- { AddEvent(clientIndex, 0x70, RumbleIndex); }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement