Post: [C#] Spawn Solid Models (1.07)
01-09-2014, 02:33 AM #1
seb5594
Proud Former Admin
(adsbygoogle = window.adsbygoogle || []).push({});
Originally posted by another user
Hey NGU,

Since some ppl figured out how spawning Model's work and how to make them solid, i show you how to make it for your own Tool / Project using PS3Lib v4 by iMCSx.

Requirements:
You must login or register to view this content.
You must login or register to view this content. (Fixed RPC, thanks to Shark for posting it)
Brain Needa

Add this to your Project/Class:

    

public static Int32 G_Spawn()
{
return RPC.Call(0x0028A170);
}
public static Int32 SpawnCrate(String MapName, Single X, Single Y, Single Z, Single Forward = 0, Single Yaw = 0, Single Pitch = 0)
{
return SpawnModel(MapName, "carepackage_friendly_iw6", X, Y, Z, Forward, Yaw, Pitch);
}
public static Int32 SpawnModel(String MapName, String ModelName, Single X, Single Y, Single Z, Single Forward = 0, Single Yaw = 0, Single Pitch = 0)
{
Int32 Ent = G_Spawn();
Byte[] buffer = new Byte[24];
ArrayBuilder Build = new ArrayBuilder(buffer);
Build.Write.SetFloat(0, X);
Build.Write.SetFloat(4, Y);
Build.Write.SetFloat(8, Z);
Build.Write.SetFloat(12, Forward);
Build.Write.SetFloat(16, Yaw);
Build.Write.SetFloat(20, Pitch);
PS3.Extensions.WriteBytes((UInt32)Ent + 0x138, buffer);
RPC.Call(0x00288D64, Ent, ModelName);
RPC.Call(0x0027FA28, Ent);
MakeSolid(Ent, MapName);
return Ent;
}
private static void MakeSolid(Int32 Entity, String Mapname)
{
RPC.Call(0x00323A68, Entity);
PS3.Extensions.WriteByte((UInt32)Entity + 0x101, 4);
UInt32 Brush = 0;
switch (Mapname)
{
case "mp_prisonbreak":
Brush = G_Entity(0x3Cool Man (aka Tustin);
break;
case "mp_dart":
Brush = G_Entity(0x6B);
break;
case "mp_lonestar":
Brush = G_Entity(0x6A);
break;
case "mp_frag":
Brush = G_Entity(0x55);
break;
case "mp_snow":
Brush = G_Entity(0x56);
break;
case "mp_fahrenheit":
Brush = G_Entity(0xACool Man (aka Tustin);
break;
case "mp_hasima":
Brush = G_Entity(0x63);
break;
case "mp_warhawk":
Brush = G_Entity(0x45);
break;
case "mp_sovereign":
Brush = G_Entity(0x72);
break;
case "mp_zebra":
Brush = G_Entity(0x44);
break;
case "mp_skeleton":
Brush = G_Entity(0x3A);
break;
case "mp_chasm":
Brush = G_Entity(0x49);
break;
case "mp_flooded":
Brush = G_Entity(0x57);
break;
case "mp_strikezone":
Brush = G_Entity(0x57);
break;
}
PS3.Extensions.WriteUInt32((UInt32)Entity + 0x8C, PS3.Extensions.ReadUInt32(Brush + 0x8C));
RPC.Call(0x00500010, Entity);
Or_Int32((UInt32)Entity + 0x11C, PS3.Extensions.ReadInt32((UInt32)Entity + 0x11C));
RPC.Call(0x00323AE8, Entity);
}
public static UInt32 G_Entity(Int32 clientIndex)
{
return 0xDE1C00+ ((UInt32)clientIndex * 0x280);
}
public static void Or_Int32(UInt32 address, Int32 input)
{
Int32 or = PS3.Extensions.ReadInt32(address);
or |= input;
PS3.Extensions.WriteInt32(address, or);
}


I have created a example code on how to use it (thx to iMCSx for his nice Array Builder)
(it should spawn a Carepackage on your position)

    		public static void TestSpawn()
{
Byte[] MyOrigin = PS3.Extension.ReadBytes(G_Entity(0) + 0x138, 12);
ArrayBuilder build = new ArrayBuilder(MyOrigin);
Single[] origin = new Single[3];
for(int i = 0; i < 3; i++)
origin[i] = build.GetFloat(i * 4);
SpawnCrate("mp_prisonbreak", origin[0], origin[1], origin[2]);
}


Have fun with creating bunker's and other fun stuff for your Tool/Modmenu

Credits:
Therifboy and seb5594 - Original PS3 Founders of this
Hacksource from Se7ensins - Brush Offsets for some Maps
iMCSx - PS3Lib & help with the ArrayBuilder Smile
Activision - for their shitty game :plank:

Little list of working models by iBullet1
Originally posted by another user
prop_suitcase_bomb
prop_flag_neutral
prop_ballistic_vest_iw6
prop_ballistic_vest_iw6_bombsquad
prop_mp_max_ammo_pickup
mp_satcom_obj
mp_satcom_obj_red
mp_satcom_bombsquad
com_metal_briefcase_intel
mp_weapon_crate_bombsquad
mp_trophy_system_iw6_bombsquad
mp_trophy_system_iw6
mp_body_juggernaut_light_black
head_juggernaut_light_black
mp_body_infected_a
head_mp_infected
mp_body_us_rangers_assault_a_arctic
mp_body_us_rangers_assault_a_desert
mp_body_us_rangers_assault_a_elite
mp_body_us_rangers_assault_a_urban
mp_body_us_rangers_assault_a_woodland
viewhands_us_rangers_arctic
viewhands_us_rangers_desert
viewhands_us_rangers_elite
viewhands_us_rangers_urban
viewhands_us_rangers_woodland
Last edited by seb5594 ; 02-14-2014 at 01:56 AM. Reason: Updated for 1.07

The following 23 users say thank you to seb5594 for this useful post:

{H} | Exception, $ticky, AlexNGU, Bucko, clark1226, ErasedDev, EdiTzZ, Harry, iMoDz-Baptiste, ImPiffHD, ItsLollo1000, Mango_Knife, micha112, milky4444, MODZ4FUN420, MoTmrD-, MrShark, John, SnaY, Source Code, WeJailbreakYou, Winter, Fatality
06-02-2014, 12:32 AM #29
Nice port from 7s...if you actually reversed GScr_Spawn, you would have the classnames's...also the last 4 lines inside your solid function have nothing to do with it being solid...

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo