Post: C# Spawn Solid Models & Stairs to Heaven
07-08-2014, 03:54 PM #1
GMTPS3
Do a barrel roll!
(adsbygoogle = window.adsbygoogle || []).push({}); This Community is realy fucked but i make my Release for People like: Mango_Knife, Seb, Bass_Haxor, xJoren Smile
Have Fun using this Smile

Big Thanks to Seb5594 Smile <3





    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 Smile
{
CarePackage = 2,//com_plasticcase_friendly
Bomb = 3,//com_bomb_objective
Barrel = 11,//com_barrel_benzin
}

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 Smile
{
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] + 0xF, new byte[]{ 0x2});
}
}


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();
(adsbygoogle = window.adsbygoogle || []).push({});

The following 24 users say thank you to GMTPS3 for this useful post:

-JM-, ▶DaOriginal209◀, Akaipwn, BaSs_HaXoR, FusionIsDaName, iifire, Joren, jwm614, kiwi_modz, LaRip8, Mango_Knife, moxl, nay1995, noobRus, RaGE_LoLo69, RTE, seanhellen, Swaqq, Laser, Fatality, xHostModer, xPAQz, xSyntheticPatch
07-16-2014, 11:59 AM #29
nay1995
The Master
Originally posted by jwm614 View Post
Same problem here I'm mess wit it wen I get off work

I made a remove last entity an it works great

    public static void RemoveAll()
{

for (uint i = 0; i < mods.Length; i++)
PS3.SetMemory(mods[i] + 0xF, new byte[] { 0x2 });
}


this works no more freeze on restart



cheers, i didnt restart the game so i was unaware of the freeze, anyway cheers.

The following user thanked nay1995 for this useful post:

GMTPS3
07-16-2014, 04:28 PM #30
jwm614
NextGenUpdate Elite
Originally posted by nay1995 View Post
cheers, i didnt restart the game so i was unaware of the freeze, anyway cheers.


I was doing the same so I had no clue it was freezing until I forgot to make the time limit unlimited
07-16-2014, 04:32 PM #31
jwm614
NextGenUpdate Elite
Originally posted by ResistTheKiwi View Post
Thanks bro. Will give it ago in a few days when I have got time Smile thanks. And also nice work on your latest bunker tool Smile I'll also be using it when I'm free.


Thank you I'm glad you like my tool
07-25-2014, 07:44 PM #32
nice shiz

The following user thanked cyberghosts for this useful post:

GMTPS3

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo