Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*This Community is really fucked, but i make my Release for People like: Mango_Knife, Seb, Bass_Haxor, xJoren :)
- Have Fun using this :)
- Big Thanks to Seb5594 :) <3
- CREDITS: http://www.nextgenupdate.com/forums/modern-warfare-3-mods-patches-tutorials/746787-c-spawn-solid-models-stairs-heaven.html
- xCSBKx [GMT]
- GMTPS3
- https://www.youtube.com/watch?v=dBCfhgSXEiY
- */
- public static class Spawner
- {
- #region Read + Write
- private static float[] ReadFloatLength(uint Offset, int Length)
- {
- byte[] buffer = new byte[Length * 4];
- PS3.GetMemory(Offset, buffer);
- ReverseBytes(buffer);
- float[] Array = new float[Length];
- for (int i = 0; i < Length; i++)
- {
- Array[i] = BitConverter.ToSingle(buffer, (Length - 1 - i) * 4);
- }
- return Array;
- }
- private static void WriteByte(uint Offset, byte Byte)
- {
- byte[] buffer = new byte[1];
- buffer[0] = Byte;
- PS3.SetMemory(Offset, buffer);
- }
- private static void WriteFloatArray(uint Offset, float[] Array)
- {
- byte[] buffer = new byte[Array.Length * 4];
- for (int Lenght = 0; Lenght < Array.Length; Lenght++)
- {
- ReverseBytes(BitConverter.GetBytes(Array[Lenght])).CopyTo(buffer, Lenght * 4);
- }
- PS3.SetMemory(Offset, buffer);
- }
- private static void WriteInt(uint Offset, int Value)
- {
- PS3.SetMemory(Offset, ReverseBytes(BitConverter.GetBytes(Value)));
- }
- private static byte[] ReverseBytes(byte[] inArray)
- {
- Array.Reverse(inArray);
- return inArray;
- }
- #endregion
- public enum Bush : uint//I will seach for these and Release them :)
- {
- CarePackage = 2,
- Bomb = 3,
- }
- public static uint SolidModel(float[] Origin, float[] Angles, string Model = "com_plasticcase_friendly", Bush Index = Bush.CarePackage)
- {
- uint Entity = (uint)RPC.Call(0x01C058C);//G_Spawn
- WriteFloatArray(Entity + 0x138, Origin);//Position
- WriteFloatArray(Entity + 0x144, Angles);//Orientation
- RPC.Call(0x01BEF5C, Entity, Model);//G_SetModel
- RPC.Call(0x01B6F68, Entity); //SP_script_model
- RPC.Call(0x002377B8, Entity);//SV_UnlinkEntity
- WriteByte(Entity + 0x101, 4);
- WriteInt(Entity + 0x8C, (int)Index);
- RPC.Call(0x0022925C, Entity);//SV_SetBrushModel
- RPC.Call(0x00237848, Entity);//SV_LinkEntity
- return Entity;
- }
- public static float[] GetOrigin(uint Client)
- {
- return ReadFloatLength(0x110a29c + (Client * 0x3980), 3);
- }
- public static float[] GetAngles(uint Client)
- {
- return ReadFloatLength(0x110a3d8 + (Client * 0x3980), 3);
- }
- public static float[] AnglesToForward(float[] Origin, float[] Angles, uint diff)
- {
- float num = ((float)Math.Sin((Angles[0] * Math.PI) / 180)) * diff;
- float num1 = (float)Math.Sqrt(((diff * diff) - (num * num)));
- float num2 = ((float)Math.Sin((Angles[1] * Math.PI) / 180)) * num1;
- float num3 = ((float)Math.Cos((Angles[1] * Math.PI) / 180)) * num1;
- return new float[] { Origin[0] + num3, Origin[1] + num2, Origin[2] - num };
- }
- private static uint[] STHIndexes;
- public static void StairsToHeaven(uint Client, uint Stairs = 41, int Time = 200)//When you use STH you can Freeze dont make it to Fast 200 is Good time and dont to Much Staris 41 Stairs = 2 Rounds :)
- {
- uint[] Index = new uint[Stairs];
- float[] Origin = GetOrigin(Client);
- float[] Angles = new float[3];
- for (uint i = 0; i < Stairs; )
- {
- Index[i] = SolidModel(AnglesToForward(Origin, Angles, 60), Angles);
- Angles[1] += 18;
- Origin[2] += 10;
- i++;
- Thread.Sleep(Time);
- }
- STHIndexes = Index;
- }
- public static void RemoveSTH()
- {
- for (uint i = 0; i < STHIndexes.Length; i++)
- PS3.SetMemory(STHIndexes[i], new byte[0x280]);
- }
- }
- //Spawn a Create:
- uint Client = Put Client Number here!;
- float[] Origin = Spawner.AnglesToForward(Spawner.GetOrigin(Client), Spawner.GetAngles(Client),80);
- Origin[2] += 40;//
- Spawner.SolidModel(Origin, new float[] { 0, 0, 0 });
- //Spawn the Stairs to Heaven:
- Spawner.StairsToHeaven(Put Client Number here!);
- //Remove the STH:
- Spawner.RemoveSTH();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement