Post: [Release/1.14] Spawn Turrets
07-11-2014, 07:55 AM #1
Taylor
Former Black Knight.
(adsbygoogle = window.adsbygoogle || []).push({});

I got bored and thought it would be cool to try and spawn these. Anyway, have fun killing people with it! Smile

spawnTurret Function:[/SIZE]
    
public static void spawnTurret(string TurretType, string ModelName, float[] Origin, float[] Angles)
{
uint Ent = (uint)Lib.Call(0x001BCD10);
Lib.WriteSingle(Ent + 0x138, Origin);
Lib.WriteSingle(Ent + 0x144, Angles);
Lib.Call(0x001BE3F0, Ent, ModelName);
Lib.Call(0x001C8820, Ent, TurretType);
}


How to call it:[/SIZE]
    
spawnTurret("pavelow_minigun_mp", "weapon_minigun", getOrigin([b]clientNumberHere[/b]), getAngles([b]clientNumberHere[/b]));

Functions Needed:[/SIZE]
    
public static float[] getAngles(int client)
{
return new float[] { DEX.Extension.ReadFloat(Lib.G_Client(client) + 0x214), DEX.Extension.ReadFloat(Lib.G_Client(client) + 0x21Cool Man (aka Tustin), DEX.Extension.ReadFloat(Lib.G_Client(client) + 0x21C) };
}
public static float[] getOrigin(int client)
{
return new float[] { DEX.Extension.ReadFloat(Lib.G_Client(client) + 0x1C), DEX.Extension.ReadFloat(Lib.G_Client(client) + 0x20), DEX.Extension.ReadFloat(Lib.G_Client(client) + 0x24) + 45 };
}
public static UInt32 G_Client(Int32 clientIndex)
{
return 0x14E2200 + (0x3700 * (UInt32)clientIndex);
}
public static void WriteSingle(uint address, float[] input)
{
int length = input.Length;
byte[] array = new byte[length * 4];
for (int i = 0; i < length; i++)
{
ReverseBytes(BitConverter.GetBytes(input[i])).CopyTo(array, (int)(i * 4));
}
DEX.SetMemory(address, array);
}
private static byte[] ReverseBytes(byte[] inArray)
{
Array.Reverse(inArray);
return inArray;
}


Note: You will also need the working/non-freezing RPC originally by You must login or register to view this content. fixed by You must login or register to view this content. found You must login or register to view this content.[/SIZE]
(adsbygoogle = window.adsbygoogle || []).push({});

The following 19 users say thank you to Taylor for this useful post:

AlexNGU, CanadianModding, Chris, Faim, iNDMx, Joel, Joren, Deleted-User0000000012210, MrKiller261, MrRambo, NotALegitPlayer, Notorious, OtagoFlames, MysteryAviate, Shark, SnaY, Fatality, xXDarkSystemXx
07-11-2014, 07:56 AM #2
CanadianModding
Do a barrel roll!
Nice post Winky Winky
07-11-2014, 07:57 AM #3
OMG thank u but how do i connect my bricked controler to my ps3 mainframe because i cant bypass the usb menu using rpc
07-11-2014, 07:57 AM #4
Taylor
Former Black Knight.
Originally posted by MrRambo View Post
OMG thank u but how do i connect my bricked controler to my ps3 mainframe because i cant bypass the usb menu using rpc


Ramiro, Mother of God
07-14-2014, 02:41 PM #5
VezahMoDz
Do a barrel roll!
Originally posted by MrRambo View Post
OMG thank u but how do i connect my bricked controler to my ps3 mainframe because i cant bypass the usb menu using rpc


wut the h4ck lmao
07-14-2014, 06:51 PM #6
A single is 4 bytes in length...so it's not going to write the full vector. You should just write up 2 methods for setting & getting vector's. It's simple, but incase you either don't have confidence in yourself to write it, or just don't know how it works, here, try this;

    
void WriteVec(UInt32 address, Single[] vec)
{
for(uint i = 0, f = 0; i < vec.Length; i++, f += 4)
{
PS3.WriteSingle((address)+f,vec[i]);
}
}

Single[] ReadVec(UInt32 address, UInt32 dim)
{
Single[] vec = new Single[dim];
for(uint i = 0, f = 0; i < dim; i++, f += 4);
{
vec[i] = PS3.ReadSingle((address)+f);
}
return vec;
}


E.G;
    
Single[] myOrigin = ReadVec(g_entity(0) + 0x18, 3);
WriteVec(g_entity(1) + 0x18, myOrigin);

The following user thanked Bitwise for this useful post:

John
07-21-2014, 06:16 PM #7
xCLS
Do a barrel roll!
Thanks TaylorSmileSmile
08-02-2014, 05:25 AM #8
Chris
Former Staff
What a great share, thanks heaps Taylor.
02-19-2015, 05:43 PM #9
i have it working but i cant Shoot with it?

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo