Post: C# Spawn Solid Models code help
02-07-2020, 02:12 AM #1
QuantumDev
Can’t trickshot me!
(adsbygoogle = window.adsbygoogle || []).push({}); Right, so I couldn't find a way to spawn solid models for MW2 so I had to convert code from MW3 (I think) to MW2 and finding the SP_script_model address was a nightmare but I managed to do it.

Here's the code:
    public static uint SolidModel(float[] Origin, float[] Angles, string Model = "com_plasticcase_friendly", Bush Index = Bush.CarePackage)
{
uint Entity = (uint)RPC.Call(0x001BCD10);//G_Spawn
WriteFloatArray(Entity + 0x138, Origin);//Position
WriteFloatArray(Entity + 0x144, Angles);//Orientation
RPC.Call(0x001BE3F0, Entity, Model);//G_SetModel
RPC.Call(0x1B52A0, Entity); //SP_script_model
RPC.Call(0x002271C8, Entity);//SV_UnlinkEntity
PS3.Extension.WriteByte(Entity + 0x101, 4);
PS3.Extension.WriteInt32(Entity + 0x8C, (int)Index);
RPC.Call(0x00219F08, Entity);//SV_SetBrushModel
RPC.Call(0x002285A0, Entity);//SV_LinkEntity
return Entity;
}


The only problem is when I spawn the model into the map, it isn't solid. Anybody got any suggestions?

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo