Added spawn ped feature. (#377)
This commit is contained in:
@ -40,12 +40,20 @@ namespace big
|
||||
|
||||
player_ptr player_service::get_by_msg_id(uint32_t msg_id) const
|
||||
{
|
||||
for (const auto& [name, player] : m_players)
|
||||
for (const auto& [_, player] : m_players)
|
||||
if (player->get_net_game_player()->m_msg_id == msg_id)
|
||||
return player;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
player_ptr player_service::get_by_id(uint32_t id) const
|
||||
{
|
||||
for (const auto& [name, player] : m_players)
|
||||
if (player->id() == id)
|
||||
return player;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
player_ptr player_service::get_by_host_token(uint64_t token) const
|
||||
{
|
||||
for (const auto& [name, player] : m_players)
|
||||
|
@ -35,6 +35,7 @@ namespace big
|
||||
|
||||
[[nodiscard]] player_ptr get_by_name(std::string name);
|
||||
[[nodiscard]] player_ptr get_by_msg_id(uint32_t msg_id) const;
|
||||
[[nodiscard]] player_ptr get_by_id(uint32_t id) const;
|
||||
[[nodiscard]] player_ptr get_by_host_token(uint64_t token) const;
|
||||
[[nodiscard]] player_ptr get_selected() const;
|
||||
|
||||
|
Reference in New Issue
Block a user