Post: [1.11] Spawning Solid Models C#
05-02-2014, 02:03 AM #1
RatchetBooty
Former Staff
(adsbygoogle = window.adsbygoogle || []).push({});
Here is the Spawning Solid Models code for Ghosts 1.11, I will be updating it every update, credits to seb5594 for the original code and for the 1.11 addresses. If you need any help please feel free to ask in the comments section below. I know it's not much of a release but I just wanted to update it for the people who don't know how and I've tested the code before I uploaded this thread and it works fine :p.

    
public static void MakeSolid(Int32 Entity, String Mapname)
{
RPC.CallFunction(0x0032A518, Entity);
PS3.Extension.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.Extension.WriteUInt32((UInt32)Entity + 0x8C, PS3.Extension.ReadUInt32(Brush + 0x8C));
RPC.CallFunction(0x0059C6D8, Entity);
Or_Int32((UInt32)Entity + 0x11C, PS3.Extension.ReadInt32((UInt32)Entity + 0x11C));
RPC.CallFunction(0x0032A598, Entity);
}
public static UInt32 G_Entity(Int32 clientIndex)
{
return 0x00E03F80 + ((UInt32)clientIndex * 0x280);
}
public static void Or_Int32(UInt32 address, Int32 input)
{
Int32 or = PS3.Extension.ReadInt32(address);
or |= input;
PS3.Extension.WriteInt32(address, or);
}
public static UInt32 G_Spawn()
{
return (uint)RPC.CallFunction(0x0028EFFCool Man (aka Tustin);
}
public static Int32 SpawnModel(String MapName, String ModelName, Single X, Single Y, Single Z, Single Forward = 0, Single Yaw = 0, Single Pitch = 0)
{
UInt32 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.Extension.WriteBytes((UInt32)Ent + 0x138, buffer);
RPC.CallFunction(0x0028DBEC, Ent, ModelName);
RPC.CallFunction(0x002848B0, Ent);
MakeSolid((int)Ent, MapName);
return (int)Ent;
}


You can use it like this:

    
Byte[] MyOrigin = PS3.Extension.ReadBytes(0x00E03F80 + 0x138, 12);
ArrayBuilder build = new ArrayBuilder(MyOrigin);
Single[] origin = new Single[3];
for (int i = 0; i < 3; i++)
origin[i] = build.Read.GetFloat(i * 4);
SpawnModel("mp_prisonbreak", "com_plasticcase_green_big_us_dirt", origin[0], origin[1], origin[2], 0, 0, 0);


What this will do is the get the origin (x, y, z) of client 0 and spawn a care package on his position, you can replace mp_prisonbreak with the map you are on, or you can have it get the map automatically using Mango_Knife's thread: You must login or register to view this content.. All you would have to do is copy and paste the getmapname function into your code, and then put string map = getMapName(); Then simply replace "mp_prisonbreak" with map.

The following 4 users say thank you to RatchetBooty for this useful post:

▶DaOriginal209◀, Exploited, Mango_Knife
05-02-2014, 09:42 AM #2
Mango_Knife
In my man cave
Originally posted by RatchetBooty View Post
Here is the Spawning Solid Models code for Ghosts 1.11, I will be updating it every update, credits to seb5594 for the original code and for the 1.11 addresses. If you need any help please feel free to ask in the comments section below. I know it's not much of a release but I just wanted to update it for the people who don't know how and I've tested the code before I uploaded this thread and it works fine :p.

    
public static void MakeSolid(Int32 Entity, String Mapname)
{
RPC.CallFunction(0x0032A518, Entity);
PS3.Extension.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.Extension.WriteUInt32((UInt32)Entity + 0x8C, PS3.Extension.ReadUInt32(Brush + 0x8C));
RPC.CallFunction(0x0059C6D8, Entity);
Or_Int32((UInt32)Entity + 0x11C, PS3.Extension.ReadInt32((UInt32)Entity + 0x11C));
RPC.CallFunction(0x0032A598, Entity);
}
public static UInt32 G_Entity(Int32 clientIndex)
{
return 0x00E03F80 + ((UInt32)clientIndex * 0x280);
}
public static void Or_Int32(UInt32 address, Int32 input)
{
Int32 or = PS3.Extension.ReadInt32(address);
or |= input;
PS3.Extension.WriteInt32(address, or);
}
public static UInt32 G_Spawn()
{
return (uint)RPC.CallFunction(0x0028EFFCool Man (aka Tustin);
}
public static Int32 SpawnModel(String MapName, String ModelName, Single X, Single Y, Single Z, Single Forward = 0, Single Yaw = 0, Single Pitch = 0)
{
UInt32 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.Extension.WriteBytes((UInt32)Ent + 0x138, buffer);
RPC.CallFunction(0x0028DBEC, Ent, ModelName);
RPC.CallFunction(0x002848B0, Ent);
MakeSolid((int)Ent, MapName);
return (int)Ent;
}


You can use it like this:

    
Byte[] MyOrigin = PS3.Extension.ReadBytes(0x00E03F80 + 0x138, 12);
ArrayBuilder build = new ArrayBuilder(MyOrigin);
Single[] origin = new Single[3];
for (int i = 0; i < 3; i++)
origin[i] = build.Read.GetFloat(i * 4);
SpawnModel("mp_prisonbreak", "com_plasticcase_green_big_us_dirt", origin[0], origin[1], origin[2], 0, 0, 0);


What this will do is the get the origin (x, y, z) of client 0 and spawn a care package on his position, you can replace mp_prisonbreak with the map you are on, or you can have it get the map automatically using Mango_Knife's thread: You must login or register to view this content.. All you would have to do is copy and paste the getmapname function into your code, and then put string map = getMapName(); Then simply replace "mp_prisonbreak" with map.


You getting better and better in C# my friend Smile
05-02-2014, 10:54 AM #3
iTпDM
Vault dweller
verry nice , My Friend :yes:
05-02-2014, 04:18 PM #4
ImSooCool
Vault dweller
Originally posted by Knife View Post
You getting better and better in C# my friend Smile

all he did was update the addresses =_=

The following 3 users say thank you to ImSooCool for this useful post:

iNDMx, xHostModer, xReaperv3
05-03-2014, 06:29 PM #5
Mango_Knife
In my man cave
Originally posted by ImSooCool View Post
all he did was update the addresses =_=


Really?
Didnt noticed..
05-03-2014, 06:30 PM #6
ImSooCool
Vault dweller
Originally posted by Knife View Post
Really?
Didnt noticed..


Well duh if you didn't :P
05-05-2014, 08:58 AM #7
    
void Scr_GetLowercaseString(char*str, void*out)
{
char* buffer = new char[strlen(str)];
for(int i = 0; i < 3; i++)
buffer[i] = (char)tolower(str[i]);
memcpy(out, (void*)SL_GetString(buffer, 0), 0x4);
delete[] buffer;
}

void (*SV_LinkEntity)(int entity) = (void(__cdecl*)(int))0x824EB6C8;
void Solid(int entity,bool enabled)
{
while((*(short*)(entity + 0x17A) != *(short*)0x834D912Cool Man (aka Tustin))
{
if(enabled)
if(*(short*)(entity + 0x17A) & *(short*)(0x834D9126)) *(int*)(entity + 0x11C) = 0x2080;
else *(int*)(entity + 0x0Cool Man (aka Tustin) &= ~0x01; *(int*)(entity + 0x11C) = 1;
SV_LinkEntity(entity);
else
if(*(short*)(entity + 0x17A) & *(short*)(0x834D9126)) *(int*)(entity + 0x11C) = 0;
else *(int*)(entity + 0x0Cool Man (aka Tustin) |= 0x01;
SV_LinkEntity(entity);
}
}

int getBrushModel()
{
int id;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_prisionbreak"))
id = 0x38;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_dart"))
id = 0x6B;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_lonestar"))
id = 0x6A;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_frag"))
id = 0x55;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_snow"))
id = 0x56;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_fahrenheit"))
id = 0xA8;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_hasima"))
id = 0x63;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_warhawk"))
id = 0x45;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_soverign"))
id = 0x72;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_zebra"))
id = 0x44;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_skeleton"))
id = 0x3A;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_chasm"))
id = 0x49;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_flooded") || !strcmp(Dvar_GetString("ui_mapname"),"mp_strikezone"))
id = 0x57;
return 0x8336AD80 + (id * 0x280);
}

void CloneBrushModelToScriptModel(int entity, bool enabled)
{
int script_brushmodel = getBrushModel();
SV_UnLinkEntity(entity);
if(enabled)
*(int*)(entity + 0x8C) = *(int*)(script_brushmodel + 0x8C);
*(unsigned char*)(entity + 0x101) = 04;
SV_SetBrushModel(entity);
*(int*)(entity + 0x11C) |= *(int*)(script_brushmodel + 0x11C);
else
*(int*)(entity + 0x8C)=0;*(int*)(entity + 0x11C)=0;*(unsigned char*)(entity + 0x101)
SV_LinkEntity(entity);
}

int spawn(char*className, float*source, int flag)
{
int entity = G_Spawn(); int classIndex;
Scr_GetConstLowercaseString(className, &classIndex);
*(short*)(entity + 0x17C) = (short)classIndex;
*(float*)(entity + 0x13Cool Man (aka Tustin) = source[0];
*(float*)(entity + 0x13C) = source[1];
*(float*)(entity + 0x140) = source[2];
*(int*)(entity + 0x18Cool Man (aka Tustin) = flag;
*(int*)(entity + 0x11C) = 0;
return entity;
}

int spawnPlane(int entity, char*className, float*source, char*someString="", char*someOtherString="", int flag=0)
{
int ent = G_Spawn(), hagay = __8215E768(someString),classIndex=0, mhm = __8215E768(someOtherString);
Scr_GetConstLowercase(className, &classIndex);
*(short*)(ent + 0x17C) = (short)classIndex;
*(float*)(ent + 0x13Cool Man (aka Tustin) = source[0];
*(float*)(ent + 0x13C) = source[1];
*(float*)(ent + 0x140) = source[2];
*(int*)(ent + 0x18Cool Man (aka Tustin) = flag;
if(!G_CallSpawnEntity(ent)) G_FreeEntity(ent); return -1;
else
*(int*)(ent + 0x04) = 0xD;
*(int*)(ent + 0x5C) = hagay;
*(int*)(ent + 0x5Cool Man (aka Tustin) = mhm;
*(int*)(ent + 0x54) = ((*(int*)(entity + 0x15Cool Man (aka Tustin) - *(int*)(0x833738ACool Man (aka Tustin)) / 0x3700);
return ent;
return ent;
}


This is how you spawn entities :P
05-05-2014, 11:39 AM #8
Originally posted by B1TW153 View Post
    
void Scr_GetLowercaseString(char*str, void*out)
{
char* buffer = new char[strlen(str)];
for(int i = 0; i < 3; i++)
buffer[i] = (char)tolower(str[i]);
memcpy(out, (void*)SL_GetString(buffer, 0), 0x4);
delete[] buffer;
}

void (*SV_LinkEntity)(int entity) = (void(__cdecl*)(int))0x824EB6C8;
void Solid(int entity,bool enabled)
{
while((*(short*)(entity + 0x17A) != *(short*)0x834D912Cool Man (aka Tustin))
{
if(enabled)
if(*(short*)(entity + 0x17A) & *(short*)(0x834D9126)) *(int*)(entity + 0x11C) = 0x2080;
else *(int*)(entity + 0x0Cool Man (aka Tustin) &= ~0x01; *(int*)(entity + 0x11C) = 1;
SV_LinkEntity(entity);
else
if(*(short*)(entity + 0x17A) & *(short*)(0x834D9126)) *(int*)(entity + 0x11C) = 0;
else *(int*)(entity + 0x0Cool Man (aka Tustin) |= 0x01;
SV_LinkEntity(entity);
}
}

int getBrushModel()
{
int id;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_prisionbreak"))
id = 0x38;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_dart"))
id = 0x6B;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_lonestar"))
id = 0x6A;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_frag"))
id = 0x55;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_snow"))
id = 0x56;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_fahrenheit"))
id = 0xA8;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_hasima"))
id = 0x63;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_warhawk"))
id = 0x45;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_soverign"))
id = 0x72;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_zebra"))
id = 0x44;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_skeleton"))
id = 0x3A;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_chasm"))
id = 0x49;
if(!strcmp(Dvar_GetString("ui_mapname"),"mp_flooded") || !strcmp(Dvar_GetString("ui_mapname"),"mp_strikezone"))
id = 0x57;
return 0x8336AD80 + (id * 0x280);
}

void CloneBrushModelToScriptModel(int entity, bool enabled)
{
int script_brushmodel = getBrushModel();
SV_UnLinkEntity(entity);
if(enabled)
*(int*)(entity + 0x8C) = *(int*)(script_brushmodel + 0x8C);
*(unsigned char*)(entity + 0x101) = 04;
SV_SetBrushModel(entity);
*(int*)(entity + 0x11C) |= *(int*)(script_brushmodel + 0x11C);
else
*(int*)(entity + 0x8C)=0;*(int*)(entity + 0x11C)=0;*(unsigned char*)(entity + 0x101)
SV_LinkEntity(entity);
}

int spawn(char*className, float*source, int flag)
{
int entity = G_Spawn(); int classIndex;
Scr_GetConstLowercaseString(className, &classIndex);
*(short*)(entity + 0x17C) = (short)classIndex;
*(float*)(entity + 0x13Cool Man (aka Tustin) = source[0];
*(float*)(entity + 0x13C) = source[1];
*(float*)(entity + 0x140) = source[2];
*(int*)(entity + 0x18Cool Man (aka Tustin) = flag;
*(int*)(entity + 0x11C) = 0;
return entity;
}

int spawnPlane(int entity, char*className, float*source, char*someString="", char*someOtherString="", int flag=0)
{
int ent = G_Spawn(), hagay = __8215E768(someString),classIndex=0, mhm = __8215E768(someOtherString);
Scr_GetConstLowercase(className, &classIndex);
*(short*)(ent + 0x17C) = (short)classIndex;
*(float*)(ent + 0x13Cool Man (aka Tustin) = source[0];
*(float*)(ent + 0x13C) = source[1];
*(float*)(ent + 0x140) = source[2];
*(int*)(ent + 0x18Cool Man (aka Tustin) = flag;
if(!G_CallSpawnEntity(ent)) G_FreeEntity(ent); return -1;
else
*(int*)(ent + 0x04) = 0xD;
*(int*)(ent + 0x5C) = hagay;
*(int*)(ent + 0x5Cool Man (aka Tustin) = mhm;
*(int*)(ent + 0x54) = ((*(int*)(entity + 0x15Cool Man (aka Tustin) - *(int*)(0x833738ACool Man (aka Tustin)) / 0x3700);
return ent;
return ent;
}


This is how you spawn entities :P


Can't really post C/C++ coding in here most of the kids don't know it Winky Winky
05-05-2014, 04:25 PM #9
BeaTsDominion
live life to its fullest
Thanks!
05-05-2014, 06:03 PM #10
SC58
Former Staff
Originally posted by AlmightySo View Post
Can't really post C/C++ coding in here most of the kids don't know it Winky Winky


well if they don't know it then i guess there out of luck :p lol

The following user thanked SC58 for this useful post:

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo