generated from YimMenu/YimMenuV2
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Small changes * Update ContextMenus.hpp * Update Self.cpp * Added warp into vehicle
- Loading branch information
Showing
11 changed files
with
230 additions
and
73 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,70 @@ | ||
#pragma once | ||
#include "ContextMenu.hpp" | ||
#include "core/commands/Commands.hpp" | ||
#include "game/backend/Players.hpp" | ||
#include "game/commands/PlayerCommand.hpp" | ||
#include "game/features/Features.hpp" | ||
#include "game/rdr/Natives.hpp" | ||
#include "util/teleport.hpp" | ||
|
||
|
||
namespace YimMenu | ||
{ | ||
inline ContextOperationsMenu ContextMenuDefault = ContextOperationsMenu("Default", | ||
{ | ||
ContextMenuOperation{"Error", | ||
[&] { | ||
|
||
}} | ||
}); | ||
inline ContextOperationsMenu ContextMenuDefault = ContextOperationsMenu("Default", {ContextMenuOperation{"Error", [&] { | ||
|
||
}}}); | ||
|
||
inline ContextOperationsMenu ContextMenuPlayers = ContextOperationsMenu("Players", | ||
{ | ||
ContextMenuOperation | ||
{"Teleport to player", [&] { | ||
auto playerPos = ENTITY::GET_ENTITY_COORDS(ContextMenu::GetEntityHandle(), false, true); | ||
Teleport::TeleportEntity(Self::PlayerPed, playerPos); | ||
}}, | ||
{"Explode", [&] { | ||
auto playerPos = ENTITY::GET_ENTITY_COORDS(ContextMenu::GetEntityHandle(), false, true); | ||
FIRE::ADD_EXPLOSION(playerPos.x, playerPos.y, playerPos.z, 22, 1.0f, true, false, 1.0f); | ||
}}, | ||
|
||
}); | ||
ContextMenuOperation{"Set Selected", | ||
[&] { | ||
for (auto [id, plyr] : YimMenu::Players::GetPlayers()) | ||
if (plyr.IsValid() && plyr.GetPed().GetPointer<void*>()) | ||
if (ContextMenu::GetEntityHandle() == PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(id)) | ||
{ | ||
YimMenu::Players::SetSelected(id); | ||
break; | ||
} | ||
}}, | ||
{"Teleport to", | ||
[&] { | ||
auto playerPos = ENTITY::GET_ENTITY_COORDS(ContextMenu::GetEntityHandle(), false, true); | ||
Teleport::TeleportEntity(Self::PlayerPed, playerPos, false); | ||
}}, | ||
{"Teleport Behind", | ||
[&] { | ||
auto playerCoords = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(ContextMenu::GetEntityHandle(), 0, -10, 0); | ||
if (Teleport::TeleportEntity(Self::PlayerPed, playerCoords, true)) | ||
g_Spectating = false; | ||
}}, | ||
{"Explode", | ||
[&] { | ||
auto playerPos = ENTITY::GET_ENTITY_COORDS(ContextMenu::GetEntityHandle(), false, true); | ||
FIRE::ADD_EXPLOSION(playerPos.x, playerPos.y, playerPos.z, 22, 1.0f, true, false, 1.0f); | ||
}}, | ||
{"Set Defensive", | ||
[&] { | ||
int playerId = -1; | ||
for (auto [id, plyr] : YimMenu::Players::GetPlayers()) | ||
if (plyr.IsValid() && plyr.GetPed().GetPointer<void*>()) | ||
if (ContextMenu::GetEntityHandle() == PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(id)) | ||
{ | ||
playerId = id; | ||
break; | ||
} | ||
Commands::GetCommand<PlayerCommand>("defensive"_J)->Call(playerId); | ||
}}, | ||
{"Set Offensive", | ||
[&] { | ||
int playerId = -1; | ||
for (auto [id, plyr] : YimMenu::Players::GetPlayers()) | ||
if (plyr.IsValid() && plyr.GetPed().GetPointer<void*>()) | ||
if (ContextMenu::GetEntityHandle() == PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(id)) | ||
{ | ||
playerId = id; | ||
break; | ||
} | ||
Commands::GetCommand<PlayerCommand>("offensive"_J)->Call(playerId); | ||
}}, | ||
}); | ||
} |
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
Oops, something went wrong.