Skip to content

Commit f65b8e2

Browse files
committed
feat(CBaseEntity): EmitSound
1 parent 4e92c89 commit f65b8e2

File tree

5 files changed

+16
-0
lines changed

5 files changed

+16
-0
lines changed

plugin_files/gamedata/signatures.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@
134134
"windows": "48 89 5C 24 10 48 89 6C 24 18 56 57 41 56 48 83 EC 30 80 B9 A0 00 00 00 00",
135135
"linux": "48 85 F6 0F 84 2A 2A 2A 2A 55 31 C9 48 89 E5 41 55 49 89 FD"
136136
},
137+
"CBaseEntity_EmitSoundParams": {
138+
"lib": "server",
139+
"windows": "48 8B C4 48 89 58 10 48 89 70 18 55 57 41 56 48 8D A8 08 FF FF FF",
140+
"linux": "48 B8 2A 2A 2A 2A 2A 2A 2A 2A 55 48 89 E5 41 55 41 54 49 89 FC 53 48 89 F3"
141+
},
137142
"LoggingSystem_Log": {
138143
"lib": "tier0",
139144
"windows": "@LoggingSystem_Log",

src/plugins/core/scripting/generated/GClasses1.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,9 @@ GCEntitySubclassVDataBase GCBaseEntity::GetVData() {
562562
void GCBaseEntity::Teleport(Vector value) {
563563
((Z_CBaseEntity*)m_ptr)->Teleport(&value, nullptr, nullptr);
564564
}
565+
void GCBaseEntity::EmitSound(std::string sound_name, int pitch, float volume, float delay) {
566+
((Z_CBaseEntity*)m_ptr)->EmitSound(sound_name, pitch, volume, delay);
567+
}
565568
GCBodyComponent GCBaseEntity::GetCBodyComponent() const {
566569
GCBodyComponent value(*(void**)GetSchemaPtr(m_ptr, "CBaseEntity", "m_CBodyComponent"));
567570
return value;
@@ -1137,6 +1140,7 @@ void SetupLuaClassCBaseEntity(LuaPlugin *plugin, lua_State *state)
11371140
.addFunction("GetVData", &GCBaseEntity::GetVData)
11381141
.addFunction("Teleport", &GCBaseEntity::Teleport)
11391142
.addFunction("EHandle", &GCBaseEntity::EHandle)
1143+
.addFunction("EmitSound", &GCBaseEntity::EmitSound)
11401144
.addFunction("ToPtr", &GCBaseEntity::ToPtr)
11411145
.addFunction("IsValid", &GCBaseEntity::IsValid)
11421146
.endClass();

src/plugins/core/scripting/generated/classes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1727,6 +1727,7 @@ class GCBaseEntity
17271727
std::string GetClassname();
17281728
GCEntitySubclassVDataBase GetVData();
17291729
void Teleport(Vector value);
1730+
void EmitSound(std::string sound_name, int pitch, float volume, float delay);
17301731
GCBaseEntity EHandle();
17311732
GCBodyComponent GetCBodyComponent() const;
17321733
void SetCBodyComponent(GCBodyComponent value);

src/sdk/entity/CBaseEntity.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,5 +168,10 @@ class Z_CBaseEntity : public CEntityInstance
168168
g_Signatures->FetchSignature<CEntityInstance_AcceptInput>("CEntityInstance_AcceptInput")(this, pInputName, pActivator, pCaller, &variantValue, outputID);
169169
}
170170

171+
void EmitSound(std::string sound_name, int pitch, float volume, float delay)
172+
{
173+
g_Signatures->FetchSignature<CBaseEntity_EmitSoundParams>("CBaseEntity_EmitSoundParams")(this, sound_name.c_str(), pitch, volume, delay);
174+
}
175+
171176
CEntitySubclassVDataBase *GetVData() { return *(CEntitySubclassVDataBase **)((uint8 *)(m_nSubclassID()) + 4); }
172177
};

src/signatures/Signatures.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ typedef void (*GiveNamedItem_t)(CCSPlayer_ItemServices *, const char *, int, int
3131
typedef void (*CBasePlayerController_SetPawn)(CBasePlayerController *, CCSPlayerPawn *, bool, bool);
3232
typedef void (*CCSPlayerPawnBase_PostThink)(CCSPlayerPawnBase *);
3333
typedef void (*CBaseEntity_TakeDamageOld)(Z_CBaseEntity *, CTakeDamageInfo *);
34+
typedef void (*CBaseEntity_EmitSoundParams)(Z_CBaseEntity*, const char*, int, float, float);
3435

3536
class Signatures
3637
{

0 commit comments

Comments
 (0)