Advertisement
ScriptzMoDz

BO2 Mega Scripts List

Aug 25th, 2014
1,873
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 37.53 KB | None | 0 0
  1. public static uint G_Client(int Client, GClient Mod = 0)
  2.         {
  3.             return (Offsets.G_Client + (0x5808 * (uint)Client) + (uint)Mod);
  4.         }
  5. public enum GClient : uint
  6.         {
  7.             ClientWeapIndex = 0x1B8,
  8.             ClientVelocity = 0x34,
  9.             ClientFriction = 0xC,
  10.             ClientFreeze = 0x5694,
  11.             ClientViewModel = 0x54F4,
  12.             ClientButtonMonitoring = 0x569C,
  13.             ClientPlayerName = 0x5544,
  14.             ClientOrigin = 0x28,
  15.             ClientAngles = 0x56BC,
  16.             ClientTeam = 0x5504,
  17.             ClientIsAlive = 0x55D0,
  18.             ClientStance = 0xFC,
  19.             ClientGodMode = 0x18,
  20.             ClientPerks = 0x548,
  21.             ClientPrimaryCamo = 0x2D8,
  22.             ClientSecondaryCamo = 0x2BC,
  23.             ClientTactical = 0x30C,
  24.             ClientLethal = 0x2F0,
  25.             ClientKillstreak1 = 0x42B,
  26.             ClientKillstreak2 = 0x430,
  27.             ClientKillstreak3 = 0x434,
  28.             PrimaryAmmo = 0x43C,
  29.             SecondaryAmmo = 0x438,
  30.             LethalAmmo = 0x440,
  31.             TacticalAmmo = 0x444,
  32.             LocationSelectorMap = 0x4B0,
  33.             LocationSelectorType = 0x4B4
  34.         }
  35.         public static uint G_Entity(int Client, uint Mod = 0)
  36.         {
  37.             return (Offsets.G_Entity + (0x31C * (uint)Client) + Mod);
  38.         }
  39.         public static int ReturnWeaponIndex(int Client)
  40.         {
  41.             return PS3.ReadInt32(G_Client(Client, GClient.ClientWeapIndex));
  42.         }
  43.         public static float[] ReturnVelocity(int Client)
  44.         {
  45.             return PS3.ReadSingle(G_Client(Client, GClient.ClientVelocity), 3);
  46.         }
  47.         public static void SetOrigin(int Client, float[] Origin)
  48.         {
  49.             PS3.WriteSingle(G_Client(Client, GClient.ClientOrigin), Origin);
  50.         }
  51.         public static float[] TraceBullet(int clientIndex, float TracerDistance)
  52.         {
  53.             int Trace = 0x25D2B00;
  54.             float[] Start = G_GetPlayerViewOrigin(clientIndex);
  55.             float[] End = PlayerAnglesToForward(clientIndex, TracerDistance);
  56.             G_LocationalTrace(Trace, Start, End);
  57.             float[] BulletTrace = new float[3];
  58.             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])) };
  59.             return BulletTrace;
  60.         }
  61.         public static void SetClientViewAngles(int Client, float[] Angles)
  62.         {
  63.             PS3.WriteSingle(0x10004000, Angles);
  64.             RPC.Call(Offsets.SetClientViewAngles, G_Entity(Client), Angles);
  65.         }
  66. public enum Buttons : uint
  67.         {
  68.             X = 8192,
  69.             O = 16384,
  70.             Square = 4,
  71.             L3 = 1088,
  72.             R3 = 32,
  73.             L2 = 256,
  74.             R2 = 512,
  75.             L1 = 2147487744,
  76.             R1 = 128,
  77.             Crouch = 16384,
  78.             Prone = 32768,
  79.             L1andR1 = L1 + R1
  80.         }
  81.         public static bool ButtonPressed(int clientIndex, Buttons Button)
  82.         {
  83.             byte[] Sticky = PS3.GetMem(Offsets.G_Client + 0x547C + ((uint)clientIndex * 0x5808), 4);
  84.             uint Buttonz = BitConverter.ToUInt32(Sticky, 0);
  85.             if (Buttonz == (uint)Button)
  86.                 return true;
  87.             return false;
  88.         }
  89.  
  90.  
  91. //AimBot
  92. public static void PlayerDie(int Client, int Victim, bool HeadShotsOnly = true)
  93.         {
  94.             if (HeadShotsOnly)
  95.                 RPC.Call(0x1FD510, G_Entity(Victim), G_Entity(Client), G_Entity(Client), 0, 9, ReturnWeaponIndex(Client), 0xD0143D6C);
  96.             else
  97.                 RPC.Call(0x1FD510, G_Entity(Victim), G_Entity(Client), G_Entity(Client), 0, 0, ReturnWeaponIndex(Client), 0xD0143D6C);
  98.         }
  99.  
  100. //Carepackage Gun
  101. public static void CarePackageGun(int Client)
  102.         {
  103.             if (ButtonPressed(Client, Buttons.R1) || ButtonPressed(Client, Buttons.L1andR1))
  104.             {
  105.                 Entity.spawnEntity("t6_wpn_supply_drop_ally", TraceBullet(Client, 9999f), G_GetPlayerViewOrigin(Client));
  106.             }
  107.  
  108. //Teleport Gun
  109. public static void TeleportGun(int Client)
  110.         {
  111.             if (ButtonPressed(Client, Buttons.R1) || ButtonPressed(Client, Buttons.L1andR1))
  112.             {
  113.                 SetOrigin(Client, TraceBullet(Client, 9999f));
  114.             }
  115.         }
  116.  
  117. //Advanced NoClip
  118. public static void AdvancedNoclip(int Client)
  119.         {
  120.             SetVelocity(Client, new float[] { ReturnVelocity(Client)[0], ReturnVelocity(Client)[1], 42.5f });
  121.  
  122.             if (ButtonPressed(Client, Buttons.L3))
  123.             {
  124.                 SetOrigin(Client, PlayerAnglesToForward(Client, 85));
  125.             }
  126.         }
  127.  
  128. //Spin Mode
  129.     public static void SpinMode(int Client, float Speed, string Direction = "Right")
  130.         {
  131.             if (Direction == "Left")
  132.             {
  133.                 for (float X = -180; X < 180; )
  134.                 {
  135.                     SetClientViewAngles(Client, new float[] { ReturnViewOrigin(Client)[0], X, ReturnViewOrigin(Client)[2] });
  136.                     X += (float)Speed;
  137.                 }
  138.             }
  139.  
  140.             else if (Direction == "Right")
  141.             {
  142.                 for (float X = 180; X > -180; )
  143.                 {
  144.                     SetClientViewAngles(Client, new float[] { ReturnViewOrigin(Client)[0], X, ReturnViewOrigin(Client)[2] });
  145.                     X += (float)Speed;
  146.                 }
  147.             }
  148.         }
  149.  
  150. //WeaponDef
  151.   public class Offsets
  152.         {
  153.             //BG_WeaponDef Offsets
  154.             public static UInt32
  155.                 WeaponOffset = 0,
  156.                 BG_GetNumWeapons = 0x607084,
  157.                 BG_GetWeaponDef = 0x607098,
  158.                 weapTypet = 0x1C,
  159.                 weapClasst = 0x20,
  160.                 penetrateType_ = 0x24,
  161.                 ImpactType_ = 0x28,
  162.                 weapInventoryTypet = 0x2C,
  163.                 weapFireTypet = 0x30,
  164.                 OffhandClass_ = 0x34,
  165.                 weapStancet = 0x38;
  166.  
  167.             //Weapon Indexes
  168.             public static UInt32
  169.                 DefaultWeap = 0,
  170.                 MP7 = 2,
  171.                 PDW = 4,
  172.                 Vector = 6,
  173.                 MSMC = 8,
  174.                 Chiqom = 10,
  175.                 Skorpian = 12,
  176.                 Peacekeeper = 14,
  177.                 MTAR = 16,
  178.                 TYPE25 = 18,
  179.                 SWAT = 20,
  180.                 FAL = 28,
  181.                 M27 = 32,
  182.                 SCAR = 36,
  183.                 SMR = 40,
  184.                 M8A1 = 44,
  185.                 AN94 = 48,
  186.                 Remington = 52,
  187.                 S12 = 53,
  188.                 KSG = 54,
  189.                 M1216 = 55,
  190.                 MK48 = 56,
  191.                 QBBLSW = 58,
  192.                 LSAT = 60,
  193.                 HAMR = 62,
  194.                 SVUAS = 64,
  195.                 DSR50 = 65,
  196.                 Ballista = 66,
  197.                 XPR50 = 67,
  198.                 KAP40 = 69,
  199.                 Tac45 = 71,
  200.                 Five7 = 72,
  201.                 Executioner = 74,
  202.                 B23R = 77,
  203.                 FiveSeven = 78,
  204.                 Tac45DW = 79,
  205.                 B23RDW = 80,
  206.                 ExecutionerDW = 81,
  207.                 KAP40DW = 82,
  208.                 SMAW = 84,
  209.                 FHJ18 = 85,
  210.                 RPG = 86,
  211.                 CombatKnife = 87,
  212.                 AssaultShield = 89,
  213.                 Crossbow = 90,
  214.                 BallisticKnife = 91;
  215.  
  216.             //WeaponDef classes
  217.             public class weapFireType_t
  218.             {
  219.                 public static UInt32
  220.                     Full_Auto = 1,
  221.                     Single_Shot = 2,
  222.                     Round_Burst2 = 3,
  223.                     Round_Burst3 = 4,
  224.                     Round_Burst4 = 5,
  225.                     Round_Burst5 = 6,
  226.                     StackedFire = 7,
  227.                     Minigun = 8,
  228.                     ChargedShot = 9,
  229.                     Jetgun = 10;
  230.             }
  231.  
  232.             public class ImpactType
  233.             {
  234.                 public static UInt32
  235.                     Impact_None = 1,
  236.                     Bullet_Small = 2,
  237.                     Bullet_Large = 3,
  238.                     Bullet_AP = 4,
  239.                     Bullet_Xtreme = 5,
  240.                     Shotgun = 6,
  241.                     Grenade_Bounce = 7,
  242.                     Grenade_Explode = 8,
  243.                     Rifle_Gernade = 9,
  244.                     Rocket_Explode = 10,
  245.                     Rocket_Explode_Xtreme = 11,
  246.                     Projectile_dud = 12,
  247.                     Mortar_Shell = 13,
  248.                     Tank_Shell = 14,
  249.                     Bolt = 15,
  250.                     Blade = 16,
  251.                     Grenade = 17,
  252.                     Rocket = 18,
  253.                     FlashBang = 19;
  254.             }
  255.  
  256.             public class OffhandClass
  257.             {
  258.                 public static UInt32
  259.                     Class_None = 1,
  260.                     Frag = 2,
  261.                     Smoke = 3,
  262.                     Flash = 4,
  263.                     Gear = 5,
  264.                     SupplyDropMarker = 6;
  265.             }
  266.  
  267.             public class weapStance_t
  268.             {
  269.                 public static UInt32
  270.                     Standing = 1,
  271.                     Duck = 2,
  272.                     Prone = 3;
  273.             }
  274.  
  275.             public class weapInventoryType_t
  276.             {
  277.                 public static UInt32
  278.                     Primary = 1,
  279.                     Offhand = 2,
  280.                     Item = 3,
  281.                     AltMode = 4,
  282.                     Melee = 5,
  283.                     dwLeftHand = 6;
  284.             }
  285.  
  286.             public class weapClass_t
  287.             {
  288.                 public static UInt32
  289.                     rifle = 1,
  290.                     mg = 2,
  291.                     smg = 3,
  292.                     spread = 4,
  293.                     pistol = 5,
  294.                     grenade = 6,
  295.                     rocketlauncher = 7,
  296.                     turret = 8,
  297.                     non_player = 9,
  298.                     gas = 10,
  299.                     item = 11,
  300.                     melee = 12,
  301.                     KillstreakStored = 13,
  302.                     pistol_Spread = 14;
  303.             }
  304.  
  305.             public class weapType_t
  306.             {
  307.                 public static UInt32
  308.                     Bullet = 1,
  309.                     Grenade = 2,
  310.                     Projectile = 3,
  311.                     Binoculars = 4,
  312.                     Gas = 5,
  313.                     Bomb = 6,
  314.                     Mine = 7,
  315.                     Melee = 8,
  316.                     RiotShield = 9;
  317.             }
  318.  
  319.             public class penetrateType
  320.             {
  321.                 public static UInt32
  322.                     none = 1,
  323.                     small = 2,
  324.                     medium = 3,
  325.                     large = 4;
  326.             }
  327.         }
  328.  
  329.         public static class Call
  330.         {
  331.             public static UInt32 BG_GetWeaponDef(UInt32 WeaponNum)
  332.             {
  333.                 return RPC.Call(Offsets.BG_GetWeaponDef, WeaponNum);
  334.             }
  335.             public static UInt32 BG_GetNumWeapons(String WeaponName)
  336.             {
  337.                 return RPC.Call(Offsets.BG_GetWeaponDef, WeaponName);
  338.             }
  339.             public static void ChangeweapType_t(UInt32 weapType)
  340.             {
  341.                 PS3.Extension.WriteUInt32(Offsets.WeaponOffset + Offsets.weapTypet, weapType - 1);
  342.             }
  343.             public static void ChangeweapClass_t(UInt32 weapClass_t)
  344.             {
  345.                 PS3.Extension.WriteUInt32(Offsets.WeaponOffset + Offsets.weapClasst, weapClass_t - 1);
  346.             }
  347.             public static void ChangepenetrateType(UInt32 penetrateType)
  348.             {
  349.                 PS3.Extension.WriteUInt32(Offsets.WeaponOffset + Offsets.penetrateType_, penetrateType - 1);
  350.             }
  351.             public static void ChangeImpactType(UInt32 ImpactType)
  352.             {
  353.                 PS3.Extension.WriteUInt32(Offsets.WeaponOffset + Offsets.ImpactType_, ImpactType - 1);
  354.             }
  355.             public static void ChangeweapInventoryType_t(UInt32 weapInventoryType_t)
  356.             {
  357.                 PS3.Extension.WriteUInt32(Offsets.WeaponOffset + Offsets.weapInventoryTypet, weapInventoryType_t - 1);
  358.             }
  359.             public static void ChangeweapFireType_t(UInt32 weapFireType_t)
  360.             {
  361.                 PS3.Extension.WriteUInt32(Offsets.WeaponOffset + Offsets.weapFireTypet, weapFireType_t - 1);
  362.             }
  363.             public static void ChangeOffhandClass(UInt32 OffhandClass)
  364.             {
  365.                 PS3.Extension.WriteUInt32(Offsets.WeaponOffset + Offsets.OffhandClass_, OffhandClass - 1);
  366.             }
  367.             public static void ChangeweapStance_t(UInt32 weapStance_t)
  368.             {
  369.                 PS3.Extension.WriteUInt32(Offsets.WeaponOffset + Offsets.weapStancet, weapStance_t - 1);
  370.             }
  371.         }
  372.      }
  373.  
  374. //G_GetWeaponIndexForName
  375.  
  376. public static Int32 G_GetWeaponIndexForName(string Weapon)
  377.         {
  378.             return RPC.Call(0x2A6BE8, 0x2100050, Weapon);
  379.         }
  380. //cBuff_AddText
  381. public static void Cbuf_AddText(string Command)
  382.         {
  383.             RPC.Call(0x313E88, 0, Command);
  384.         }
  385.  
  386. //SV_GameSendServerCommand
  387. public static void SV_GameSendServerCommand(Int32 clientIndex, String Command)
  388.         {
  389.             RPC.Call(0x34A1DC, clientIndex, 0, Command);
  390.         }
  391.  
  392. //iPrintln/iPrintlnBold
  393.   public static void iPrintln(Int32 client, String Text)
  394.         {
  395.             SV_GameSendServerCommand(client, "O \"" + Text + "\"");
  396.         }
  397.         public static void iPrintlnBold(Int32 client, String Text)
  398.         {
  399.             SV_GameSendServerCommand(client, "< \"" + Text + "\"");
  400.         }
  401.  
  402. //Blur Vision
  403. public static void SetVision(int clientIndex, string Vision, string TransitionTime)
  404.         {
  405.             SV_GameSendServerCommand(clientIndex, "2 1060 \"" + Vision + "\" " + TransitionTime);
  406.         }
  407.  
  408.         public static void setBlur(Int32 transitionTime, Single Strength)
  409.         {
  410.             SV_GameSendServerCommand(0, "( " + transitionTime + " " + Strength);
  411.         }
  412.  
  413. //onPlayerSpawned/onPlayerDied
  414. //Run This Function In A Loop
  415. public static Boolean onPlayerDied(Int32 clientIndex)
  416.         {
  417.             if (Lib.ReadInt32(G_Client(clientIndex, 0x55D0)) == 1)
  418.                 return true;
  419.             return false;
  420.         }
  421.  
  422.         public static Boolean onPlayerSpawned(Int32 clientIndex)
  423.         {
  424.             if (onPlayerDied(clientIndex))
  425.                 if (Lib.ReadInt32(G_Client(clientIndex, 0x55D0)) == 0)
  426.                     return true;
  427.             return false;
  428.         }
  429. //Play Sound
  430. public static void playSound(Int32 clientIndex, String soundName)
  431.         {
  432.             Int32 soundIndex = RPC.Call(Offsets.G_SoundAliasIndex, soundName);
  433.             Functions.SV_GameSendServerCommand(clientIndex, "B " + soundIndex);
  434.         }
  435.  
  436. //Get Tag Origin
  437. public static Single[] GetTagOrigin(Int32 entityIndex, String tagName)
  438.         {
  439.             Int32 Entity = (Int32)G_Entity(entityIndex);
  440.             Int32 tagId = RPC.Call(0x48F108, tagName.ToLower(), 0);//SL_GetString
  441.             RPC.Call(0x2781A4, Entity, tagId, 0x2600270);//G_DObjGetWorldTagPos
  442.             return Lib.ReadSingle(0x2600270, 3);//Returns Origin
  443.         }
  444.  
  445. //AnglesToForward & PlayerAnglesToForward
  446. public static float[] AnglesToForward(float[] Angles, float Distance = 200f)
  447.         {
  448.             float angle, sr, sp, sy, cr, cp, cy, PiDiv;
  449.             PiDiv = ((float)Math.PI / 180f);
  450.             angle = Angles[1] * PiDiv;
  451.             sy = (float)Math.Sin(angle);
  452.             cy = (float)Math.Cos(angle);
  453.             angle = Angles[0] * PiDiv;
  454.             sp = (float)Math.Sin(angle);
  455.             cp = (float)Math.Cos(angle);
  456.             angle = Angles[2] * PiDiv;
  457.             sr = (float)Math.Sin(angle);
  458.             cr = (float)Math.Cos(angle);
  459.             float[] Forward = new float[] { (cp * cy * Distance), (cp * sy * Distance), (-sp * Distance) };
  460.             return Forward;
  461.         }
  462.  
  463. public static float[] PlayerAnglesToForward(int clientIndex, float Distance = 200f)
  464.         {
  465.             float[] Angles = Lib.ReadSingle(G_Client(clientIndex, 0x56BC), 3);
  466.             float[] Position = Lib.ReadSingle(G_Client(clientIndex, 0x28), 3);
  467.             float angle, sr, sp, sy, cr, cp, cy, PiDiv;
  468.             PiDiv = ((float)Math.PI / 180f);
  469.             angle = Angles[1] * PiDiv;
  470.             sy = (float)Math.Sin(angle);
  471.             cy = (float)Math.Cos(angle);
  472.             angle = Angles[0] * PiDiv;
  473.             sp = (float)Math.Sin(angle);
  474.             cp = (float)Math.Cos(angle);
  475.             angle = Angles[2] * PiDiv;
  476.             sr = (float)Math.Sin(angle);
  477.             cr = (float)Math.Cos(angle);
  478.             float[] Forward = new float[] { (cp * cy * Distance) + Position[0], (cp * sy * Distance) + Position[1], (-sp * Distance) + Position[2] };
  479.             return Forward;
  480.         }
  481.  
  482. //Vector Functions
  483.    public static float[] vectoangles(float[] Angles)
  484.         {
  485.             float forward;
  486.             float yaw, pitch;
  487.             float[] angles = new float[3];
  488.             if (Angles[1] == 0 && Angles[0] == 0)
  489.             {
  490.                 yaw = 0;
  491.                 if (Angles[2] > 0) pitch = 90f;
  492.                 else pitch = 270f;
  493.             }
  494.             else
  495.             {
  496.                 if (Angles[0] != -1) yaw = (float)(Math.Atan2((double)Angles[1], (double)Angles[0]) * 180f / Math.PI);
  497.                 else if (Angles[1] > 0) yaw = 90f;
  498.                 else yaw = 270;
  499.                 if (yaw < 0) yaw += 360f;
  500.  
  501.                 forward = (float)Math.Sqrt((double)(Angles[0] * Angles[0] + Angles[1] * Angles[1]));
  502.                 pitch = (float)(Math.Atan2((double)Angles[2], (double)forward) * 180f / Math.PI);
  503.                 if (pitch < 0) pitch += 360f;
  504.             }
  505.             angles[0] = -pitch;
  506.             angles[1] = yaw;
  507.             angles[2] = 0;
  508.  
  509.             return angles;
  510.         }
  511.  
  512.         public static float[] getVector(float[] point1, float[] point2)
  513.         {
  514.             return new float[] { (point2[0] - point1[0]), (point2[1] - point1[1]), (point2[2] - point1[2]) };
  515.         }
  516.  
  517.         public static float Distance3D(float[] point1, float[] point2)
  518.         {
  519.             float deltax = point2[0] - point1[0];
  520.             float deltay = point2[1] - point1[1];
  521.             float deltaz = point2[2] - point1[2];
  522.             return Convert.ToSingle(Math.Sqrt((deltax * deltax) + (deltay * deltay) + (deltaz * deltaz)));
  523.         }
  524.  
  525.         public static float Distance2D(float[] point1, float[] point2)
  526.         {
  527.             float deltax = point2[0] - point1[0];
  528.             float deltaz = point2[1] - point1[1];
  529.             return Convert.ToSingle(Math.Sqrt((deltax * deltax) + (deltaz * deltaz)));
  530.         }
  531.  
  532.         public static float VecDistance3D(Single[] Vector)
  533.         {
  534.             return Convert.ToSingle(Math.Sqrt((Vector[0] * Vector[0]) + (Vector[1] * Vector[1]) + (Vector[2] * Vector[2])));
  535.         }
  536.  
  537.         public static Single[] VecMultiply(Single[] Vector, Single Value)
  538.         {
  539.             return new Single[] { Vector[0] *= Value, Vector[1] *= Value, Vector[2] *= Value };
  540.         }
  541.  
  542.         public static void vec_scale(float[] vec, float scale, out float[] Forward)
  543.         {
  544.             Forward = new float[] { vec[0] * scale, vec[1] * scale, vec[2] * scale };
  545.         }
  546.  
  547. //Fair Aimbot
  548.  public static float[] getPlayerPosition(int clientIndex)
  549.             {
  550.                 float[] Position = Lib.ReadSingle(G_Client(clientIndex, 0x28), 3);
  551.                 return Position;
  552.             }
  553.             public static uint G_Client(int clientIndex, uint Mod = 0x00)
  554.             {
  555.                 return (0x1780F28 + (UInt32)Mod) + ((uint)clientIndex * 0x5808);
  556.             }
  557.             public static uint G_Entity(int entityIndex, uint Mod = 0x00)
  558.             {
  559.                 return (0x16B9F20 + (UInt32)Mod) + ((uint)entityIndex * 0x31C);
  560.             }
  561.  
  562. public static bool ClientIsSameTeam(int clientIndex, int otherPlayer)
  563.         {
  564.             return (Lib.ReadInt32(G_Client(clientIndex, 0x5504)) == Lib.ReadInt32(G_Client(otherPlayer, 0x5504)));
  565.         }
  566.         public static bool ClientIsInGame(int clientIndex)
  567.         {
  568.             return (Lib.ReadInt32(G_Client(clientIndex, 0x00)) != 0);
  569.         }
  570.         public static bool ClientIsAlive(int clientIndex)
  571.         {
  572.             return (Lib.ReadInt32(G_Client(clientIndex, 0x55D0)) == 0);
  573.         }
  574.         public static float[] vectoangles(float[] Angles)
  575.         {
  576.             float forward;
  577.             float yaw, pitch;
  578.             float[] angles = new float[3];
  579.             if (Angles[1] == 0 && Angles[0] == 0)
  580.             {
  581.                 yaw = 0;
  582.                 if (Angles[2] > 0) pitch = 90f;
  583.                 else pitch = 270f;
  584.             }
  585.             else
  586.             {
  587.                 if (Angles[0] != -1) yaw = (float)(Math.Atan2((double)Angles[1], (double)Angles[0]) * 180f / Math.PI);
  588.                 else if (Angles[1] > 0) yaw = 90f;
  589.                 else yaw = 270;
  590.                 if (yaw < 0) yaw += 360f;
  591.  
  592.                 forward = (float)Math.Sqrt((double)(Angles[0] * Angles[0] + Angles[1] * Angles[1]));
  593.                 pitch = (float)(Math.Atan2((double)Angles[2], (double)forward) * 180f / Math.PI);
  594.                 if (pitch < 0) pitch += 360f;
  595.             }
  596.             angles[0] = -pitch;
  597.             angles[1] = yaw;
  598.             angles[2] = 0;
  599.  
  600.             return angles;
  601.         }
  602.         public static float[] getVector(float[] point1, float[] point2)
  603.         {
  604.             return new float[] { (point2[0] - point1[0]), (point2[1] - point1[1]), (point2[2] - point1[2]) };
  605.         }
  606.         public static float Distance3D(float[] point1, float[] point2)
  607.         {
  608.             float deltax = point2[0] - point1[0];
  609.             float deltay = point2[1] - point1[1];
  610.             float deltaz = point2[2] - point1[2];
  611.             return Convert.ToSingle(Math.Sqrt((deltax * deltax) + (deltay * deltay) + (deltaz * deltaz)));
  612.         }
  613.         public static float Distance2D(float[] point1, float[] point2)
  614.         {
  615.             float deltax = point2[0] - point1[0];
  616.             float deltaz = point2[1] - point1[1];
  617.             return Convert.ToSingle(Math.Sqrt((deltax * deltax) + (deltaz * deltaz)));
  618.         }
  619.         public static void vec_scale(float[] vec, float scale, out float[] Forward)
  620.         {
  621.             Forward = new float[] { vec[0] * scale, vec[1] * scale, vec[2] * scale };
  622.         }
  623.         public static int GetNearestPlayer(Int32 clientIndex, Boolean EnemyOnly = false)
  624.         {
  625.             int nearestClient = 0;
  626.             float nearestDistance = 99999999;
  627.             for (int i = 0; i < 12; i++)
  628.             {
  629.                 if (i != clientIndex)
  630.                 {
  631.                     if ((ClientIsInGame(i)) && ClientIsAlive(i))
  632.                     {
  633.                         if (Lib.ReadInt32(G_Client(clientIndex, 0x5504)) != 0 && EnemyOnly)
  634.                         {
  635.                             if (!ClientIsSameTeam(clientIndex, i))
  636.                             {
  637.                                 float Distance = Distance3D(getPlayerPosition(clientIndex), getPlayerPosition(i));
  638.                                 if (Distance < nearestDistance)
  639.                                 {
  640.                                     nearestDistance = Distance;
  641.                                     nearestClient = i;
  642.                                 }
  643.                             }
  644.                         }
  645.                         else
  646.                         {
  647.                             float Distance = Distance3D(getPlayerPosition(clientIndex), getPlayerPosition(i));
  648.                             if (Distance < nearestDistance)
  649.                             {
  650.                                 nearestDistance = Distance;
  651.                                 nearestClient = i;
  652.                             }
  653.                         }
  654.                     }
  655.                 }
  656.             }
  657.             return nearestClient;
  658.         }
  659.  
  660.         public static bool[] AimbotStatus = new bool[12];
  661.         public static Thread[] AimbotThread = new Thread[12];
  662.  
  663.         private static float CheckStance(int clientIndex)
  664.         {
  665.             Int32 CurrentStance = Lib.ReadByte(G_Client(clientIndex) + 0xFC + 0x03);
  666.             if (CurrentStance == 0x08 || CurrentStance == 0x0A || CurrentStance == 0x48 || CurrentStance == 0x4A)
  667.             { return 44f; }
  668.             if (CurrentStance == 0x04 || CurrentStance == 0x06 || CurrentStance == 0x44 || CurrentStance == 0x46)
  669.             { return 14f; }
  670.             return 0f;
  671.         }
  672.         private static float CheckStanceAttacker(int clientIndex)
  673.         {
  674.             Int32 CurrentStance = Lib.ReadByte(G_Client(clientIndex) + 0xFC + 0x03);
  675.             if (CurrentStance == 0x08 || CurrentStance == 0x0A || CurrentStance == 0x48 || CurrentStance == 0x4A)
  676.             { return 46f; }
  677.             if (CurrentStance == 0x04 || CurrentStance == 0x06 || CurrentStance == 0x44 || CurrentStance == 0x46)
  678.             { return 18f; }
  679.             return 0f;
  680.         }
  681.  
  682.         private static void InitializeAimbot(int clientIndex)
  683.         {
  684.             PS3.Reconnect();
  685.             while (AimbotStatus[clientIndex])
  686.             {
  687.                     int nearestPlayer = GetNearestPlayer(clientIndex);
  688.                     if (nearestPlayer != clientIndex)
  689.                     {                        
  690.                         if (UnfairAimbot[clientIndex] == false && AimingRequired[clientIndex] == false)
  691.                         {
  692.                             SetClientViewAngles(clientIndex, nearestPlayer);
  693.                         }
  694.                     }
  695.                 }
  696.             }
  697.  
  698.         public static float[] PlayerAnglesToForward(int clientIndex, float Distance = 200f)
  699.         {
  700.             float[] Angles = Lib.ReadSingle(G_Client(clientIndex, 0x56BC), 3);
  701.             float[] Position = Lib.ReadSingle(G_Client(clientIndex, 0x28), 3);
  702.             float angle, sr, sp, sy, cr, cp, cy, PiDiv;
  703.             PiDiv = ((float)Math.PI / 180f);
  704.             angle = Angles[1] * PiDiv;
  705.             sy = (float)Math.Sin(angle);
  706.             cy = (float)Math.Cos(angle);
  707.             angle = Angles[0] * PiDiv;
  708.             sp = (float)Math.Sin(angle);
  709.             cp = (float)Math.Cos(angle);
  710.             angle = Angles[2] * PiDiv;
  711.             sr = (float)Math.Sin(angle);
  712.             cr = (float)Math.Cos(angle);
  713.             float[] Forward = new float[] { (cp * cy * Distance) + Position[0], (cp * sy * Distance) + Position[1], (-sp * Distance) + Position[2] };
  714.             return Forward;
  715.         }
  716.         public static float[] AnglesToForward(float[] Angles, float Distance = 200f)
  717.         {
  718.             float angle, sr, sp, sy, cr, cp, cy, PiDiv;
  719.             PiDiv = ((float)Math.PI / 180f);
  720.             angle = Angles[1] * PiDiv;
  721.             sy = (float)Math.Sin(angle);
  722.             cy = (float)Math.Cos(angle);
  723.             angle = Angles[0] * PiDiv;
  724.             sp = (float)Math.Sin(angle);
  725.             cp = (float)Math.Cos(angle);
  726.             angle = Angles[2] * PiDiv;
  727.             sr = (float)Math.Sin(angle);
  728.             cr = (float)Math.Cos(angle);
  729.             float[] Forward = new float[] { (cp * cy * Distance), (cp * sy * Distance), (-sp * Distance) };
  730.             return Forward;
  731.         }
  732.  
  733.         private static void SetClientViewAngles(int clientIndex, int Victim)
  734.         {
  735.             float[] Vec = getVector(getPlayerPosition(clientIndex), getPlayerPosition(Victim));
  736.             Vec[2] -= CheckStance(Victim);
  737.             Vec[2] += CheckStanceAttacker(clientIndex);
  738.             float[] Angles = vectoangles(Vec);
  739.             setViewAngles((UInt32)clientIndex, Angles);
  740.         }
  741.         public static void setViewAngles(UInt32 clientIndex, float[] Angles)
  742.         {
  743.             Lib.WriteSingle(0x10040000, Angles);
  744.             RPC.Call(0x1E1D90, G_Entity((Int32)clientIndex), 0x10040000);
  745.         }
  746.         public static float[] getViewAngles(int clientIndex)
  747.         {
  748.             return Lib.ReadSingle(G_Client(clientIndex, 0x56BC), 3);
  749.         }
  750.  
  751. //Entity Attach
  752. public static void G_EntAttach(Int32 entityIndex, String modelName, String tagName)
  753.         {
  754.             Int32 tag = RPC.Call(0x48EAB8, tagName);//SL_FindLowercaseString(const char* string)
  755.             RPC.Call(0x27783C, G_Entity(entityIndex), modelName, tag, 0); //G_EntAttach(gentity_s *ent, cont char *modelName, unsigned int tagName, int ignoreCollision);
  756.         }
  757.  
  758. //Spawn Entity
  759. public static UInt32 spawnEntity(String ModelName, Single[] Origin, Single[] Angles)
  760.         {
  761.             UInt32 Entity = (UInt32)RPC.Call(0x278C60);//G_Spawn
  762.             Lib.WriteSingle(Entity + 0x134, Origin);//Sets Entity Origin
  763.             Lib.WriteSingle((Entity + 0x140), Angles);//Sets Entity Angles
  764.             RPC.Call(0x277644, Entity, ModelName);//G_SetModel
  765.             RPC.Call(0x2670E8, Entity);//SP_Script_model
  766.             return Entity;//Returns Entity Index
  767.         }
  768.  
  769. //InGameKeyboard
  770.  
  771. public static String char_to_wchar(String text)
  772.         {
  773.             String wchar = text;
  774.             for (Int32 i = 0; i < text.Length; i++)
  775.             {
  776.                 wchar = wchar.Insert(i * 2, "\0");
  777.             }
  778.             return wchar;
  779.         }
  780.  
  781. public static String doKeyboard(Int32 KeyboardType = 2, String Title = "Title", String PresetText = "", Int32 MaxLength = 20)
  782.         {
  783.             WriteByte(0x467507, (Byte)KeyboardType);
  784.             RPC.Call(0x4674AC, 0xD67E980, char_to_wchar(Title), char_to_wchar(PresetText), MaxLength, 0xD57560);
  785.             while (ReadInt32(0xD82140) != 0)
  786.                 continue;
  787.             return ReadString(0x03090E22);
  788.         }
  789.  
  790. //DPAD Monitoring
  791.  
  792.    public static UInt32
  793.                 DPADUp = 0x34,
  794.                 DPADDown = 0x38,
  795.                 DPADLeft = 0x3C,
  796.                 DPADRight = 0x40;
  797.  
  798.             public static bool DetectButton(int clientIndex, uint Button)
  799.             {
  800.                 Int32 ButtonIndex = PS3.Extensions.ReadInt32(0x94641C + Button);
  801.                 Int32 B1 = PS3.Extensions.ReadInt32(G_Client(clientIndex) + 0x56B8);
  802.                 Int32 B2 = PS3.Extensions.ReadInt32(G_Client(clientIndex) + 0x56A0);
  803.                 if ((B1 == ButtonIndex) || (B2 == ButtonIndex))
  804.                     return true;
  805.                 return false;
  806.             }
  807.  
  808. //BulletTrace
  809. public static float[] G_GetPlayerViewOrigin(int clientIndex)
  810.         {
  811.             PS3.SetMemory(0x2600250, new byte[0xC]);
  812.             RPC.Call(0x1E60D0, G_Client(clientIndex), 0x2600250);
  813.             return ReadSingle(0x2600250, 3);
  814.         }
  815.  
  816.         public static void G_LocationalTrace(int Trace, float[] Start, float[] End)
  817.         {
  818.             RPC.Call(0x35C5A8, Trace, Start, End, 0, 0x280E8B3, 0);
  819.         }
  820.  
  821.         public static int Trace_GetEntityHitId(int Trace)
  822.         {
  823.             return RPC.Call(0x306F30, Trace);
  824.         }
  825.  
  826.         public static int TraceEntity(int clientIndex, float TracerDistance)
  827.         {
  828.             int Trace = 0x25D2B00;
  829.             float[] Start = G_GetPlayerViewOrigin(clientIndex);
  830.             float[] End = PlayerAnglesToForward(clientIndex, TracerDistance);
  831.             G_LocationalTrace(Trace, Start, End);
  832.             int Entity = Trace_GetEntityHitId(Trace) & 0xFFFF;
  833.             if (Entity < 0x3FE)
  834.             { Entity = (int)G_Entity(Entity); }
  835.             else
  836.             { Entity = 0; }
  837.             return Entity;
  838.         }
  839.  
  840.         public static float[] TraceBullet(int clientIndex, float TracerDistance)
  841.         {
  842.             int Trace = 0x25D2B00;
  843.             float[] Start = G_GetPlayerViewOrigin(clientIndex);
  844.             float[] End = PlayerAnglesToForward(clientIndex, TracerDistance);
  845.             G_LocationalTrace(Trace, Start, End);
  846.             float[] BulletTrace = new float[3];
  847.             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])) };        
  848.             return BulletTrace;
  849.         }
  850.  
  851. //PreCache Shader
  852.  
  853. public static int precacheShader(string Shader)
  854.         {
  855.             Lib.WriteInt32(0x1608100 + 0x40, 1);
  856.             return RPC.Call(0x276020, Shader);
  857.         }
  858.  
  859. //RPC
  860.  
  861. //Enable By Calling Init(); , Not Enable();
  862.  
  863.  private static uint function_address;
  864.  
  865.         public static int Call(uint func_address, params object[] parameters)
  866.         {
  867.             int length = parameters.Length;
  868.             int index = 0;
  869.             uint num3 = 0;
  870.             uint num4 = 0;
  871.             uint num5 = 0;
  872.             uint num6 = 0;
  873.             while (index < length)
  874.             {
  875.                 if (parameters[index] is int)
  876.                 {
  877.                     PS3.Extension.WriteInt32(0x10020000 + (num3 * 4), (int)parameters[index]);
  878.                     num3++;
  879.                 }
  880.                 else if (parameters[index] is uint)
  881.                 {
  882.                     PS3.Extension.WriteUInt32(0x10020000 + (num3 * 4), (uint)parameters[index]);
  883.                     num3++;
  884.                 }
  885.                 else
  886.                 {
  887.                     uint num7;
  888.                     if (parameters[index] is string)
  889.                     {
  890.                         num7 = 0x10022000 + (num4 * 0x400);
  891.                         PS3.Extension.WriteString(num7, Convert.ToString(parameters[index]));
  892.                         PS3.Extension.WriteUInt32(0x10020000 + (num3 * 4), num7);
  893.                         num3++;
  894.                         num4++;
  895.                     }
  896.                     else if (parameters[index] is float)
  897.                     {
  898.                         PS3.Extension.WriteFloat(0x10020024 + (num5 * 4), (float)parameters[index]);
  899.                         num5++;
  900.                     }
  901.                     else if (parameters[index] is float[])
  902.                     {
  903.                         float[] input = (float[])parameters[index];
  904.                         num7 = 0x10021000 + (num6 * 4);
  905.                         Lib.WriteSingle(num7, input);
  906.                         PS3.Extension.WriteUInt32(0x10020000 + (num3 * 4), num7);
  907.                         num3++;
  908.                         num6 += (uint)input.Length;
  909.                     }
  910.                 }
  911.                 index++;
  912.             }
  913.             PS3.Extension.WriteUInt32(0x1002004C, func_address);
  914.             Thread.Sleep(20);
  915.             return PS3.Extension.ReadInt32(0x10020050);
  916.         }
  917.  
  918.         public static void Enable()
  919.         {
  920.             PS3.SetMemory(function_address, new byte[] { 0x4E, 0x80, 0x00, 0x20 });
  921.             Thread.Sleep(20);
  922.             byte[] memory = new byte[]
  923.                     { 0x7C, 0x08, 0x02, 0xA6, 0xF8, 0x01, 0x00, 0x80, 0x3C, 0x60, 0x10, 0x02, 0x81, 0x83, 0x00, 0x4C,
  924.             0x2C, 0x0C, 0x00, 0x00, 0x41, 0x82, 0x00, 0x64, 0x80, 0x83, 0x00, 0x04, 0x80, 0xA3, 0x00, 0x08,
  925.             0x80, 0xC3, 0x00, 0x0C, 0x80, 0xE3, 0x00, 0x10, 0x81, 0x03, 0x00, 0x14, 0x81, 0x23, 0x00, 0x18,
  926.             0x81, 0x43, 0x00, 0x1C, 0x81, 0x63, 0x00, 0x20, 0xC0, 0x23, 0x00, 0x24, 0xc0, 0x43, 0x00, 0x28,
  927.             0xC0, 0x63, 0x00, 0x2C, 0xC0, 0x83, 0x00, 0x30, 0xC0, 0xA3, 0x00, 0x34, 0xc0, 0xC3, 0x00, 0x38,
  928.             0xC0, 0xE3, 0x00, 0x3C, 0xC1, 0x03, 0x00, 0x40, 0xC1, 0x23, 0x00, 0x48, 0x80, 0x63, 0x00, 0x00,
  929.             0x7D, 0x89, 0x03, 0xA6, 0x4E, 0x80, 0x04, 0x21, 0x3C, 0x80, 0x10, 0x02, 0x38, 0xA0, 0x00, 0x00,
  930.             0x90, 0xA4, 0x00, 0x4C, 0x90, 0x64, 0x00, 0x50, 0xE8, 0x01, 0x00, 0x80, 0x7C, 0x08, 0x03, 0xA6,
  931.             0x38, 0x21, 0x00, 0x70, 0x4E, 0x80, 0x00, 0x20 };
  932.             PS3.SetMemory(function_address + 4, memory);
  933.             PS3.SetMemory(0x10020000, new byte[0x2854]);
  934.             PS3.SetMemory(function_address, new byte[] { 0xF8, 0x21, 0xFF, 0x91 });
  935.         }
  936.  
  937.         public static int Init()
  938.         {
  939.             function_address = 0x7AA1E0;
  940.             Enable();
  941.             return 0;
  942.         }
  943.  
  944. //Player_Die
  945. public static void Player_Die(int Killer, int Victim, int meansOfDeath = 18, int iWeapon = 0)
  946.         {
  947.             UInt32 Attacker = G_Entity(Killer);
  948.             UInt32 Inflictor = G_Entity(Victim);
  949.             RPC.Call(0x248F20, Inflictor, Attacker, Attacker, 0xFF, meansOfDeath, iWeapon, 0xD0300AD4C);
  950.             Thread.Sleep(100);
  951.         }
  952.  
  953. //set/get view angles
  954. public static Single[] getClientViewAngles(Int32 clientIndex)
  955.         {
  956.             return Lib.ReadSingle(Offsets.Funcs.G_Client(clientIndex, 0x56BC), 3);
  957.         }
  958. public static void setClientViewAngles(Int32 entityIndex, Single[] Angles)
  959.         {
  960.             if (Lib.ReadInt32((UInt32)entityIndex + 0x154) == 0)
  961.                 Console.Write("setClientViewAngles can only be called on players\n");
  962.             else
  963.                 RPC.Call(Offsets.SetClientViewAngles, G_Entity(entityIndex), Angles);
  964.         }
  965.  
  966. //velocity
  967.  
  968. //Velocity = Speed In A Certain Direction
  969. public static Single[] GetVelocity(Int32 clientIndex)
  970. {
  971.     return Lib.ReadSingle(G_Client(clientIndex, 0x34), 3);
  972. }
  973. public static void SetVelocity(Int32 clientIndex, Single[] Velocity)
  974. {
  975.     Lib.WriteSingle(G_Client(clientIndex, 0x34), 3);
  976. }
  977.  
  978. //vibration
  979.  
  980. public static void AddEvent(Int32 clientIndex, Int32 Event, Object eventParams)
  981.         {
  982.             RPC.Call(0x279950, G_Entity(clientIndex), Event, eventParams);
  983.         }
  984.         public static void playRumble(Int32 clientIndex, Int32 RumbleIndex)
  985.         {
  986.             if (RumbleIndex != 0)
  987.             { AddEvent(clientIndex, 0x70, RumbleIndex); }
  988.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement