diff --git a/code/server/src/core/builtins/human.cpp b/code/server/src/core/builtins/human.cpp index dab5433..501c15e 100644 --- a/code/server/src/core/builtins/human.cpp +++ b/code/server/src/core/builtins/human.cpp @@ -42,7 +42,7 @@ namespace MafiaMP::Scripting { return Vehicle(-1); } - int Human::GetVehicleSeat() const { + int Human::GetVehicleSeatIndex() const { const auto updateData = _ent.get(); const auto carEnt = flecs::entity(_ent.world(), updateData->carPassenger.carId); if (carEnt.is_valid() && carEnt.is_alive()) { @@ -52,11 +52,11 @@ namespace MafiaMP::Scripting { } void Human::Register(sol::state &luaEngine) { - sol::usertype cls = luaEngine.new_usertype("Human", sol::constructors(), sol::base_classes, sol::bases()); - cls["addWeapon"] = &Human::AddWeapon; - cls["getHealth"] = &Human::GetHealth; - cls["setHealth"] = &Human::SetHealth; - cls["getVehicle"] = &Human::GetVehicle; - cls["getVehicleSeat"] = &Human::GetVehicleSeat; + sol::usertype cls = luaEngine.new_usertype("Human", sol::constructors(), sol::base_classes, sol::bases()); + cls["addWeapon"] = &Human::AddWeapon; + cls["getHealth"] = &Human::GetHealth; + cls["setHealth"] = &Human::SetHealth; + cls["getVehicle"] = &Human::GetVehicle; + cls["getVehicleSeatIndex"] = &Human::GetVehicleSeatIndex; } } // namespace MafiaMP::Scripting diff --git a/code/server/src/core/builtins/human.h b/code/server/src/core/builtins/human.h index 80899b9..c8aee4d 100644 --- a/code/server/src/core/builtins/human.h +++ b/code/server/src/core/builtins/human.h @@ -30,7 +30,7 @@ namespace MafiaMP::Scripting { Vehicle GetVehicle() const; - int GetVehicleSeat() const; + int GetVehicleSeatIndex() const; static void Register(sol::state &luaEngine); }; diff --git a/gamemode/server/debug.lua b/gamemode/server/debug.lua index 34abf32..161067e 100644 --- a/gamemode/server/debug.lua +++ b/gamemode/server/debug.lua @@ -23,7 +23,7 @@ if (CONFIG.ENABLE_DEBUG) then Console.log("[DEBUG][onVehiclePlayerEnter] vehicle id: ", vehicle.id, " | type: ", type(vehicle.id)) Console.log("[DEBUG][onVehiclePlayerEnter] vehicle name: ", vehicle.name, " | type: ", type(vehicle.name)) Console.log("[DEBUG][onVehiclePlayerEnter] vehicle nickname: ", vehicle.nickname, " | type: ", type(vehicle.nickname)) - Console.log("[DEBUG][onVehiclePlayerEnter] vehicle player seat: ", seatIndex, " | type: ", type(seatIndex)) + Console.log("[DEBUG][onVehiclePlayerEnter] vehicle player seat index: ", seatIndex, " | type: ", type(seatIndex)) Console.log("[DEBUG][onVehiclePlayerEnter] player id: ", player.id, " | type: ", type(player.id)) Console.log("[DEBUG][onPlayerConnected] vehicle modelHash: ", vehicle:getModelHash(), @@ -46,7 +46,12 @@ if (CONFIG.ENABLE_DEBUG) then Console.log("[DEBUG][onChatCommand] owner: " .. player.nickname) Console.log("[DEBUG][onChatCommand] message: " .. message) Console.log("[DEBUG][onChatCommand] command: " .. command) - Console.log("[DEBUG][onChatCommand] args: " .. table.concat(args, ", "), " | type: ", type(args), " | length: ", - #args) + Console.log( + "[DEBUG][onChatCommand] args: " .. table.concat(args, ", "), + " | type: ", + type(args), + " | length: ", + #args + ) end) end diff --git a/gamemode/server/sdk.server.d.lua b/gamemode/server/sdk.server.d.lua index e3cff03..a428425 100644 --- a/gamemode/server/sdk.server.d.lua +++ b/gamemode/server/sdk.server.d.lua @@ -114,9 +114,9 @@ function Human:getHealth () end ---@return Vehicle # The vehicle the Human is in. function Human:getVehicle () end ----Retrieves the seat the Human occupies in the vehicle. ----@return integer # The seat ID the Human occupies. Returns -1 if the Human is not in a vehicle. -function Human:getVehicleSeat () end +---Retrieves the seat index the Human occupies in the vehicle. +---@return integer # The seat index the Human occupies. Returns -1 if the Human is not in a vehicle. +function Human:getVehicleSeatIndex () end ---@class Player: Human Player = {}