diff --git a/source/Entity/Blip.cpp b/source/Entity/Blip.cpp index d1f0a065..e2f6cb9a 100644 --- a/source/Entity/Blip.cpp +++ b/source/Entity/Blip.cpp @@ -116,6 +116,15 @@ void CBlip::BindEvent(Int32 evid, Object & env, Function & func) const } } +// ------------------------------------------------------------------------------------------------ +void CBlip::CustomEvent(Int32 header, Object & payload) const +{ + // Validate the managed identifier + Validate(); + // Perfrom the requested action + Core::Get().EmitBlipCustom(m_ID, header, payload); +} + // ------------------------------------------------------------------------------------------------ Int32 CBlip::GetWorld() const { @@ -304,6 +313,7 @@ void Register_CBlip(HSQUIRRELVM vm) .Prop(_SC("Active"), &CBlip::IsActive) // Core Methods .Func(_SC("Bind"), &CBlip::BindEvent) + .Func(_SC("CustomEvent"), &CBlip::CustomEvent) // Core Overloads .Overload< bool (CBlip::*)(void) >(_SC("Destroy"), &CBlip::Destroy) .Overload< bool (CBlip::*)(Int32) >(_SC("Destroy"), &CBlip::Destroy) diff --git a/source/Entity/Blip.hpp b/source/Entity/Blip.hpp index 52727372..23e48a22 100644 --- a/source/Entity/Blip.hpp +++ b/source/Entity/Blip.hpp @@ -157,6 +157,11 @@ public: */ void BindEvent(Int32 evid, Object & env, Function & func) const; + /* -------------------------------------------------------------------------------------------- + * Emit a custom event for the managed entity + */ + void CustomEvent(Int32 header, Object & payload) const; + /* -------------------------------------------------------------------------------------------- * Retrieve the world in which the referenced blip entity exists. */ diff --git a/source/Entity/Checkpoint.cpp b/source/Entity/Checkpoint.cpp index 8c2ff5db..16f66911 100644 --- a/source/Entity/Checkpoint.cpp +++ b/source/Entity/Checkpoint.cpp @@ -129,6 +129,15 @@ void CCheckpoint::BindEvent(Int32 evid, Object & env, Function & func) const } } +// ------------------------------------------------------------------------------------------------ +void CCheckpoint::CustomEvent(Int32 header, Object & payload) const +{ + // Validate the managed identifier + Validate(); + // Perfrom the requested action + Core::Get().EmitCheckpointCustom(m_ID, header, payload); +} + // ------------------------------------------------------------------------------------------------ bool CCheckpoint::IsStreamedFor(CPlayer & player) const { @@ -497,6 +506,7 @@ void Register_CCheckpoint(HSQUIRRELVM vm) .Prop(_SC("Active"), &CCheckpoint::IsActive) // Core Methods .Func(_SC("Bind"), &CCheckpoint::BindEvent) + .Func(_SC("CustomEvent"), &CCheckpoint::CustomEvent) // Core Overloads .Overload< bool (CCheckpoint::*)(void) >(_SC("Destroy"), &CCheckpoint::Destroy) .Overload< bool (CCheckpoint::*)(Int32) >(_SC("Destroy"), &CCheckpoint::Destroy) diff --git a/source/Entity/Checkpoint.hpp b/source/Entity/Checkpoint.hpp index 29872e00..58beb640 100644 --- a/source/Entity/Checkpoint.hpp +++ b/source/Entity/Checkpoint.hpp @@ -164,6 +164,11 @@ public: */ void BindEvent(Int32 evid, Object & env, Function & func) const; + /* -------------------------------------------------------------------------------------------- + * Emit a custom event for the managed entity + */ + void CustomEvent(Int32 header, Object & payload) const; + /* -------------------------------------------------------------------------------------------- * See if the managed checkpoint entity is streamed for the specified player. */ diff --git a/source/Entity/Keybind.cpp b/source/Entity/Keybind.cpp index 9d7c8b61..f7b31db8 100644 --- a/source/Entity/Keybind.cpp +++ b/source/Entity/Keybind.cpp @@ -116,6 +116,15 @@ void CKeybind::BindEvent(Int32 evid, Object & env, Function & func) const } } +// ------------------------------------------------------------------------------------------------ +void CKeybind::CustomEvent(Int32 header, Object & payload) const +{ + // Validate the managed identifier + Validate(); + // Perfrom the requested action + Core::Get().EmitKeybindCustom(m_ID, header, payload); +} + // ------------------------------------------------------------------------------------------------ Int32 CKeybind::GetFirst() const { @@ -203,6 +212,7 @@ void Register_CKeybind(HSQUIRRELVM vm) .Prop(_SC("Active"), &CKeybind::IsActive) // Core Methods .Func(_SC("Bind"), &CKeybind::BindEvent) + .Func(_SC("CustomEvent"), &CKeybind::CustomEvent) // Core Overloads .Overload< bool (CKeybind::*)(void) >(_SC("Destroy"), &CKeybind::Destroy) .Overload< bool (CKeybind::*)(Int32) >(_SC("Destroy"), &CKeybind::Destroy) diff --git a/source/Entity/Keybind.hpp b/source/Entity/Keybind.hpp index 0e6010e6..5a694bd3 100644 --- a/source/Entity/Keybind.hpp +++ b/source/Entity/Keybind.hpp @@ -157,6 +157,11 @@ public: */ void BindEvent(Int32 evid, Object & env, Function & func) const; + /* -------------------------------------------------------------------------------------------- + * Emit a custom event for the managed entity + */ + void CustomEvent(Int32 header, Object & payload) const; + /* -------------------------------------------------------------------------------------------- * Retrieve the first key code of the managed keybind entity. */ diff --git a/source/Entity/Object.cpp b/source/Entity/Object.cpp index d03930ce..4371b235 100644 --- a/source/Entity/Object.cpp +++ b/source/Entity/Object.cpp @@ -129,6 +129,15 @@ void CObject::BindEvent(Int32 evid, Object & env, Function & func) const } } +// ------------------------------------------------------------------------------------------------ +void CObject::CustomEvent(Int32 header, Object & payload) const +{ + // Validate the managed identifier + Validate(); + // Perfrom the requested action + Core::Get().EmitObjectCustom(m_ID, header, payload); +} + // ------------------------------------------------------------------------------------------------ bool CObject::IsStreamedFor(CPlayer & player) const { @@ -832,6 +841,7 @@ void Register_CObject(HSQUIRRELVM vm) .Prop(_SC("Active"), &CObject::IsActive) // Core Methods .Func(_SC("Bind"), &CObject::BindEvent) + .Func(_SC("CustomEvent"), &CObject::CustomEvent) // Core Overloads .Overload< bool (CObject::*)(void) >(_SC("Destroy"), &CObject::Destroy) .Overload< bool (CObject::*)(Int32) >(_SC("Destroy"), &CObject::Destroy) diff --git a/source/Entity/Object.hpp b/source/Entity/Object.hpp index 652f5543..592a93ae 100644 --- a/source/Entity/Object.hpp +++ b/source/Entity/Object.hpp @@ -179,6 +179,11 @@ public: */ void BindEvent(Int32 evid, Object & env, Function & func) const; + /* -------------------------------------------------------------------------------------------- + * Emit a custom event for the managed entity + */ + void CustomEvent(Int32 header, Object & payload) const; + /* -------------------------------------------------------------------------------------------- * See if the managed object entity is streamed for the specified player. */ diff --git a/source/Entity/Pickup.cpp b/source/Entity/Pickup.cpp index 4206edcf..e30cbe04 100644 --- a/source/Entity/Pickup.cpp +++ b/source/Entity/Pickup.cpp @@ -121,6 +121,15 @@ void CPickup::BindEvent(Int32 evid, Object & env, Function & func) const } } +// ------------------------------------------------------------------------------------------------ +void CPickup::CustomEvent(Int32 header, Object & payload) const +{ + // Validate the managed identifier + Validate(); + // Perfrom the requested action + Core::Get().EmitPickupCustom(m_ID, header, payload); +} + // ------------------------------------------------------------------------------------------------ bool CPickup::IsStreamedFor(CPlayer & player) const { @@ -385,6 +394,7 @@ void Register_CPickup(HSQUIRRELVM vm) .Prop(_SC("Active"), &CPickup::IsActive) // Core Methods .Func(_SC("Bind"), &CPickup::BindEvent) + .Func(_SC("CustomEvent"), &CPickup::CustomEvent) // Core Overloads .Overload< bool (CPickup::*)(void) >(_SC("Destroy"), &CPickup::Destroy) .Overload< bool (CPickup::*)(Int32) >(_SC("Destroy"), &CPickup::Destroy) diff --git a/source/Entity/Pickup.hpp b/source/Entity/Pickup.hpp index 71387574..ea4d2dbb 100644 --- a/source/Entity/Pickup.hpp +++ b/source/Entity/Pickup.hpp @@ -160,6 +160,11 @@ public: */ void BindEvent(Int32 evid, Object & env, Function & func) const; + /* -------------------------------------------------------------------------------------------- + * Emit a custom event for the managed entity + */ + void CustomEvent(Int32 header, Object & payload) const; + /* -------------------------------------------------------------------------------------------- * See if the managed pickup entity is streamed for the specified player. */ diff --git a/source/Entity/Player.cpp b/source/Entity/Player.cpp index cf46c275..89c7674a 100644 --- a/source/Entity/Player.cpp +++ b/source/Entity/Player.cpp @@ -142,6 +142,15 @@ void CPlayer::BindEvent(Int32 evid, Object & env, Function & func) const } } +// ------------------------------------------------------------------------------------------------ +void CPlayer::CustomEvent(Int32 header, Object & payload) const +{ + // Validate the managed identifier + Validate(); + // Perfrom the requested action + Core::Get().EmitPlayerCustom(m_ID, header, payload); +} + // ------------------------------------------------------------------------------------------------ bool CPlayer::IsConnected() const { @@ -2195,6 +2204,7 @@ void Register_CPlayer(HSQUIRRELVM vm) .Prop(_SC("Active"), &CPlayer::IsActive) // Core Methods .Func(_SC("Bind"), &CPlayer::BindEvent) + .Func(_SC("CustomEvent"), &CPlayer::CustomEvent) // Properties .Prop(_SC("Connected"), &CPlayer::IsConnected) .Prop(_SC("Admin"), &CPlayer::GetAdmin, &CPlayer::SetAdmin) diff --git a/source/Entity/Player.hpp b/source/Entity/Player.hpp index e3ee61a4..9f5752c6 100644 --- a/source/Entity/Player.hpp +++ b/source/Entity/Player.hpp @@ -215,6 +215,11 @@ public: */ void BindEvent(Int32 evid, Object & env, Function & func) const; + /* -------------------------------------------------------------------------------------------- + * Emit a custom event for the managed entity + */ + void CustomEvent(Int32 header, Object & payload) const; + /* -------------------------------------------------------------------------------------------- * See whether the managed player entity is connected. */ diff --git a/source/Entity/Vehicle.cpp b/source/Entity/Vehicle.cpp index be9c4b50..4da70d2b 100644 --- a/source/Entity/Vehicle.cpp +++ b/source/Entity/Vehicle.cpp @@ -125,6 +125,15 @@ void CVehicle::BindEvent(Int32 evid, Object & env, Function & func) const } } +// ------------------------------------------------------------------------------------------------ +void CVehicle::CustomEvent(Int32 header, Object & payload) const +{ + // Validate the managed identifier + Validate(); + // Perfrom the requested action + Core::Get().EmitVehicleCustom(m_ID, header, payload); +} + // ------------------------------------------------------------------------------------------------ bool CVehicle::IsStreamedFor(CPlayer & player) const { @@ -1652,6 +1661,7 @@ void Register_CVehicle(HSQUIRRELVM vm) .Prop(_SC("Active"), &CVehicle::IsActive) // Core Methods .Func(_SC("Bind"), &CVehicle::BindEvent) + .Func(_SC("CustomEvent"), &CVehicle::CustomEvent) // Core Overloads .Overload< bool (CVehicle::*)(void) >(_SC("Destroy"), &CVehicle::Destroy) .Overload< bool (CVehicle::*)(Int32) >(_SC("Destroy"), &CVehicle::Destroy) diff --git a/source/Entity/Vehicle.hpp b/source/Entity/Vehicle.hpp index b139c985..b3507fb3 100644 --- a/source/Entity/Vehicle.hpp +++ b/source/Entity/Vehicle.hpp @@ -175,6 +175,11 @@ public: */ void BindEvent(Int32 evid, Object & env, Function & func) const; + /* -------------------------------------------------------------------------------------------- + * Emit a custom event for the managed entity + */ + void CustomEvent(Int32 header, Object & payload) const; + /* -------------------------------------------------------------------------------------------- * See if the managed vehicle entity is streamed for the specified player. */