Skip to content

Commit

Permalink
Update player.h
Browse files Browse the repository at this point in the history
  • Loading branch information
zpl-zak committed Aug 27, 2024
1 parent 93c1f47 commit 8a3f880
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions code/server/src/core/builtins/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,22 @@
#include <sol/sol.hpp>

#include "integrations/server/scripting/builtins/node/entity.h"
#include "shared/modules/human_sync.hpp"
#include "scripting/server_engine.h"

namespace MafiaMP::Scripting {
class Vehicle;
class Human final: public Framework::Integrations::Scripting::Entity {
public:
Human(flecs::entity_t ent): Entity(ent) {}
Human(flecs::entity ent): Entity(ent) {}
Human(flecs::entity_t ent): Entity(ent) {
const auto humanData = _ent.get<Shared::Modules::HumanSync::UpdateData>();

if (!humanData) {
throw std::runtime_error(fmt::format("Entity handle '{}' is not a Human!", ent));
}
}

Human(flecs::entity ent): Human(ent.id()) {}

static void EventPlayerDied(flecs::entity e);
static void EventPlayerConnected(flecs::entity e);
Expand Down

0 comments on commit 8a3f880

Please sign in to comment.