Post: [C#/Release] Spawning Entities
11-14-2014, 09:09 PM #1
xReaperv3
Bounty hunter
(adsbygoogle = window.adsbygoogle || []).push({}); NOTE: If you freeze, connect via CCAPI! I currently have no idea what happens, i will look over it l8er Smile
*Thanks to FFM | iMoDz + GsRClans for telling me

[UPDATESad Awesome Some people asked me for this :P]

Hi NGU, i only see the same tools over and over - so i want to bring you guys something new, like Shark did with his usable Turrets.

Once i'd like to say thanks to Shark, i took EntOrigin + EntAngles from his Thread and Aerosoul for his Asset Dump, where i used some Models to test it!

*If you dont know how to find Models, browse in this section and you will find Aerosoul's Thread, download it and view the "xmodels.txt" Smile

I dont want to say more, you guys should know the rest...

Here's a picture of what you can do:

You must login or register to view this content.

And here's the code:
*If you dont have Read&WriteSingle, its simply Read&WriteFloat, you guys should be smart anought! Smile
    
public static uint spawnEntity(string ModelName, float[] Origin, float[] Angles)
{
uint Entity = (uint)RPC.Call(0x3669B0);
RPC.WriteSingle(Entity + 0x138, Origin);
RPC.WriteSingle(Entity + 0x148, Angles);
RPC.Call(0x365738, Entity, ModelName);
RPC.Call(0x35B6C4, Entity);
return Entity;
}


if you still don't have any idea on how to use it, ill made some quick functions for you! Smile
    
public static uint G_Client(int clientIndex, uint Mod = 0x00)
{
return (0x1950880 + (0x4180 * (uint)clientIndex) + Mod);
}

public static float[] getPlayerOrigin(int clientIndex)
{
return RPC.ReadSingle(G_Client(clientIndex, 0x7Cool Man (aka Tustin), 3);
}

public static float[] getPlayerAngles(int clientIndex)
{
return RPC.ReadSingle(G_Client(clientIndex, 0x1B4), 3);
}


Use it like this:

    
spawnEntity(<string>,<float>,<float>Winky Winky;
spawnentity("modelName", getPlayerOrigin(0), getPlayerAngles(0)); <- this will spawn an Entity at Client 0's origin!
if you dont want to use Angles, simply go on like this:
spawnEntity("modelname", getPlayerOrigin(0), new float[] { 0, 0, 0 });


Here's something cool that TheModedHacker made:
*what it does: it should spawn an entity infront of you, with a distance of 6 meters! Smile <- needs to be tested!

    
public void EntityAnglesToForward(int client, string Model, int Distance = 6)
{
float diff = Distance * 40;
float [] Angles = Lib.ReadSingle(G_Client(client, 0x7Cool Man (aka Tustin), 3);
float [] Position = Lib.ReadSingle(G_Client(client, 0x1B4), 3);

float num = ((float)Math.Sin((Angles[0] * Math.PI) / 180)) * diff;
float num1 = (float)Math.Sqrt(((diff * diff) - (num * num)));
float num2 = ((float)Math.Sin((Angles[1] * Math.PI) / 180)) * num1;
float num3 = ((float)Math.Cos((Angles[1] * Math.PI) / 180)) * num1;

float[] forward = new float[] { Position[0] + num3, Position[1] + num2, Position[2] - num };
spawnEntity(Model, forward, Angles);

}


Maybe someone will use it, maybe not. But i'm sure it's something cool to mess with Smile

Credits are ontop but yea,

Me - Making the Functions + Finding Addresses
Shark - EntityOrigin + EntityAngles
Aerosoul - Asset Dump
TheModedHacker - EntityAnglesToForward (Extra Function he posted below)

Have a greate day! Smile
Last edited by xReaperv3 ; 11-25-2014 at 10:51 PM. Reason: Updated to 1.04

The following 13 users say thank you to xReaperv3 for this useful post:

Arrow_Modz, Boliberrys, br0wniiez, EnVatoHD, FusionIsDaName, GermanModdingPS, HiddenHour, LBK, RGaming, SaberNGU, Swaqq, TheModedHacker, zAlbanianModder
11-14-2014, 11:21 PM #11
Very Nice Thx Winky Winky
11-15-2014, 12:50 PM #12
Great work Happy

The following user thanked GermanModdingPS for this useful post:

xReaperv3
11-25-2014, 10:52 PM #13
xReaperv3
Bounty hunter
Updated to 1.04 because some people asked me for this
11-26-2014, 10:53 AM #14
            public static UInt32 SpawnEntity(String model = "projectile_pod_care_package", Single x = 0, Single y = 0, Single z = 0, Single yaw = 0, Single pitch = 0, Single roll = 0)
{
UInt32 entity = (uint)RPC.Call(0x3669B0);
PS3.Extension.WriteFloat((entity + 0x134), x);
PS3.Extension.WriteFloat((entity + 0x13C), y);
PS3.Extension.WriteFloat((entity + 0x13Cool Man (aka Tustin), z);
PS3.Extension.WriteFloat((entity + 0x140), yaw);
PS3.Extension.WriteFloat((entity + 0x144), pitch);
PS3.Extension.WriteFloat((entity + 0x14Cool Man (aka Tustin), roll);
RPC.Call(0x365738, entity, model);
RPC.Call(0x35B658, entity);
Thread.Sleep(30);
return entity;
}



11-26-2014, 01:04 PM #15
xReaperv3
Bounty hunter
Originally posted by xFusion View Post
            public static UInt32 SpawnEntity(String model = "projectile_pod_care_package", Single x = 0, Single y = 0, Single z = 0, Single yaw = 0, Single pitch = 0, Single roll = 0)
{
UInt32 entity = (uint)RPC.Call(0x3669B0);
PS3.Extension.WriteFloat((entity + 0x134), x);
PS3.Extension.WriteFloat((entity + 0x13C), y);
PS3.Extension.WriteFloat((entity + 0x13Cool Man (aka Tustin), z);
PS3.Extension.WriteFloat((entity + 0x140), yaw);
PS3.Extension.WriteFloat((entity + 0x144), pitch);
PS3.Extension.WriteFloat((entity + 0x14Cool Man (aka Tustin), roll);
RPC.Call(0x365738, entity, model);
RPC.Call(0x35B658, entity);
Thread.Sleep(30);
return entity;
}





+04 & +08... 😂
12-03-2014, 07:00 PM #16
Thanks reaper
12-03-2014, 11:51 PM #17
Items
Bounty hunter
Gw <3

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo