CrEaTiiOn_420

C# Mystery Box By: GMTPS3 (small fix for new coders XD)

Jul 19th, 2014
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 26.97 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Threading;
  7. using PS3Lib;  // i Added This to fix some errors if people had any
  8.  
  9. namespace MysteryBox
  10. {
  11.     public static class MysteryBox
  12.     {
  13.         #region Variables
  14.         private static PS3API PS3 = new PS3API();  // i Added This to fix some errors if people had any
  15.         private static uint Weapon = 0;
  16.         private static uint[] MBIndexes = new uint[3];
  17.         private static string WeaponName = null;
  18.         private static Thread MBThread;
  19.         #endregion
  20.  
  21.         #region Read + Write
  22.         private static string ReadString(uint Offset)
  23.         {
  24.             uint num = 0;
  25.             List<byte> List = new List<byte>();
  26.             while (true)
  27.             {
  28.                 byte[] buffer = new byte[1];
  29.                 PS3.GetMemory(Offset + num, buffer);
  30.                 if (buffer[0] == 0)
  31.                 {
  32.                     return Encoding.UTF8.GetString(List.ToArray());
  33.                 }
  34.                 List.Add(buffer[0]);
  35.                 num++;
  36.             }
  37.         }
  38.  
  39.         private static float ReadFloat(uint Offset)
  40.         {
  41.             byte[] buffer = new byte[4];
  42.             PS3.GetMemory(Offset, buffer);
  43.             Array.Reverse(buffer, 0, 4);
  44.             return BitConverter.ToSingle(buffer, 0);
  45.         }
  46.  
  47.         private static int ReadInt(uint Offset)
  48.         {
  49.             byte[] buffer = new byte[4];
  50.             PS3.GetMemory(Offset, buffer);
  51.             Array.Reverse(buffer);
  52.             int Value = BitConverter.ToInt32(buffer, 0);
  53.             return Value;
  54.         }
  55.  
  56.         private static float[] ReadFloatLength(uint Offset, int Length)
  57.         {
  58.             byte[] buffer = new byte[Length * 4];
  59.             PS3.GetMemory(Offset, buffer);
  60.             Array.Reverse(buffer);
  61.             float[] FArray = new float[Length];
  62.             for (int i = 0; i < Length; i++)
  63.             {
  64.                 FArray[i] = BitConverter.ToSingle(buffer, (Length - 1 - i) * 4);
  65.             }
  66.             return FArray;
  67.         }
  68.  
  69.         private static void WriteString(uint Offset, string Text)
  70.         {
  71.             byte[] buffer = Encoding.UTF8.GetBytes(Text);
  72.             Array.Resize(ref buffer, buffer.Length + 1);
  73.             PS3.SetMemory(Offset, buffer);
  74.         }
  75.  
  76.         private static void WriteByte(uint Offset, byte Byte)
  77.         {
  78.             byte[] buffer = new byte[1];
  79.             buffer[0] = Byte;
  80.             PS3.SetMemory(Offset, buffer);
  81.         }
  82.  
  83.         private static void WriteFloat(uint Offset, float Float)
  84.         {
  85.             byte[] buffer = new byte[4];
  86.             BitConverter.GetBytes(Float).CopyTo(buffer, 0);
  87.             Array.Reverse(buffer, 0, 4);
  88.             PS3.SetMemory(Offset, buffer);
  89.         }
  90.  
  91.         private static void WriteFloatArray(uint Offset, float[] FArray)
  92.         {
  93.             byte[] buffer = new byte[FArray.Length * 4];
  94.             for (int Lenght = 0; Lenght < FArray.Length; Lenght++)
  95.             {
  96.                 Array.Reverse((BitConverter.GetBytes(FArray[Lenght])));
  97.                 buffer.CopyTo(buffer, Lenght * 4);
  98.             }
  99.             PS3.SetMemory(Offset, buffer);
  100.         }
  101.  
  102.         private static void WriteInt(uint Offset, int Value)
  103.         {
  104.             byte[] buffer = BitConverter.GetBytes(Value);
  105.             Array.Reverse(buffer);
  106.             PS3.SetMemory(Offset, buffer);
  107.         }
  108.  
  109.         private static void WriteUInt(uint Offset, uint Value)
  110.         {
  111.             byte[] buffer = new byte[4];
  112.             BitConverter.GetBytes(Value).CopyTo(buffer, 0);
  113.             Array.Reverse(buffer, 0, 4);
  114.             PS3.SetMemory(Offset, buffer);
  115.         }
  116.         #endregion
  117.  
  118.         #region RPC
  119.         private static uint func_address = 0x0277208;
  120.  
  121.         private static void Enable()
  122.             {
  123.                 byte[] Check = new byte[1];
  124.                 PS3.GetMemory(func_address + 4, Check);
  125.                 if (Check[0] == 0x3F)
  126.                 {
  127.  
  128.                 }
  129.                 else
  130.                 {
  131.                     byte[] PPC = new byte[] {0x3F,0x80,0x10,0x05,0x81,0x9C,0,0x48,0x2C,0x0C,0,  0,0x41,0x82,0,0x78, 0x80,0x7C,0,0,0x80,0x9C,0,0x04,0x80,0xBC,0,0x08, 0x80, 0xDC,0,0x0C,0x80, 0xFC,0,0x10,0x81,0x1C,0,0x14,0x81,0x3C,0,0x18,0x81  ,0x5C,0,0x1C,0x81, 0x7C,0,0x20,0xC0,0x3C,0,0x24,0xC0,0x5C,0,0x28,0xC0  ,0x7C,0,0x2C,0xC0, 0x9C,0,0x30,0xC0,0xBC,0,0x34,0xC0,0xDC,0,0x38,0xC0  ,0xFC,0,0x3C,0xC1, 0x1C,0,0x40,0xC1,0x3C,0,0x44,0x7D,0x89,0x03,0xA6,0x4E,0x80,0x04,0x21, 0x38,0x80,0,0,0x90,0x9C,0,0x48,0x90,0x7C,0,0x4C,0xD0,0x3C,0,0x50,0x48,0,0,0x14};// Make This All One Line Once Added To Your Source -CrEaTiiOn_420
  132.                     PS3.SetMemory(func_address, new byte[] { 0x41 });
  133.                     PS3.SetMemory(func_address + 4, PPC);
  134.                     PS3.SetMemory(func_address, new byte[] { 0x40 });
  135.                 }
  136.             }
  137.  
  138.         private static int Call(uint address, params object[] parameters)
  139.         {
  140.             int length = parameters.Length;
  141.             int index = 0;
  142.             uint count = 0;
  143.             uint Strings = 0;
  144.             uint Single = 0;
  145.             uint Array = 0;
  146.             while (index < length)
  147.             {
  148.                 if (parameters[index] is int)
  149.                 {
  150.                     WriteInt(0x10050000 + (count * 4), (int)parameters[index]);
  151.                     count++;
  152.                 }
  153.                 else if (parameters[index] is uint)
  154.                 {
  155.                     WriteUInt(0x10050000 + (count * 4), (uint)parameters[index]);
  156.                     count++;
  157.                 }
  158.                 else if (parameters[index] is byte)
  159.                 {
  160.                     WriteByte(0x10050000 + (count * 4), (byte)parameters[index]);
  161.                     count++;
  162.                 }
  163.                 else
  164.                 {
  165.                     uint pointer;
  166.                     if (parameters[index] is string)
  167.                     {
  168.                         pointer = 0x10052000 + (Strings * 0x400);
  169.                         WriteString(pointer, Convert.ToString(parameters[index]));
  170.                         WriteUInt(0x10050000 + (count * 4), (uint)pointer);
  171.                         count++;
  172.                         Strings++;
  173.                     }
  174.                     else if (parameters[index] is float)
  175.                     {
  176.                         WriteFloat(0x10050024 + (Single * 4), (float)parameters[index]);
  177.                         Single++;
  178.                     }
  179.                     else if (parameters[index] is float[])
  180.                     {
  181.                         float[] Args = (float[])parameters[index];
  182.                         pointer = 0x10051000 + Array * 4;
  183.                         WriteFloatArray(pointer, Args);
  184.                         WriteUInt(0x10050000 + count * 4, (uint)pointer);
  185.                         count++;
  186.                         Array += (uint)Args.Length;
  187.                     }
  188.                 }
  189.                 index++;
  190.             }
  191.             WriteUInt(0x10050048, (uint)address);
  192.             Thread.Sleep(20);
  193.             return ReadInt(0x1005004c);
  194.         }
  195.         #endregion
  196.  
  197.         #region HUDS
  198.         private static uint Element(uint Index)
  199.         {
  200.             return 0xF0E10C + ((Index) * 0xB4);
  201.         }
  202.  
  203.         private static uint StoreText(uint Index, decimal Client, string Text, int Font, float FontScale, int X, int Y, decimal R = 255, decimal G = 255, decimal B = 255, decimal A = 255, decimal R1 = 0, decimal G1 = 0, decimal B1 = 0, decimal A1 = 0)
  204.         {
  205.             uint elem = Element(Index);
  206.             WriteInt(elem + 0x84, Call(0x1BE6CC, Text));
  207.             WriteInt(elem + 0x24, Font);
  208.             WriteFloat(elem + 0x14, FontScale);
  209.             WriteFloat(elem + 0x4, X);
  210.             WriteFloat(elem + 0x8, Y);
  211.             PS3.SetMemory(elem + 0xa7, new byte[] { 7 });
  212.             PS3.SetMemory(elem + 0x30, new byte[] { (byte)R, (byte)G, (byte)B, (byte)A });
  213.             PS3.SetMemory(elem + 0x8C, new byte[] { (byte)R1, (byte)G1, (byte)B1, (byte)A1 });
  214.             WriteInt(elem + 0xA8, (int)Client);
  215.             System.Threading.Thread.Sleep(20);
  216.             WriteInt(elem, 1);
  217.             return elem;
  218.         }
  219.         #endregion
  220.  
  221.         #region Functions
  222.         private enum Brush : uint
  223.         {
  224.             NULL = 0,
  225.             CarePackage = 2,
  226.             Bomb = 3,
  227.         }
  228.  
  229.         private static uint SolidModel(float[] Origin, float[] Angles, string Model = "com_plasticcase_friendly", Brush Index = Brush.CarePackage)
  230.         {
  231.             uint Entity = (uint)Call(0x01C058C);//G_Spawn
  232.             WriteFloatArray(Entity + 0x138, Origin);//Position
  233.             WriteFloatArray(Entity + 0x144, Angles);//Orientation
  234.             Call(0x01BEF5C, Entity, Model);//G_SetModel  //i Fixed This For People using different RPC's
  235.             Call(0x01B6F68, Entity); //SP_script_model  //i Fixed This For People using different RPC's
  236.             Call(0x002377B8, Entity);//SV_UnlinkEntity  //i Fixed This For People using different RPC's
  237.             WriteByte(Entity + 0x101, 4);
  238.             WriteByte(Entity + 0x8C + 3, (byte)Index);
  239.             Call(0x0022925C, Entity);//SV_SetBrushModel  //i Fixed This For People using different RPC's
  240.             Call(0x00237848, Entity);//SV_LinkEntity  //i Fixed This For People using different RPC's
  241.             return Entity;
  242.         }
  243.  
  244.         public static float[] GetOrigin(uint Client)
  245.         {
  246.             return ReadFloatLength(0x110a29c + (Client * 0x3980), 3);
  247.         }
  248.  
  249.         private static string ChangeWeaponModel()
  250.             {
  251.                 int Value = 0;
  252.                 byte[] buffer = new byte[100];
  253.                 PS3.GetMemory(0x8360d5, buffer);
  254.                 System.Text.ASCIIEncoding Encoding = new System.Text.ASCIIEncoding();
  255.                 string Map = Encoding.GetString(buffer).Split(Convert.ToChar(0x5c))[6];
  256.                 if (Map == "mp_seatown" | Map == "mp_plaza2" | Map == "mp_exchange" | Map == "mp_bootleg" | Map == "mp_alpha" | Map == "mp_village" | Map == "mp_bravo" | Map == "mp_courtyard_ss" | Map == "mp_aground_ss")
  257.                     Value = -1;
  258.                 else
  259.                     Value = 0;
  260.  
  261.                 Random Random = new Random();
  262.                 switch (Random.Next(1, 50))
  263.                 {
  264.                     case 1:
  265.                         Weapon = (uint)Value + 4;
  266.                         WeaponName = "Riotshield";
  267.                         return "weapon_riot_shield_mp";
  268.                     case 2:
  269.                         Weapon = (uint)Value + 6;
  270.                         WeaponName = ".44 Magnum";
  271.                         return "weapon_44_magnum_iw5";
  272.                     case 3:
  273.                         Weapon = (uint)Value + 7;
  274.                         WeaponName = "USP .45";
  275.                         return "weapon_usp45_iw5";
  276.                     case 4:
  277.                         Weapon = (uint)Value + 9;
  278.                         WeaponName = "Desert Eagle";
  279.                         return "weapon_desert_eagle_iw5";
  280.                     case 5:
  281.                         Weapon = (uint)Value + 10;
  282.                         WeaponName = "MP412";
  283.                         return "weapon_mp412";
  284.                     case 6:
  285.                         Weapon = (uint)Value + 12;
  286.                         WeaponName = "P99";
  287.                         return "weapon_walther_p99_iw5";
  288.                     case 7:
  289.                         Weapon = (uint)Value + 13;
  290.                         WeaponName = "Five-Seven";
  291.                         return "weapon_fn_fiveseven_iw5";
  292.                     case 8:
  293.                         Weapon = (uint)Value + 14;
  294.                         WeaponName = "FMG9";
  295.                         return "weapon_fmg_iw5";
  296.                     case 9:
  297.                         Weapon = (uint)Value + 15;
  298.                         WeaponName = "Skorpion";
  299.                         return "weapon_skorpion_iw5";
  300.                     case 10:
  301.                         Weapon = (uint)Value + 16;
  302.                         WeaponName = "MP9";
  303.                         return "weapon_mp9_iw5";
  304.                     case 11:
  305.                         Weapon = (uint)Value + 17;
  306.                         WeaponName = "G18";
  307.                         return "weapon_g18_iw5";
  308.                     case 12:
  309.                         Weapon = (uint)Value + 18;
  310.                         WeaponName = "MP5";
  311.                         return "weapon_mp5_iw5";
  312.                     case 13:
  313.                         Weapon = (uint)Value + 19;
  314.                         WeaponName = "PM-9";
  315.                         return "weapon_uzi_m9_iw5";
  316.                     case 14:
  317.                         Weapon = (uint)Value + 20;
  318.                         WeaponName = "P90";
  319.                         return "weapon_p90_iw5";
  320.                     case 15:
  321.                         Weapon = (uint)Value + 21;
  322.                         WeaponName = "PP90M1";
  323.                         return "weapon_pp90m1_iw5";
  324.                     case 16:
  325.                         Weapon = (uint)Value + 22;
  326.                         WeaponName = "UMP45";
  327.                         return "weapon_ump45_iw5";
  328.                     case 17:
  329.                         Weapon = (uint)Value + 23;
  330.                         WeaponName = "MP7";
  331.                         return "weapon_mp7_iw5";
  332.                     case 18:
  333.                         Weapon = (uint)Value + 24;
  334.                         WeaponName = "AK-47";
  335.                         return "weapon_ak47_iw5";
  336.                     case 19:
  337.                         Weapon = (uint)Value + 25;
  338.                         WeaponName = "M16A4";
  339.                         return "weapon_m16_iw5";
  340.                     case 20:
  341.                         Weapon = (uint)Value + 26;
  342.                         WeaponName = "M4A1";
  343.                         return "weapon_m4_iw5";
  344.                     case 21:
  345.                         Weapon = (uint)Value + 27;
  346.                         WeaponName = "FAD";
  347.                         return "weapon_fad_iw5";
  348.                     case 22:
  349.                         Weapon = (uint)Value + 28;
  350.                         WeaponName = "ACR 6.8";
  351.                         return "weapon_remington_acr_iw5";
  352.                     case 23:
  353.                         Weapon = (uint)Value + 29;
  354.                         WeaponName = "Typ 95";
  355.                         return "weapon_type95_iw5";
  356.                     case 24:
  357.                         Weapon = (uint)Value + 30;
  358.                         WeaponName = "MK14";
  359.                         return "weapon_m14_iw5";
  360.                     case 25:
  361.                         Weapon = (uint)Value + 31;
  362.                         WeaponName = "SCAR-L";
  363.                         return "weapon_scar_iw5";
  364.                     case 26:
  365.                         Weapon = (uint)Value + 32;
  366.                         WeaponName = "G36C";
  367.                         return "weapon_g36_iw5";
  368.                     case 27:
  369.                         Weapon = (uint)Value + 33;
  370.                         WeaponName = "CM901";
  371.                         return "weapon_cm901";
  372.                     case 28:
  373.                         Weapon = (uint)Value + 35;
  374.                         WeaponName = "M320 GLM";
  375.                         return "weapon_m320_gl";
  376.                     case 29:
  377.                         Weapon = (uint)Value + 36;
  378.                         WeaponName = "RPG-7";
  379.                         return "weapon_rpg7";
  380.                     case 30:
  381.                         Weapon = (uint)Value + 37;
  382.                         WeaponName = "SMAW";
  383.                         return "weapon_smaw";
  384.                     case 31:
  385.                         Weapon = (uint)Value + 39;
  386.                         WeaponName = "Javelin";
  387.                         return "weapon_javelin";
  388.                     case 32:
  389.                         Weapon = (uint)Value + 40;
  390.                         WeaponName = "XM25";
  391.                         return "weapon_xm25";
  392.                     case 33:
  393.                         Weapon = (uint)Value + 12329;
  394.                         WeaponName = "Dragunow";
  395.                         return "weapon_dragunov_iw5";
  396.                     case 34:
  397.                         Weapon = (uint)Value + 12330;
  398.                         WeaponName = "MSR";
  399.                         return "weapon_remington_msr_iw5";
  400.                     case 35:
  401.                         Weapon = (uint)Value + 12331;
  402.                         WeaponName = "BARRET KAL. .50";
  403.                         return "weapon_m82_iw5";
  404.                     case 36:
  405.                         Weapon = (uint)Value + 12332;
  406.                         WeaponName = "RSASS";
  407.                         return "weapon_rsass_iw5";
  408.                     case 37:
  409.                         Weapon = (uint)Value + 12333;
  410.                         WeaponName = "AS50";
  411.                         return "weapon_as50_iw5";
  412.                     case 38:
  413.                         Weapon = (uint)Value + 12334;
  414.                         WeaponName = "L118A";
  415.                         return "weapon_l96a1_iw5";
  416.                     case 39:
  417.                         Weapon = (uint)Value + 47;
  418.                         WeaponName = "KSG 12";
  419.                         return "weapon_ksg_iw5";
  420.                     case 40:
  421.                         Weapon = (uint)Value + 48;
  422.                         WeaponName = "MODELL 1887";
  423.                         return "weapon_model1887";
  424.                     case 41:
  425.                         Weapon = (uint)Value + 49;
  426.                         WeaponName = "STRIKER";
  427.                         return "weapon_striker_iw5";
  428.                     case 42:
  429.                         Weapon = (uint)Value + 50;
  430.                         WeaponName = "AA-12";
  431.                         return "weapon_aa12_iw5";
  432.                     case 43:
  433.                         Weapon = (uint)Value + 51;
  434.                         WeaponName = "USAS12";
  435.                         return "weapon_usas12_iw5";
  436.                     case 44:
  437.                         Weapon = (uint)Value + 52;
  438.                         WeaponName = "SPAS-12";
  439.                         return "weapon_spas12_iw5";
  440.                     case 45:
  441.                         Weapon = (uint)Value + 54;
  442.                         WeaponName = "M60E4";
  443.                         return "weapon_m60_iw5";
  444.                     case 46:
  445.                         Weapon = (uint)Value + 17461;
  446.                         WeaponName = "AUG";
  447.                         return "weapon_steyr_digital";
  448.                     case 47:
  449.                         Weapon = (uint)Value + 55;
  450.                         WeaponName = "MK46";
  451.                         return "weapon_mk46_iw5";
  452.                     case 48:
  453.                         Weapon = (uint)Value + 56;
  454.                         WeaponName = "PKP PECHENEG";
  455.                         return "weapon_pecheneg_iw5";
  456.                     case 49:
  457.                         Weapon = (uint)Value + 57;
  458.                         WeaponName = "L86 LSW";
  459.                         return "weapon_sa80_iw5";
  460.                     case 50:
  461.                         Weapon = (uint)Value + 58;
  462.                         WeaponName = "MG36";
  463.                         return "weapon_mg36";
  464.                 }
  465.                 return null;
  466.             }
  467.  
  468.         private static void MBFunction(float[] Origin, float[] Angles)
  469.         {
  470.             float[] BoxOrigin = Origin;
  471.             float WeaponZ1 = 0;
  472.             bool Running = false;
  473.             uint ClientUsing = 0, WeaponID = 0;
  474.             Origin[2] += 16;
  475.             MBIndexes[0] = SolidModel(Origin, Angles, "com_plasticcase_trap_friendly");
  476.             MBIndexes[1] = SolidModel(new float[] { Origin[0], Origin[1], Origin[2] += 28 }, Angles, "");
  477.             MBIndexes[2] = SolidModel(new float[] { Origin[0] += -8, Origin[1], Origin[2] += -18 }, Angles, "weapon_ak47_iw5", Brush.NULL);
  478.             WeaponID = MBIndexes[2];
  479.             while (MBThread.IsAlive)
  480.             {
  481.                 if (Running == false)
  482.                 {
  483.                     for (uint Client = 0; Client < 18; Client++)
  484.                     {
  485.                         if (ReadInt(0xFCA41D + (Client * 0x280)) > 0)
  486.                         {
  487.                             float[] PlayerOrigin = ReadFloatLength(0x110a29c + (Client * 0x3980), 3);
  488.                             float X = PlayerOrigin[0] - BoxOrigin[0];
  489.                             float Y = PlayerOrigin[1] - BoxOrigin[1];
  490.                             float Z = PlayerOrigin[2] - (BoxOrigin[2] - 23);
  491.                             float Distance = (float)Math.Sqrt((X * X) + (Y * Y) + (Z * Z));
  492.                             if (Distance < 50)
  493.                             {
  494.                                 StoreText(500 + Client, Client, "Press  for a Random Weapon", 7, 0.8f, 195, 300);
  495.                                 byte[] Key = new byte[1];
  496.                                 PS3.GetMemory(0x110D5E3 + (0x3980 * Client), Key);
  497.                                 if (Key[0] == 0x20)
  498.                                 {
  499.                                     PS3.SetMemory(0xF0E10C + (500 * 0xB4), new byte[18 * 0xB4]);
  500.                                     float WeaponZ = Origin[2];
  501.                                     for (int i = 0; i < 37; i++)
  502.                                     {
  503.                                         WriteFloat(WeaponID + 0x20, WeaponZ += 0.7f);
  504.                                         if ((i / 2) * 2 == i)
  505.                                         {
  506.                                             WriteUInt(WeaponID + 0x58, (uint)Call(0x1BE7A8, ChangeWeaponModel()));
  507.                                         }
  508.                                         if (i == 36)
  509.                                         {
  510.                                             break;
  511.                                         }
  512.                                         WeaponZ1 = WeaponZ;
  513.                                         Thread.Sleep(100);
  514.                                     }
  515.                                     Running = true;
  516.                                     ClientUsing = Client;
  517.                                     break;
  518.                                 }
  519.                             }
  520.                             else
  521.                             {
  522.                                 PS3.SetMemory(Element(500 + Client), new byte[0xB4]);
  523.                             }
  524.                         }
  525.                     }
  526.                 }
  527.                 else
  528.                 {
  529.                     for (int i = 0; i < 37; i++)
  530.                     {
  531.                         float[] PlayerOrigin = ReadFloatLength(0x110a29c + (ClientUsing * 0x3980), 3);
  532.                         float X = PlayerOrigin[0] - BoxOrigin[0];
  533.                         float Y = PlayerOrigin[1] - BoxOrigin[1];
  534.                         float Z = PlayerOrigin[2] - (BoxOrigin[2] - 23);
  535.                         float Distance = (float)Math.Sqrt((X * X) + (Y * Y) + (Z * Z));
  536.                         if (Distance < 50)
  537.                         {
  538.                             StoreText(500 + ClientUsing, ClientUsing, "Press  for " + WeaponName, 7, 0.8f, 195, 300);
  539.                             byte[] Key = new byte[1];
  540.                             PS3.GetMemory(0x110D5E3 + (0x3980 * ClientUsing), Key);
  541.                             if (Key[0] == 0x20)
  542.                             {
  543.  
  544.                                 if (ReadInt(0x0110a5f0 + (ClientUsing * 0x3980)) == ReadInt(0x0110a4fc + (ClientUsing * 0x3980)))
  545.                                 {
  546.                                     WriteUInt(0x0110a4fc + (ClientUsing * 0x3980), Weapon);
  547.                                     WriteUInt(0x0110a624 + (ClientUsing * 0x3980), Weapon);
  548.                                     WriteUInt(0x0110a6a4 + (ClientUsing * 0x3980), Weapon);
  549.                                 }
  550.                                 else
  551.                                 {
  552.                                     WriteUInt(0x0110a4f4 + (ClientUsing * 0x3980), Weapon);
  553.                                     WriteUInt(0x0110a68c + (ClientUsing * 0x3980), Weapon);
  554.                                     WriteUInt(0x0110a614 + (ClientUsing * 0x3980), Weapon);
  555.                                 }
  556.                                 WriteUInt(0x0110a5f0 + (ClientUsing * 0x3980), Weapon);
  557.                                 Call(0x18A29C, 0xFCA280 + (ClientUsing * 0x280), Weapon, "", 9999, 9999);  //i Fixed This For People using different RPC's
  558.                                 WriteFloat(WeaponID + 0x20, Origin[2]);
  559.                                 WriteUInt(WeaponID + 0x58, (uint)Call(0x1BE7A8, "weapon_ak47_iw5"));
  560.                                 PS3.SetMemory(Element(500 + ClientUsing), new byte[0xB4]);
  561.                                 Running = false;
  562.                                 break;
  563.                             }
  564.                             else
  565.                             {
  566.                                 WriteFloat(WeaponID + 0x20, WeaponZ1 += -0.7f);
  567.                                 if (i == 36)
  568.                                 {
  569.                                     WriteUInt(WeaponID + 0x58, (uint)Call(0x1BE7A8, "weapon_ak47_iw5"));
  570.                                     PS3.SetMemory(Element(500 + ClientUsing), new byte[0xB4]);
  571.                                     Running = false;
  572.                                     break;
  573.                                 }
  574.                                 Thread.Sleep(200);
  575.                             }
  576.                         }
  577.                         else
  578.                         {
  579.                             PS3.SetMemory(Element(500 + ClientUsing), new byte[0xB4]);
  580.                             WriteFloat(WeaponID + 0x20, WeaponZ1 += -0.7f);
  581.                             if (i == 36)
  582.                             {
  583.                                 WriteUInt(WeaponID + 0x58, (uint)Call(0x1BE7A8, "weapon_ak47_iw5"));
  584.                                 PS3.SetMemory(Element(500 + ClientUsing), new byte[0xB4]);
  585.                                 Running = false;
  586.                                 break;
  587.                             }
  588.                             Thread.Sleep(200);
  589.                         }
  590.                     }
  591.                     Thread.Sleep(2000);
  592.                 }
  593.             }
  594.         }
  595.         #endregion
  596.  
  597.         public static void Spawn(float[] Origin, float[] Angles)
  598.         {
  599.             Enable();
  600.             ThreadStart Start = null;
  601.             Thread.Sleep(100);
  602.             if (Start == null)
  603.             {
  604.                 Start = () => MBFunction(Origin, Angles);
  605.             }
  606.             MBThread = new Thread(Start);
  607.             MBThread.IsBackground = true;
  608.             MBThread.Start();
  609.         }
  610.  
  611.         public static void DeleteMB()
  612.         {
  613.             MBThread.Abort();
  614.             for (uint i = 0; i < 3; i++)
  615.                 PS3.SetMemory(MBIndexes[i], new byte[0x280]);
  616.             PS3.SetMemory(0xF0E10C + (500 * 0xB4), new byte[18 * 0xB4]);
  617.         }
  618.     }
  619. }
Advertisement
Add Comment
Please, Sign In to add comment