generated from YimMenu/YimMenuV2
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remote Teleport, Script Functions, and More (#170)
Vehicle Spawner Chat Clearing Script Functions Remote TPs Various Code Cleanups and Refactors
- Loading branch information
Showing
68 changed files
with
1,118 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include "core/commands/Command.hpp" | ||
#include "game/backend/Players.hpp" | ||
#include "game/backend/Self.hpp" | ||
#include "game/rdr/Natives.hpp" | ||
#include "util/teleport.hpp" | ||
|
||
namespace YimMenu::Features | ||
{ | ||
class BringAllPlayers : public Command | ||
{ | ||
using Command::Command; | ||
|
||
virtual void OnCall() override | ||
{ | ||
for (auto& [idx, player] : Players::GetPlayers()) | ||
{ | ||
Teleport::TeleportPlayerToCoords(player, Self::GetPed().GetPosition()); | ||
} | ||
} | ||
}; | ||
|
||
static BringAllPlayers _BringAllPlayers{"bringall", "Bring", "Teleport all players to you"}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include "core/commands/Command.hpp" | ||
#include "game/backend/Self.hpp" | ||
#include "game/rdr/Natives.hpp" | ||
#include "game/backend/Players.hpp" | ||
#include "util/teleport.hpp" | ||
#include "game/rdr/data/JailTeleports.hpp" | ||
|
||
namespace YimMenu::Features | ||
{ | ||
class TpAllToJail : public Command | ||
{ | ||
using Command::Command; | ||
|
||
virtual void OnCall() override | ||
{ | ||
for (auto& [idx, player] : Players::GetPlayers()) | ||
{ | ||
std::srand(static_cast<unsigned int>(std::time(nullptr))); | ||
int randomIndex = std::rand() % Data::g_JailCells.size(); | ||
|
||
auto it = Data::g_JailCells.begin(); | ||
std::advance(it, randomIndex); | ||
|
||
rage::fvector3 cell = it->second; | ||
Teleport::TeleportPlayerToCoords(player, cell); | ||
} | ||
} | ||
}; | ||
|
||
static TpAllToJail _TpAllToJail{"tpalltojail", "Teleport To Jail", "Teleport all players to a random Saint Denis jail cell"}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include "core/commands/Command.hpp" | ||
#include "game/backend/Self.hpp" | ||
#include "game/rdr/Natives.hpp" | ||
#include "game/backend/Players.hpp" | ||
#include "util/teleport.hpp" | ||
|
||
namespace YimMenu::Features | ||
{ | ||
class TpAllToWaypoint : public Command | ||
{ | ||
using Command::Command; | ||
|
||
virtual void OnCall() override | ||
{ | ||
for (auto& [idx, player] : Players::GetPlayers()) | ||
{ | ||
Teleport::TeleportPlayerToCoords(player, Teleport::GetWaypointCoords()); | ||
} | ||
} | ||
}; | ||
|
||
static TpAllToWaypoint _TpAllToWaypoint{"tpalltowaypoint", "Teleport To Waypoint", "Teleport all players to your active waypoint"}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include "game/backend/Self.hpp" | ||
#include "game/backend/Players.hpp" | ||
#include "game/commands/PlayerCommand.hpp" | ||
#include "game/rdr/Natives.hpp" | ||
#include "util/teleport.hpp" | ||
|
||
namespace YimMenu::Features | ||
{ | ||
class BringPlayer : public PlayerCommand | ||
{ | ||
using PlayerCommand::PlayerCommand; | ||
|
||
virtual void OnCall(Player player) override | ||
{ | ||
Teleport::TeleportPlayerToCoords(player, Self::GetPed().GetPosition()); | ||
} | ||
}; | ||
|
||
static BringPlayer _BringPlayer{"bring", "Bring Player", "Teleport the player to you"}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include "game/backend/Self.hpp" | ||
#include "game/commands/PlayerCommand.hpp" | ||
#include "game/rdr/Natives.hpp" | ||
#include "game/features/Features.hpp" | ||
#include "util/teleport.hpp" | ||
|
||
namespace YimMenu::Features | ||
{ | ||
class TpBehindPlayer : public PlayerCommand | ||
{ | ||
using PlayerCommand::PlayerCommand; | ||
|
||
virtual void OnCall(Player player) override | ||
{ | ||
auto pos = player.GetPed().GetPosition(); | ||
auto forward = ENTITY::GET_ENTITY_FORWARD_VECTOR(player.GetPed().GetHandle()); | ||
float distance = -7.5f; | ||
rage::fvector3 coords{pos.x + (forward.x * distance), pos.y + (forward.y * distance), pos.z + .75f}; | ||
|
||
if (Teleport::TeleportEntity(Self::GetPed().GetHandle(), {coords.x, coords.y, coords.z}, false)) | ||
g_Spectating = false; | ||
} | ||
}; | ||
|
||
static TpBehindPlayer _TpBehindPlayer{"tpbehindplayer", "Teleport Behind Player", "Teleport behind the player"}; | ||
} |
Oops, something went wrong.