Post: [C++/SPRX] "Entity" Functions
08-09-2014, 02:27 PM #1
xReaperv3
Bounty hunter
(adsbygoogle = window.adsbygoogle || []).push({}); Hi NGU, i dont know if this is allready released yet,

I've just wanted to get Spawning Entitys working, so i made some shit for that - i havent tested it yet, maybe it works / maybe not. Smile

First you will need this:

    
#define TOC 0xD67E98


Then the Offsets you will need:


    
struct opd_s
{
uint32_t sub;
uint32_t toc;
};


    
namespace Offsets
{
enum Addr
{
G_SetModel = 0x277644,
G_Spawn = 0x278C60,
G_SpawnTurret = 0x2BA5C8,
G_SpawnHelicopter = 0x22C558,
SP_Script_Model = 0x2670E8
};
}



Here are some Functions with this:


G_Spawn:

    
int G_Spawn()
{
opd_s GSpawn = { Offsets::G_Spawn, TOC };
int(*G_SPN)(void) = (int(*)(void))&GSpawn;
return G_SPN();
}


G_SetModel:

    
void G_SetModel(int entityIndex, const char* ModelName)
{
opd_s Modl = { Offsets::G_SetModel, TOC };
void(*G_SM)(int, const char*) = (void(*)(int, const char*))&Modl;
G_SM(entityIndex, ModelName);
}


SP_Script_Model:

    
void SP_Script_Model(int entityIndex)
{
opd_s Modl = { Offsets::SP_Script_Model, TOC };
void(*SPSM)(int) = (void(*)(int))&Modl;
SPSM(entityIndex);
}


G_SpawnTurret:

    
void G_SpawnTurret(int entityIndex, const char* TurretType)
{
opd_s Trt = { Offsets::G_SpawnTurret, TOC };
void(*G_ST)(int, const char*) = (void(*)(int, const char*))&Trt;
G_ST(entityIndex, TurretType);
}


G_SpawnHelicopter:

    
void G_SpawnHelicopter(int vehicleIndex, int Owner, const char* VehicleType, const char* VehicleName)
{
opd_s Vhl = { Offsets::G_SpawnTurret, TOC };
void(*G_SH)(int, int, const char*, const char*) = (void(*)(int, int, const char*, const char*))&Vhl;
G_SH(vehicleIndex, Owner, VehicleType, VehicleName);
}



Maybe this is helpfull...
As i said, i dont know if its working or not, you can try Smile

Credits:
Shark - TOC, opd_s Struct, Addresses
Me - Making this Functions
(adsbygoogle = window.adsbygoogle || []).push({});

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

Arrow_Modz, WEx_Modz123, xballox, zAlbanianModder
08-09-2014, 05:05 PM #2
xballox
Pokemon Trainer
Love u finally <3 <3. I will test it for you Winky Winky

The following user thanked xballox for this useful post:

xReaperv3
08-09-2014, 05:32 PM #3
this isn't gonna work lol
08-09-2014, 05:36 PM #4
xReaperv3
Bounty hunter
Originally posted by OLDSCHOOLMODZHD View Post
this isn't gonna work lol


Well, i wanted to use it like this, also i said im not sure.

    
int SpawnModel(const char* ModelName, float* X, float* Y, float* Z, float* Yaw = 0, float* Pitch = 0, float* Roll = 0)
{
int Model = G_Spawn();
DataFunctions::WriteFloat((Model + 0x134), X, 1);
DataFunctions::WriteFloat((Model + 0x13C), Y, 1);
DataFunctions::WriteFloat((Model + 0x13Cool Man (aka Tustin), Z, 1);
DataFunctions::WriteFloat((Model + 0x140), Yaw, 1);
DataFunctions::WriteFloat((Model + 0x144), Pitch, 1);
DataFunctions::WriteFloat((Model + 0x14Cool Man (aka Tustin), Roll, 1);
G_SetModel(Model, ModelName);
SP_Script_Model(Model);
return Model;
}

08-09-2014, 05:43 PM #5
Originally posted by xReaperv3 View Post
~snip~


Yea I tried that a long time ago it just freezes :p
08-09-2014, 05:45 PM #6
xReaperv3
Bounty hunter
Originally posted by OLDSCHOOLMODZHD View Post
Yea I tried that a long time ago it just freezes :p


Umm allright, Thread can be closed then - now i need to find another way Smile

Thanks for your reply
08-10-2014, 02:02 AM #7
Hash847
Purple God
Wont work.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo