Post: [1.02] Spawn Usable Turrets
11-02-2014, 11:57 AM #1
Shark
Retired.
(adsbygoogle = window.adsbygoogle || []).push({}); Hey, since all I have really seen is a bunch of people doing the same shit over and over and a bunch of "Offset and Address" Threads I thought I would bring something new to the table tears and it took me 5 minutes :p

I would like to thank SC58 for his RPC even though he forgot to make it return values yet again but its ok I will post a fixed version below because this wont work without an RPC that does not return values Sad Awesome

well anyway heres the codes, ill get a pic laters.


RPC
    
private static UInt32 function_address = 0x5F7B80;

public static int Init()
{
if (function_address == 0) return -1;
Enable_RPC();
return 0;
}

public static void Enable_RPC()
{
PS3.SetMemory(function_address, new byte[] { 0x4E, 0x80, 0x00, 0x20 });
System.Threading.Thread.Sleep(20);
byte[] func = new byte[] { 0x7C, 0x08, 0x02, 0xA6, 0xF8, 0x01, 0x00, 0x80, 0x3C, 0x60, 0x10, 0x05, 0x81, 0x83, 0x00, 0x4C, 0x2C, 0x0C, 0x00, 0x00, 0x41, 0x82, 0x00, 0x64, 0x80, 0x83, 0x00, 0x04, 0x80, 0xA3, 0x00, 0x08, 0x80, 0xC3, 0x00, 0x0C, 0x80, 0xE3, 0x00, 0x10, 0x81, 0x03, 0x00, 0x14, 0x81, 0x23, 0x00, 0x18, 0x81, 0x43, 0x00, 0x1C, 0x81, 0x63, 0x00, 0x20, 0xC0, 0x23, 0x00, 0x24, 0xC0, 0x43, 0x00, 0x28, 0xC0, 0x63, 0x00, 0x2C, 0xC0, 0x83, 0x00, 0x30, 0xC0, 0xA3, 0x00, 0x34, 0xC0, 0xC3, 0x00, 0x38, 0xC0, 0xE3, 0x00, 0x3C, 0xC1, 0x03, 0x00, 0x40, 0xC1, 0x23, 0x00, 0x48, 0x80, 0x63, 0x00, 0x00, 0x7D, 0x89, 0x03, 0xA6, 0x4E, 0x80, 0x04, 0x21, 0x3C, 0x80, 0x10, 0x05, 0x38, 0xA0, 0x00, 0x00, 0x90, 0xA4, 0x00, 0x4C, 0x90, 0x64, 0x00, 0x50, 0xE8, 0x01, 0x00, 0x80, 0x7C, 0x08, 0x03, 0xA6, 0x38, 0x21, 0x00, 0x70, 0x4E, 0x80, 0x00, 0x20 };
PS3.SetMemory(function_address + 0x4, func);
PS3.SetMemory(0x10050000, new byte[0x2854]);
PS3.SetMemory(function_address, new byte[] { 0xF8, 0x21, 0xFF, 0x91 });
}

public static int Call(uint func_address, params object[] parameters)
{
int num_params = parameters.Length;
uint num_floats = 0;
for (uint i = 0; i < num_params; i++)
{
if (parameters[i] is int)
{
byte[] val = BitConverter.GetBytes((int)parameters[i]);
Array.Reverse(val);
PS3.SetMemory(0x10050000 + (i + num_floats) * 4, val);
}
else if (parameters[i] is uint)
{
byte[] val = BitConverter.GetBytes((uint)parameters[i]);
Array.Reverse(val);
PS3.SetMemory(0x10050000 + (i + num_floats) * 4, val);
}
else if (parameters[i] is string)
{
byte[] str = Encoding.UTF8.GetBytes(Convert.ToString(parameters[i]) + "\0");
PS3.SetMemory(0x10050054 + i * 0x400, str);
uint addr = 0x10050054 + i * 0x400;
byte[] address = BitConverter.GetBytes(addr);
Array.Reverse(address);
PS3.SetMemory(0x10050000 + (i + num_floats) * 4, address);
}
else if (parameters[i] is float)
{
num_floats++;
byte[] val = BitConverter.GetBytes((float)parameters[i]);
Array.Reverse(val);
PS3.SetMemory(0x10050024 + ((num_floats - 1) * 0x4), val);
}
}
byte[] fadd = BitConverter.GetBytes(func_address);
Array.Reverse(fadd);
PS3.SetMemory(0x1005004C, fadd);
System.Threading.Thread.Sleep(20);
byte[] ret = PS3.GetMemory(0x10050050, 4);
Array.Reverse(ret);
return BitConverter.ToInt32(ret, 0);
}


Spawn Turrets
    
class Offsets
{
public static UInt32
//Entity
G_Entity = 0x1815300,
G_EntitySize = 0x280,
EntOrigin = 0x138,
EntAngles = 0x148,
G_Spawn = 0x363528,
G_SpawnTurret = 0x377D38,
G_GetWeaponIndexForName = 0x368048,
G_SetModel = 0x3622DC;

public static Int32 G_Spawn()
{
return Call(Offsets.G_Spawn);//G_Spawn
}

public static UInt32 spawnTurret(String TurretType, String ModelName, float[] Origin, float[] Angles)
{
UInt32 Ent = (uint)G_Spawn();
WriteFloat(Ent + Offsets.EntOrigin, Origin);//Set Origin
WriteFloat(Ent + Offsets.EntAngles, Angles);//Set Angles
Call(Offsets.G_SetModel, Ent, ModelName);//Set Turret Model
Call(Offsets.G_SpawnTurret, Ent, TurretType);//G_SpawnTurret
return Ent;
}
}


How To Use It
    
spawnTurret("turretType", "turretModel", turretOrigin[3], turretAngles[3]);

[B]Example[/B]
spawnTurret("remote_energy_turret_mp", "npc_sentry_energy_turret_base", playerPosition, new float[] { 0, 0, 0 }); //Spawns A Turret That Shoots Lasers, pew pew!


Turret Types & Models
    
[B]Types[/B]
turretheadmg_mp
turretheadenergy_mp
sentry_minigun_mp
remote_turret_mp
remote_energy_turret_mp
killstreak_remote_turret_mp
warbird_turret
ugv_turret_mp
warbird_remote_turret_mp
orbitalsupport_big_turret_mp
orbitalsupport_buddy_turret_mp
recon_drone_turret_mp
drone_assault_remote_turret_mp

[B]Models[/B]
npc_remote_turret_base
npc_sentry_rocket_turret_base_yellow_obj
npc_sentry_energy_turret_empty_base
orbitalsupport_big_turret
npc_sentry_minigun_turret_base_yellow_obj
npc_sentry_rocket_turret_base_red_obj
npc_sentry_rocket_turret_base
orbitalsupport_small_turret
npc_sentry_energy_turret_base_red_obj
npc_sentry_energy_turret_base_yellow_obj
npc_sentry_rocket_turret_empty_base
npc_sentry_minigun_turret_empty_base
npc_sentry_energy_turret_base
npc_sentry_minigun_turret_base
orbitalsupport_medium_turret
npc_sentry_minigun_turret_base_red_obj
fx_osp_turret_f
vehicle_atlas_aerial_drone_02_patrol_mp_turret_75p
vehicle_atlas_aerial_drone_01_mp_turret_50p
npc_heavy_exo_armor_turret_base

//I'm not sure if all of these will work but a few of these should!


Credits
SC58 - RPC
Aerosaul - Assest Dumps

Enjoy Tiphat

The following 30 users say thank you to Shark for this useful post:

One, Boliberrys, EG6, flynhigh09, Geo, Yenix, jacob_9191, Jakeboii, Jannik007, JOniiX85, MegaMister, Murderlikedj, NotALegitPlayer, OLDSCHOOLMODZHD, RatchetBooty, Adrian, Reyz, RGaming, RTE, some fukn rand, Sunnis, Swaqq, TheModedHacker, TreyBeModding-, xDebugKiller, xIce KiLLaH, xProvXKiller, zRayz-
11-02-2014, 02:48 PM #11
Sorry i have a problem You must login or register to view this content.
Last edited by JulienDev ; 11-02-2014 at 03:09 PM.
11-02-2014, 06:51 PM #12
Absolute Zero
Do your homework, fool.
Originally posted by Shark View Post
Hey, since all I have really seen is a bunch of people doing the same shit over and over and a bunch of "Offset and Address" Threads I thought I would bring something new to the table tears and it took me 5 minutes :p

I would like to thank SC58 for his RPC even though he forgot to make it return values yet again but its ok I will post a fixed version below because this wont work without an RPC that does not return values Sad Awesome

well anyway heres the codes, ill get a pic laters.


RPC
    
private static UInt32 function_address = 0x5F7B80;

public static int Init()
{
if (function_address == 0) return -1;
Enable_RPC();
return 0;
}

public static void Enable_RPC()
{
PS3.SetMemory(function_address, new byte[] { 0x4E, 0x80, 0x00, 0x20 });
System.Threading.Thread.Sleep(20);
byte[] func = new byte[] { 0x7C, 0x08, 0x02, 0xA6, 0xF8, 0x01, 0x00, 0x80, 0x3C, 0x60, 0x10, 0x05, 0x81, 0x83, 0x00, 0x4C, 0x2C, 0x0C, 0x00, 0x00, 0x41, 0x82, 0x00, 0x64, 0x80, 0x83, 0x00, 0x04, 0x80, 0xA3, 0x00, 0x08, 0x80, 0xC3, 0x00, 0x0C, 0x80, 0xE3, 0x00, 0x10, 0x81, 0x03, 0x00, 0x14, 0x81, 0x23, 0x00, 0x18, 0x81, 0x43, 0x00, 0x1C, 0x81, 0x63, 0x00, 0x20, 0xC0, 0x23, 0x00, 0x24, 0xC0, 0x43, 0x00, 0x28, 0xC0, 0x63, 0x00, 0x2C, 0xC0, 0x83, 0x00, 0x30, 0xC0, 0xA3, 0x00, 0x34, 0xC0, 0xC3, 0x00, 0x38, 0xC0, 0xE3, 0x00, 0x3C, 0xC1, 0x03, 0x00, 0x40, 0xC1, 0x23, 0x00, 0x48, 0x80, 0x63, 0x00, 0x00, 0x7D, 0x89, 0x03, 0xA6, 0x4E, 0x80, 0x04, 0x21, 0x3C, 0x80, 0x10, 0x05, 0x38, 0xA0, 0x00, 0x00, 0x90, 0xA4, 0x00, 0x4C, 0x90, 0x64, 0x00, 0x50, 0xE8, 0x01, 0x00, 0x80, 0x7C, 0x08, 0x03, 0xA6, 0x38, 0x21, 0x00, 0x70, 0x4E, 0x80, 0x00, 0x20 };
PS3.SetMemory(function_address + 0x4, func);
PS3.SetMemory(0x10050000, new byte[0x2854]);
PS3.SetMemory(function_address, new byte[] { 0xF8, 0x21, 0xFF, 0x91 });
}

public static int Call(uint func_address, params object[] parameters)
{
int num_params = parameters.Length;
uint num_floats = 0;
for (uint i = 0; i < num_params; i++)
{
if (parameters[i] is int)
{
byte[] val = BitConverter.GetBytes((int)parameters[i]);
Array.Reverse(val);
PS3.SetMemory(0x10050000 + (i + num_floats) * 4, val);
}
else if (parameters[i] is uint)
{
byte[] val = BitConverter.GetBytes((uint)parameters[i]);
Array.Reverse(val);
PS3.SetMemory(0x10050000 + (i + num_floats) * 4, val);
}
else if (parameters[i] is string)
{
byte[] str = Encoding.UTF8.GetBytes(Convert.ToString(parameters[i]) + "\0");
PS3.SetMemory(0x10050054 + i * 0x400, str);
uint addr = 0x10050054 + i * 0x400;
byte[] address = BitConverter.GetBytes(addr);
Array.Reverse(address);
PS3.SetMemory(0x10050000 + (i + num_floats) * 4, address);
}
else if (parameters[i] is float)
{
num_floats++;
byte[] val = BitConverter.GetBytes((float)parameters[i]);
Array.Reverse(val);
PS3.SetMemory(0x10050024 + ((num_floats - 1) * 0x4), val);
}
}
byte[] fadd = BitConverter.GetBytes(func_address);
Array.Reverse(fadd);
PS3.SetMemory(0x1005004C, fadd);
System.Threading.Thread.Sleep(20);
byte[] ret = PS3.GetMemory(0x10050050, 4);
Array.Reverse(ret);
return BitConverter.ToInt32(ret, 0);
}


Spawn Turrets
    
class Offsets
{
public static UInt32
//Entity
G_Entity = 0x1815300,
G_EntitySize = 0x280,
EntOrigin = 0x138,
EntAngles = 0x148,
G_Spawn = 0x363528,
G_SpawnTurret = 0x377D38,
G_GetWeaponIndexForName = 0x368048,
G_SetModel = 0x3622DC;

public static Int32 G_Spawn()
{
return Call(Offsets.G_Spawn);//G_Spawn
}

public static UInt32 spawnTurret(String TurretType, String ModelName, float[] Origin, float[] Angles)
{
UInt32 Ent = (uint)G_Spawn();
WriteFloat(Ent + Offsets.EntOrigin, Origin);//Set Origin
WriteFloat(Ent + Offsets.EntAngles, Angles);//Set Angles
Call(Offsets.G_SetModel, Ent, ModelName);//Set Turret Model
Call(Offsets.G_SpawnTurret, Ent, TurretType);//G_SpawnTurret
return Ent;
}
}


How To Use It
    
spawnTurret("turretType", "turretModel", turretOrigin[3], turretAngles[3]);

[B]Example[/B]
spawnTurret("remote_energy_turret_mp", "npc_sentry_energy_turret_base", playerPosition, new float[] { 0, 0, 0 }); //Spawns A Turret That Shoots Lasers, pew pew!


Turret Types & Models
    
[B]Types[/B]
turretheadmg_mp
turretheadenergy_mp
sentry_minigun_mp
remote_turret_mp
remote_energy_turret_mp
killstreak_remote_turret_mp
warbird_turret
ugv_turret_mp
warbird_remote_turret_mp
orbitalsupport_big_turret_mp
orbitalsupport_buddy_turret_mp
recon_drone_turret_mp
drone_assault_remote_turret_mp

[B]Models[/B]
npc_remote_turret_base
npc_sentry_rocket_turret_base_yellow_obj
npc_sentry_energy_turret_empty_base
orbitalsupport_big_turret
npc_sentry_minigun_turret_base_yellow_obj
npc_sentry_rocket_turret_base_red_obj
npc_sentry_rocket_turret_base
orbitalsupport_small_turret
npc_sentry_energy_turret_base_red_obj
npc_sentry_energy_turret_base_yellow_obj
npc_sentry_rocket_turret_empty_base
npc_sentry_minigun_turret_empty_base
npc_sentry_energy_turret_base
npc_sentry_minigun_turret_base
orbitalsupport_medium_turret
npc_sentry_minigun_turret_base_red_obj
fx_osp_turret_f
vehicle_atlas_aerial_drone_02_patrol_mp_turret_75p
vehicle_atlas_aerial_drone_01_mp_turret_50p
npc_heavy_exo_armor_turret_base

//I'm not sure if all of these will work but a few of these should!


Credits
SC58 - RPC
Aerosaul - Assest Dumps

Enjoy Tiphat


Pretty sick to see this working with way more models and turret types for this game Happy
11-02-2014, 07:33 PM #13
spawnTurret("remote_energy_turret_mp", "npc_sentry_energy_turret_base", playerPosition, new float[] { 0, 0, 0 });

I have error here
11-02-2014, 08:28 PM #14
EG6
Are you high?
So I guess this is when I ask you when are you releasing ZombieLand for AW? Tiphat
11-02-2014, 11:14 PM #15
Boliberrys
^^ Sexy ^^
How can i fix this?

You must login or register to view this content.

Please help :3
Last edited by Boliberrys ; 11-02-2014 at 11:18 PM.
11-03-2014, 01:07 AM #16
Originally posted by Boliberrys View Post
How can i fix this?

You must login or register to view this content.

Please help :3


Its saying that there is already a definition of G_Spawn, which means there is two things defining it, you just need to rename "G_Spawn = 0x363528" to "G_SpawnOffset = 0x363528" and then rename it in that function also.

The following 2 users say thank you to NotALegitPlayer for this useful post:

Boliberrys, Taylor

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo