struct gclient_s {
char unk0[0x78];
float origin[3];
char unk1[0x12C];
float viewAngles[3]; //0x353C
char unk2[0x3380];
int oldbuttons;
char unk3[0x8];
int buttons;
char unk4[0x434];
};
struct gagent_s {
char unk[0x100];
};
struct gentity_s {
char unk0[0x1C];
int contents;
char unk1[0x118];
float currentOrigin[3];
float currentAngles[3];
char unk2[0x8];
gclient_s* client;
char unk3[0x4];
gagent_s* agent;
char unk4[0x16];
short classname;
short script_classname;
short script_linkName;
short target;
short targetname;
char unk5[0x2];
unsigned int attachIgnoreCollision;
int spawnflags;
char unk6[0x19];
int health;
char unk7[0xCF];
};
gentity_s* G_Spawn()
{
opd_s G_Spawn_t = { 0x00389510, TOC };
gentity_s*(*G_Spawn_f)() = (gentity_s*(*)())&G_Spawn_t;
return G_Spawn_f();
}
void G_SetModel(gentity_s* ent, char* Model)
{
opd_s G_SetModel_t = { 0x00388294, TOC };
void(*G_SetModel_f)(gentity_s* ent, char* Model) = (void(*)(gentity_s*, char*))&G_SetModel_t;
G_SetModel_f(ent, Model);
}
void SP_Script_Model(gentity_s* ent)
{
opd_s SP_Script_Model_t = { 0x0037DDD4, TOC };
void(*SP_Script_Model_f)(gentity_s* ent) = (void(*)(gentity_s*))&SP_Script_Model_t;
SP_Script_Model_f(ent);
}
void SV_LinkEntity(gentity_s* ent)
{
opd_s SV_LinkEntity_t = { 0x004737A0, TOC };
void(*SV_LinkEntity_f)(gentity_s* ent) = (void(*)(gentity_s*))&SV_LinkEntity_t;
SV_LinkEntity_f(ent);
}
void SV_UnlinkEntity(gentity_s* ent)
{
opd_s SV_UnlinkEntity_t = { 0x00473720, TOC };
void(*SV_UnlinkEntity_f)(gentity_s* ent) = (void(*)(gentity_s*))&SV_UnlinkEntity_t;
SV_UnlinkEntity_f(ent);
}
void SV_SetBrushModel(gentity_s* ent)
{
opd_s SV_SetBrushModel_t = { 0x00457D04, TOC };
void(*SV_SetBrushModel_f)(gentity_s* ent) = (void(*)(gentity_s*))&SV_SetBrushModel_t;
SV_SetBrushModel_f(ent);
}
void G_SpawnTurret(gentity_s* ent, const char *weaponinfoname, const int useDropPitch)
{
opd_s G_SpawnTurret_t = { 0x0039E620, TOC };
void(*G_SpawnTurret_f)(gentity_s* ent, const char *weaponinfoname, const int useDropPitch) = (void(*)(gentity_s* , const char *, const int))&G_SpawnTurret_t;
G_SpawnTurret_f(ent, weaponinfoname, useDropPitch);
}
gentity_s* SpawnEnt(char* Model, vec3_t Origin, vec3_t Angles)
{
gentity_s* Ent = G_Spawn();
Ent->currentOrigin[0] = Origin[0];
Ent->currentOrigin[1] = Origin[1];
Ent->currentOrigin[2] = Origin[2];
Ent->currentAngles[0] = Angles[0];
Ent->currentAngles[1] = Angles[1];
Ent->currentAngles[2] = Angles[2];
G_SetModel(Ent, Model);
SP_Script_Model(Ent);
SV_UnlinkEntity(Ent);
SV_SetBrushModel(Ent);
SV_LinkEntity(Ent);
return Ent;
}
gentity_s* SpawnTurret(char* TurretType, char* Model, vec3_t Origin, vec3_t Angles)
{
gentity_s* Ent = SpawnEnt(Model, Origin, Angles);
G_SpawnTurret(Ent, TurretType, 0);
}
gentity_s* Crate = SpawnEnt("com_plasticcase_green_big_us_dirt",Origin, Angles)
gentity_s* Turret = SpawnTurret("sentry_minigun_mp", "npc_sentry_energy_turret_base", Origin, Angles);
https://pastebin.com/eeziSJTQ
turretheadmg_mp
turretheadenergy_mp
sentry_minigun_mp
remote_turret_mp
remote_energy_turret_mp
killstreak_remote_turret_mp
warbird_turret
ugv_turret_mp
warbird_remote_turret_mp
orbitalsupport_big_turret_mp
orbitalsupport_buddy_turret_mp
recon_drone_turret_mp
drone_assault_remote_turret_mp
Me - for developing the script
Shark - gentity and gclient struct
Copyright © 2024, NextGenUpdate.
All Rights Reserved.