├── .gitignore
├── README.md
├── RedMenu
├── Newtonsoft.Json.dll
├── RedMenu.sln
├── RedMenuClient
│ ├── MainClient.cs
│ ├── RedMenuClient.csproj
│ ├── TickFunctions.cs
│ ├── data
│ │ ├── MountData.cs
│ │ ├── PedCustomization.cs
│ │ ├── PedModels.cs
│ │ ├── ScenarioData.cs
│ │ ├── TeleportData.cs
│ │ ├── VehicleData.cs
│ │ ├── WeaponsData.cs
│ │ └── WorldData.cs
│ ├── menus
│ │ ├── MainMenu.cs
│ │ ├── MiscSettingsMenu.cs
│ │ ├── MountMenu.cs
│ │ ├── OnlinePlayersMenu.cs
│ │ ├── PlayerMenu.cs
│ │ ├── ServerInfoMenu.cs
│ │ ├── TeleportMenu.cs
│ │ ├── VehicleMenu.cs
│ │ ├── VoiceMenu.cs
│ │ ├── WeaponsMenu.cs
│ │ └── WorldMenu.cs
│ ├── util
│ │ ├── StorageManager.cs
│ │ ├── UiPrompt.cs
│ │ ├── UserDefaults.cs
│ │ └── Util.cs
│ └── vendor
│ │ └── cfx
│ │ ├── CitizenFX.Core.dll
│ │ └── CitizenFX.Core.xml
├── RedMenuServer
│ ├── MainServer.cs
│ ├── RedMenuServer.csproj
│ └── vendor
│ │ └── cfx
│ │ ├── CitizenFX.Core.dll
│ │ └── CitizenFX.Core.xml
└── shared
│ └── classes
│ ├── ConfigManager.cs
│ └── PermissionsManager.cs
├── appveyor.yml
├── config.cfg
├── females.cs
├── fxmanifest.lua
└── males.cs
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Aa][Rr][Mm]/
27 | [Aa][Rr][Mm]64/
28 | bld/
29 | [Bb]in/
30 | [Oo]bj/
31 | [Ll]og/
32 | [Ll]ogs/
33 |
34 | # Visual Studio 2015/2017 cache/options directory
35 | .vs/
36 | # Uncomment if you have tasks that create the project's static files in wwwroot
37 | #wwwroot/
38 |
39 | # Visual Studio 2017 auto generated files
40 | Generated\ Files/
41 |
42 | # MSTest test Results
43 | [Tt]est[Rr]esult*/
44 | [Bb]uild[Ll]og.*
45 |
46 | # NUnit
47 | *.VisualState.xml
48 | TestResult.xml
49 | nunit-*.xml
50 |
51 | # Build Results of an ATL Project
52 | [Dd]ebugPS/
53 | [Rr]eleasePS/
54 | dlldata.c
55 |
56 | # Benchmark Results
57 | BenchmarkDotNet.Artifacts/
58 |
59 | # .NET Core
60 | project.lock.json
61 | project.fragment.lock.json
62 | artifacts/
63 |
64 | # StyleCop
65 | StyleCopReport.xml
66 |
67 | # Files built by Visual Studio
68 | *_i.c
69 | *_p.c
70 | *_h.h
71 | *.ilk
72 | *.meta
73 | *.obj
74 | *.iobj
75 | *.pch
76 | *.pdb
77 | *.ipdb
78 | *.pgc
79 | *.pgd
80 | *.rsp
81 | *.sbr
82 | *.tlb
83 | *.tli
84 | *.tlh
85 | *.tmp
86 | *.tmp_proj
87 | *_wpftmp.csproj
88 | *.log
89 | *.vspscc
90 | *.vssscc
91 | .builds
92 | *.pidb
93 | *.svclog
94 | *.scc
95 |
96 | # Chutzpah Test files
97 | _Chutzpah*
98 |
99 | # Visual C++ cache files
100 | ipch/
101 | *.aps
102 | *.ncb
103 | *.opendb
104 | *.opensdf
105 | *.sdf
106 | *.cachefile
107 | *.VC.db
108 | *.VC.VC.opendb
109 |
110 | # Visual Studio profiler
111 | *.psess
112 | *.vsp
113 | *.vspx
114 | *.sap
115 |
116 | # Visual Studio Trace Files
117 | *.e2e
118 |
119 | # TFS 2012 Local Workspace
120 | $tf/
121 |
122 | # Guidance Automation Toolkit
123 | *.gpState
124 |
125 | # ReSharper is a .NET coding add-in
126 | _ReSharper*/
127 | *.[Rr]e[Ss]harper
128 | *.DotSettings.user
129 |
130 | # TeamCity is a build add-in
131 | _TeamCity*
132 |
133 | # DotCover is a Code Coverage Tool
134 | *.dotCover
135 |
136 | # AxoCover is a Code Coverage Tool
137 | .axoCover/*
138 | !.axoCover/settings.json
139 |
140 | # Visual Studio code coverage results
141 | *.coverage
142 | *.coveragexml
143 |
144 | # NCrunch
145 | _NCrunch_*
146 | .*crunch*.local.xml
147 | nCrunchTemp_*
148 |
149 | # MightyMoose
150 | *.mm.*
151 | AutoTest.Net/
152 |
153 | # Web workbench (sass)
154 | .sass-cache/
155 |
156 | # Installshield output folder
157 | [Ee]xpress/
158 |
159 | # DocProject is a documentation generator add-in
160 | DocProject/buildhelp/
161 | DocProject/Help/*.HxT
162 | DocProject/Help/*.HxC
163 | DocProject/Help/*.hhc
164 | DocProject/Help/*.hhk
165 | DocProject/Help/*.hhp
166 | DocProject/Help/Html2
167 | DocProject/Help/html
168 |
169 | # Click-Once directory
170 | publish/
171 |
172 | # Publish Web Output
173 | *.[Pp]ublish.xml
174 | *.azurePubxml
175 | # Note: Comment the next line if you want to checkin your web deploy settings,
176 | # but database connection strings (with potential passwords) will be unencrypted
177 | *.pubxml
178 | *.publishproj
179 |
180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
181 | # checkin your Azure Web App publish settings, but sensitive information contained
182 | # in these scripts will be unencrypted
183 | PublishScripts/
184 |
185 | # NuGet Packages
186 | *.nupkg
187 | # NuGet Symbol Packages
188 | *.snupkg
189 | # The packages folder can be ignored because of Package Restore
190 | **/[Pp]ackages/*
191 | # except build/, which is used as an MSBuild target.
192 | !**/[Pp]ackages/build/
193 | # Uncomment if necessary however generally it will be regenerated when needed
194 | #!**/[Pp]ackages/repositories.config
195 | # NuGet v3's project.json files produces more ignorable files
196 | *.nuget.props
197 | *.nuget.targets
198 |
199 | # Microsoft Azure Build Output
200 | csx/
201 | *.build.csdef
202 |
203 | # Microsoft Azure Emulator
204 | ecf/
205 | rcf/
206 |
207 | # Windows Store app package directories and files
208 | AppPackages/
209 | BundleArtifacts/
210 | Package.StoreAssociation.xml
211 | _pkginfo.txt
212 | *.appx
213 | *.appxbundle
214 | *.appxupload
215 |
216 | # Visual Studio cache files
217 | # files ending in .cache can be ignored
218 | *.[Cc]ache
219 | # but keep track of directories ending in .cache
220 | !?*.[Cc]ache/
221 |
222 | # Others
223 | ClientBin/
224 | ~$*
225 | *~
226 | *.dbmdl
227 | *.dbproj.schemaview
228 | *.jfm
229 | *.pfx
230 | *.publishsettings
231 | orleans.codegen.cs
232 |
233 | # Including strong name files can present a security risk
234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
235 | #*.snk
236 |
237 | # Since there are multiple workflows, uncomment next line to ignore bower_components
238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
239 | #bower_components/
240 |
241 | # RIA/Silverlight projects
242 | Generated_Code/
243 |
244 | # Backup & report files from converting an old project file
245 | # to a newer Visual Studio version. Backup files are not needed,
246 | # because we have git ;-)
247 | _UpgradeReport_Files/
248 | Backup*/
249 | UpgradeLog*.XML
250 | UpgradeLog*.htm
251 | ServiceFabricBackup/
252 | *.rptproj.bak
253 |
254 | # SQL Server files
255 | *.mdf
256 | *.ldf
257 | *.ndf
258 |
259 | # Business Intelligence projects
260 | *.rdl.data
261 | *.bim.layout
262 | *.bim_*.settings
263 | *.rptproj.rsuser
264 | *- [Bb]ackup.rdl
265 | *- [Bb]ackup ([0-9]).rdl
266 | *- [Bb]ackup ([0-9][0-9]).rdl
267 |
268 | # Microsoft Fakes
269 | FakesAssemblies/
270 |
271 | # GhostDoc plugin setting file
272 | *.GhostDoc.xml
273 |
274 | # Node.js Tools for Visual Studio
275 | .ntvs_analysis.dat
276 | node_modules/
277 |
278 | # Visual Studio 6 build log
279 | *.plg
280 |
281 | # Visual Studio 6 workspace options file
282 | *.opt
283 |
284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
285 | *.vbw
286 |
287 | # Visual Studio LightSwitch build output
288 | **/*.HTMLClient/GeneratedArtifacts
289 | **/*.DesktopClient/GeneratedArtifacts
290 | **/*.DesktopClient/ModelManifest.xml
291 | **/*.Server/GeneratedArtifacts
292 | **/*.Server/ModelManifest.xml
293 | _Pvt_Extensions
294 |
295 | # Paket dependency manager
296 | .paket/paket.exe
297 | paket-files/
298 |
299 | # FAKE - F# Make
300 | .fake/
301 |
302 | # CodeRush personal settings
303 | .cr/personal
304 |
305 | # Python Tools for Visual Studio (PTVS)
306 | __pycache__/
307 | *.pyc
308 |
309 | # Cake - Uncomment if you are using it
310 | # tools/**
311 | # !tools/packages.config
312 |
313 | # Tabs Studio
314 | *.tss
315 |
316 | # Telerik's JustMock configuration file
317 | *.jmconfig
318 |
319 | # BizTalk build output
320 | *.btp.cs
321 | *.btm.cs
322 | *.odx.cs
323 | *.xsd.cs
324 |
325 | # OpenCover UI analysis results
326 | OpenCover/
327 |
328 | # Azure Stream Analytics local run output
329 | ASALocalRun/
330 |
331 | # MSBuild Binary and Structured Log
332 | *.binlog
333 |
334 | # NVidia Nsight GPU debugger configuration file
335 | *.nvuser
336 |
337 | # MFractors (Xamarin productivity tool) working folder
338 | .mfractor/
339 |
340 | # Local History for Visual Studio
341 | .localhistory/
342 |
343 | # BeatPulse healthcheck temp database
344 | healthchecksdb
345 |
346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
347 | MigrationBackup/
348 |
349 | # Ionide (cross platform F# VS Code tools) working folder
350 | .ionide/
351 |
352 | postbuild.cmd
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # This fork
2 |
3 | You can download the latest build of this fork here: https://ci.appveyor.com/project/kibook/redmenu
4 |
5 | Everything below is from the original README for RedMenu.
6 |
7 | # RedMenu
8 | RedMenu is a server side menu for **[RedM](https://redm.gg/)**. (Soon™)
9 |
10 |
11 | ## About
12 | This will be built ~~similar to~~ with **[MenuAPI](https://github.com/TomGrobbe/MenuAPI/)** (now available for both **[FiveM](https://fivem.net/)** _and_ **RedM**) ~~only using the new native menu constructor functions in Red Dead Redemption 2~~.
13 |
14 |
15 | ## The goal
16 | This menu will hopefully be similar to **[vMenu for FiveM](https://github.com/TomGrobbe/vMenu/)**, but better (both internal code and visual improvements), with more configuration and permission options, made specifically for RedM.
17 |
18 |
19 | ## Forum topic
20 | _Coming as soon as this resource is somewhat ready for release._
21 |
22 |
23 | ## License
24 | Feel free to use code from this repo in your own resources, however you must provide appropriate credit when taking code.
25 |
26 |
27 | ## Installation
28 | 1. Update your server to the latest artifacts. Yes it's required, don't ask me why, just f'ing do it already, thanks.
29 | 2. Download the latest [RedMenu Release](https://github.com/TomGrobbe/RedMenu/releases/latest) zip file - note not the source files, download the actual release files - and extract the contents of the zip file into your server resources folder (preferrably in the `[local]` folder). Make sure that you call the resource `RedMenu` (case sensitive), otherwise the resource **will not work**.
30 | 3. You should now have everything inside: `\resources\[local]\RedMenu\`. If there is no `fxmanifest.lua` in that folder, then you've done it incorrectly.
31 | A picture for those who can't read: 
32 | 4. Add `exec resources/[local]/RedMenu/config.cfg` to your `server.cfg`.
33 | 5. Add `start RedMenu` to your `server.cfg` (**make sure it is below the line from step 4, it won't work if you start the resource before executing the config file**).
34 | 6. Check for any errors in the server console when you boot the server. You can ignore warnings like these when you start up RedMenu: `server thread hitch warning: timer interval of ... milliseconds`.
35 |
36 |
37 | >**No errors/warnings?** Great! Now go celebrate that you've successfully read and followed some super basic instructions correctly.
38 |
39 | >**Did you get any errors/warnings?** Well, R.I.P your ego. You've failed to follow the instructions correctly, go back to step 1 and try again.
40 |
41 |
42 | ## Contributions
43 | Feel free to contribute to this resource. There are just a few things you need to keep in mind:
44 | - All code you put into a pull request must be your own, don’t steal code.
45 | - I will review all pull requests, if they do not meet a specific standard then changes will be required before the pull request can be merged. I’ll request these changes in the review, so you know exactly what to change.
46 | - If I feel like (some of) the features you are trying to implement do not fit this resource, I will not accept the PR.
47 | - All pull requests must not break backwards compatibility. Most likely people will install this resource once, and a large portion of the users will never update it after that. So, if a user joins a server where a newer version is installed, they must still be able to join another server with an older version, without losing access to their data or things being broken.
48 | - Use common sense.
49 |
50 |
51 | ## Support
52 | For now, there will be no support, because the resource isn't even remotely close to a working test build yet. Once the resource is ready for the first official release, there will be some form of limited support.
53 | This will most likely be in the form of a documentation website for general installation, configuration and troubleshooting instructions.
54 |
55 | More 'advanced' troubleshooting will be given in certain cases only. I simply do not have the time to explain to everyone personally how to properly troubleshoot things themselves, or to do it for them. There is a massive community with plenty of people willing to help, so be nice and accept help from anyone that is willing to help you out.
56 |
57 |
58 | ## CI
59 | AppVeyor will be used to automatically build and release new versions of this resource to GitHub.
60 | You can find RedMenu on AppVeyor [here](https://ci.appveyor.com/project/TomGrobbe/redmenu).
61 |
62 | Every latest "development" build will be available on AppVeyor. Development builds will also be pushed to my [Discord server](https://vespura.com/discord) automatically.
63 |
--------------------------------------------------------------------------------
/RedMenu/Newtonsoft.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kibook/RedMenu/d8748e65f6b86a0c1b729e391fbd39da63edfcd7/RedMenu/Newtonsoft.Json.dll
--------------------------------------------------------------------------------
/RedMenu/RedMenu.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.29609.76
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RedMenuClient", "RedMenuClient\RedMenuClient.csproj", "{D5131BED-ACBE-44CC-AFF5-A48DB7648F6D}"
7 | ProjectSection(ProjectDependencies) = postProject
8 | {6323344F-B50E-4CDC-B600-529E71916295} = {6323344F-B50E-4CDC-B600-529E71916295}
9 | EndProjectSection
10 | EndProject
11 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RedMenuServer", "RedMenuServer\RedMenuServer.csproj", "{6323344F-B50E-4CDC-B600-529E71916295}"
12 | EndProject
13 | Global
14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
15 | Debug|Any CPU = Debug|Any CPU
16 | Release|Any CPU = Release|Any CPU
17 | EndGlobalSection
18 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
19 | {D5131BED-ACBE-44CC-AFF5-A48DB7648F6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
20 | {D5131BED-ACBE-44CC-AFF5-A48DB7648F6D}.Debug|Any CPU.Build.0 = Debug|Any CPU
21 | {D5131BED-ACBE-44CC-AFF5-A48DB7648F6D}.Release|Any CPU.ActiveCfg = Release|Any CPU
22 | {D5131BED-ACBE-44CC-AFF5-A48DB7648F6D}.Release|Any CPU.Build.0 = Release|Any CPU
23 | {6323344F-B50E-4CDC-B600-529E71916295}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
24 | {6323344F-B50E-4CDC-B600-529E71916295}.Debug|Any CPU.Build.0 = Debug|Any CPU
25 | {6323344F-B50E-4CDC-B600-529E71916295}.Release|Any CPU.ActiveCfg = Release|Any CPU
26 | {6323344F-B50E-4CDC-B600-529E71916295}.Release|Any CPU.Build.0 = Release|Any CPU
27 | EndGlobalSection
28 | GlobalSection(SolutionProperties) = preSolution
29 | HideSolutionNode = FALSE
30 | EndGlobalSection
31 | GlobalSection(ExtensibilityGlobals) = postSolution
32 | SolutionGuid = {4E56B93F-4038-4575-A203-740236DE843C}
33 | EndGlobalSection
34 | EndGlobal
35 |
--------------------------------------------------------------------------------
/RedMenu/RedMenuClient/MainClient.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using MenuAPI;
7 | using CitizenFX.Core;
8 | using static CitizenFX.Core.Native.API;
9 | using CitizenFX.Core.Native;
10 | using RedMenuShared;
11 | using RedMenuClient.util;
12 |
13 | namespace RedMenuClient
14 | {
15 | public class MainClient : BaseScript
16 | {
17 |
18 | public static bool PermissionsSetupDone { get; internal set; } = false;
19 |
20 | public MainClient()
21 | {
22 | if (!ConfigManager.EnablePermissions && !ConfigManager.IgnoreConfigWarning)
23 | {
24 | Debug.WriteLine("^3[WARNING] RedMenu is setup to ignore permissions! If this was not intended, please read the installation instructions. You can silence this warning by adding ^7setr ignore_config_warning \"true\" ^3to your server.cfg, above the ^7start RedMenu ^3line.^7");
25 | }
26 |
27 | if (GetCurrentResourceName() == "RedMenu")
28 | {
29 | DelayedConstructor();
30 | }
31 | else
32 | {
33 | Debug.WriteLine("^1[ERROR] RedMenu is not correctly installed. Please make sure that the folder is called RedMenu (case sensitive)! RedMenu will not function if it's incorrectly named.");
34 | }
35 |
36 | Function.Call((Hash)0xD4EE21B7CC7FD350, UserDefaults.MiscAlwaysShowCores); // _ALWAYS_SHOW_HORSE_CORES
37 | Function.Call((Hash)0x50C803A4CD5932C5, UserDefaults.MiscAlwaysShowCores); // _ALWAYS_SHOW_PLAYER_CORES
38 |
39 | if (ConfigManager.EnableMaxStats)
40 | {
41 | SetAttributePoints(PlayerPedId(), 0, GetMaxAttributePoints(PlayerPedId(), 0)); // health
42 | SetAttributePoints(PlayerPedId(), 1, GetMaxAttributePoints(PlayerPedId(), 1)); // stamina
43 | SetAttributePoints(PlayerPedId(), 2, GetMaxAttributePoints(PlayerPedId(), 2)); // dead eye
44 | }
45 | }
46 |
47 |
48 | ///
49 | /// Delayed constructor waits for permissions to be setup before doing anything.
50 | ///
51 | private static async void DelayedConstructor()
52 | {
53 | while (!PermissionsSetupDone)
54 | {
55 | await Delay(0);
56 | }
57 |
58 | menus.MainMenu.GetMenu();
59 |
60 | if (ConfigManager.UnlockFullMap)
61 | {
62 | SetMinimapHideFow(true);
63 | }
64 |
65 | //Needs more research.
66 | if (ConfigManager.EnableMaxStats)
67 | {
68 | SetAttributePoints(PlayerPedId(), 0, GetMaxAttributePoints(PlayerPedId(), 0)); // health
69 | SetAttributePoints(PlayerPedId(), 1, GetMaxAttributePoints(PlayerPedId(), 1)); // stamina
70 | SetAttributePoints(PlayerPedId(), 2, GetMaxAttributePoints(PlayerPedId(), 2)); // dead eye
71 | }
72 | }
73 |
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/RedMenu/RedMenuClient/RedMenuClient.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | net452
4 | embedded
5 | Release;Debug
6 | RedMenuClient.net
7 | $(AssemblyName)
8 | Always
9 |
10 |
11 | TRACE;CLIENT
12 |
13 |
14 | DEBUG;CLIENT
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | vendor\cfx\CitizenFX.Core.dll
30 | false
31 |
32 |
33 |
34 | ..\Newtonsoft.Json.dll
35 | true
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/RedMenu/RedMenuClient/TickFunctions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using MenuAPI;
7 | using CitizenFX.Core;
8 | using static CitizenFX.Core.Native.API;
9 | using RedMenuShared;
10 | using RedMenuClient.util;
11 | using System.Net;
12 | using CitizenFX.Core.Native;
13 |
14 | namespace RedMenuClient
15 | {
16 | class TickFunctions : BaseScript
17 | {
18 | public TickFunctions() {
19 | EventHandlers["playerSpawned"] += new Action(OnSpawn);
20 | }
21 |
22 | private static async void OnSpawn()
23 | {
24 | await Delay(3000);
25 | if (PermissionsManager.IsAllowed(Permission.PMSavedPeds) && UserDefaults.PlayerDefaultSavedPed != 0)
26 | {
27 | menus.PlayerMenu.LoadDefaultPed(UserDefaults.PlayerDefaultSavedPed);
28 | }
29 | await Delay(500);
30 | Update();
31 | await Delay(500);
32 | if (PermissionsManager.IsAllowed(Permission.WMSavedLoadouts) && UserDefaults.WeaponDefaultSavedLoadout != 0)
33 | {
34 | menus.WeaponsMenu.LoadSavedLoadout(UserDefaults.WeaponDefaultSavedLoadout);
35 | }
36 | }
37 |
38 | private static void Update()
39 | {
40 | // Update godmode.
41 | if (PermissionsManager.IsAllowed(Permission.PMGodMode) && UserDefaults.PlayerGodMode)
42 | {
43 | SetEntityInvincible(PlayerPedId(), true);
44 | }
45 | else
46 | {
47 | SetEntityInvincible(PlayerPedId(), false);
48 | }
49 |
50 | if (PermissionsManager.IsAllowed(Permission.PMEveryoneIgnore) && UserDefaults.PlayerEveryoneIgnore)
51 | {
52 | SetEveryoneIgnorePlayer(PlayerId(), true);
53 | }
54 | else
55 | {
56 | SetEveryoneIgnorePlayer(PlayerId(), false);
57 | }
58 |
59 | if (PermissionsManager.IsAllowed(Permission.PMDisableRagdoll) && UserDefaults.PlayerDisableRagdoll)
60 | {
61 | SetPedCanRagdoll(PlayerPedId(), false);
62 | }
63 | else
64 | {
65 | SetPedCanRagdoll(PlayerPedId(), true);
66 | }
67 |
68 | if (PermissionsManager.IsAllowed(Permission.WMInfiniteAmmo) && UserDefaults.WeaponInfiniteAmmo)
69 | {
70 | SetPedInfiniteAmmoClip(PlayerPedId(), true);
71 | }
72 | else
73 | {
74 | SetPedInfiniteAmmoClip(PlayerPedId(), false);
75 | }
76 |
77 | // This needs more native research for the outer cores.
78 | //if (ConfigManager.EnableMaxStats)
79 | //{
80 | // SetAttribute(PlayerPedId(), 0, GetMaxAttributePoints(PlayerPedId(), 0));
81 | // SetAttributePoints(PlayerPedId(), 1, GetMaxAttributePoints(PlayerPedId(), 1));
82 | // SetAttributePoints(PlayerPedId(), 2, GetMaxAttributePoints(PlayerPedId(), 2));
83 | //}
84 | }
85 |
86 | private static int lastPed = 0;
87 |
88 | [Tick]
89 | internal static async Task PedChangeDetectionTick()
90 | {
91 | int ped = PlayerPedId();
92 |
93 | if (ped != lastPed)
94 | {
95 | Update();
96 | lastPed = ped;
97 | }
98 |
99 | await Delay(1000);
100 | }
101 |
102 | [Tick]
103 | internal static async Task InfiniteStatsTick()
104 | {
105 | if (!IsPlayerDead(PlayerId())) // Allows respawning after killing yourself
106 | {
107 | int ped = PlayerPedId();
108 |
109 | if (PermissionsManager.IsAllowed(Permission.PMGodMode) && UserDefaults.PlayerGodMode)
110 | {
111 | Function.Call((Hash)0xC6258F41D86676E0, ped, 0, 100.0f);
112 | }
113 |
114 | if (PermissionsManager.IsAllowed(Permission.PMInfiniteStamina) && UserDefaults.PlayerInfiniteStamina)
115 | {
116 | RestorePlayerStamina(PlayerId(), 100.0f);
117 | Function.Call((Hash)0xC6258F41D86676E0, ped, 1, 100.0f);
118 | }
119 |
120 | if (PermissionsManager.IsAllowed(Permission.PMInfiniteDeadEye) && UserDefaults.PlayerInfiniteDeadEye)
121 | {
122 | Function.Call((Hash)0xC6258F41D86676E0, ped, 2, 100.0f);
123 | }
124 |
125 | int mount = GetMount(ped);
126 |
127 | if (mount != 0)
128 | {
129 | if (PermissionsManager.IsAllowed(Permission.MMGodMode) && UserDefaults.MountGodMode)
130 | {
131 | Function.Call((Hash)0xC6258F41D86676E0, mount, 0, 100);
132 | }
133 | if (PermissionsManager.IsAllowed(Permission.MMInfiniteStamina) && UserDefaults.MountInfiniteStamina)
134 | {
135 | Function.Call((Hash)0x675680D089BFA21F, mount, 100.0f);
136 | Function.Call((Hash)0xC6258F41D86676E0, mount, 1, 100);
137 | }
138 | }
139 | }
140 |
141 | await Delay(1000);
142 | }
143 |
144 | ///
145 | /// Manages the radar toggle when holding down the select radar mode button.
146 | /// Until more radar natives are discovered, this will have to do with only an on/off toggle.
147 | ///
148 | ///
149 | [Tick]
150 | internal static async Task RadarToggleTick()
151 | {
152 | if (UserDefaults.MiscMinimapControls)
153 | {
154 | if (Util.IsControlPressed(Control.SelectRadarMode))
155 | {
156 | //UiPrompt promptY = new UiPrompt(new Control[1] { Control.ContextY }, "Compass");
157 | //UiPrompt promptX = new UiPrompt(new Control[1] { Control.ContextX }, "Expanded");
158 | UiPrompt promptA = new UiPrompt(new Control[1] { Control.ContextA }, "Regular");
159 | UiPrompt promptB = new UiPrompt(new Control[1] { Control.ContextB }, "Off", "BRT2MountPrompt");
160 | //promptY.Prepare();
161 | //promptX.Prepare();
162 | promptA.Prepare();
163 | promptB.Prepare();
164 | bool enabled = false;
165 | while (Util.IsControlPressed(Control.SelectRadarMode))
166 | {
167 | if (!enabled)
168 | {
169 | //promptY.SetEnabled(true, true);
170 | //promptX.SetEnabled(true, true);
171 | promptA.SetEnabled(true, true);
172 | promptB.SetEnabled(true, true);
173 | enabled = true;
174 | }
175 |
176 | if (Util.IsControlJustReleased(Control.ContextB))
177 | {
178 | DisplayRadar(false);
179 | }
180 | if (Util.IsControlJustReleased(Control.ContextA))
181 | {
182 | DisplayRadar(true);
183 | }
184 | //if (Util.IsControlJustReleased(Control.ContextX))
185 | //{
186 | // DisplayRadar(true);
187 | //}
188 | //if (Util.IsControlJustReleased(Control.ContextY))
189 | //{
190 | // DisplayRadar(true);
191 | //}
192 |
193 | await Delay(0);
194 | }
195 | //promptY.Dispose();
196 | //promptX.Dispose();
197 | promptA.Dispose();
198 | promptB.Dispose();
199 | while (Util.IsControlPressed(Control.SelectRadarMode))
200 | {
201 | await Delay(0);
202 | }
203 | }
204 | }
205 | else
206 | {
207 | await Delay(1000);
208 | }
209 | }
210 | }
211 | }
212 |
--------------------------------------------------------------------------------
/RedMenu/RedMenuClient/data/MountData.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Net;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace RedMenuClient.data
9 | {
10 | public static class MountData
11 | {
12 | // Lanterns - 0x1530BE1C
13 | public static List LanternHashes = new List()
14 | {
15 | 0x635E387C,
16 | };
17 |
18 | // Blankets - 0x17CEB41A
19 | public static List BlanketHashes = new List()
20 | {
21 | 0x3D34F3,
22 | 0xDC87A9F,
23 | 0xF537E4A,
24 | 0xFAE487F,
25 | 0x127E0412,
26 | 0x19C5E80C,
27 | 0x20D4A0BF,
28 | 0x2286EE30,
29 | 0x269583CA,
30 | 0x2A6D33E8,
31 | 0x3278996D,
32 | 0x342916F3,
33 | 0x3973A986,
34 | 0x3BA0D76D,
35 | 0x41D52CD8,
36 | 0x4655E362,
37 | 0x4A294AF1,
38 | 0x4BF1F80F,
39 | 0x508B80B9,
40 | 0x533A022A,
41 | 0x53B325B7,
42 | 0x5894FB24,
43 | 0x5F0F9E4A,
44 | 0x64BE7DF8,
45 | 0x67CAAF37,
46 | 0x6B2084E5,
47 | 0x71DFC3EA,
48 | 0x78FB209A,
49 | 0x7951D487,
50 | 0x7D637917,
51 | 0x7FC85282,
52 | 0x823A602A,
53 | 0x8FAD4DFE,
54 | 0x90A31F96,
55 | 0x97EBE669,
56 | 0x9AD633FC,
57 | 0x9DE0EA65,
58 | 0x9E468686,
59 | 0xA3D5298D,
60 | 0xAB302059,
61 | 0xAD283105,
62 | 0xB0F7BDA4,
63 | 0xB19B4519,
64 | 0xBBF05395,
65 | 0xC073E2CA,
66 | 0xC097E12C,
67 | 0xC2EF5C93,
68 | 0xC4C732B2,
69 | 0xC7688D20,
70 | 0xC8A467FD,
71 | 0xCDD2FB96,
72 | 0xD333865B,
73 | 0xD9E17DBB,
74 | 0xDBEF0E96,
75 | 0xE32A1050,
76 | 0xE409A807,
77 | 0xEBB4B70D,
78 | 0xEC040C89,
79 | 0xED0190A3,
80 | 0xEDCB3D78,
81 | 0xF506CA32,
82 | 0xF6484C84,
83 | 0xFA1153C6,
84 | 0xFDC3D6D3,
85 | 0xFDF4250B,
86 | 0xFFB1DE72,
87 | };
88 |
89 | // Saddle Horns - 0x5447332
90 | public static List GripHashes = new List()
91 | {
92 | 0x385E306,
93 | 0x791AC50,
94 | 0xB7E1689,
95 | 0xD8DEEA1,
96 | 0x107D9598,
97 | 0x110144FD,
98 | 0x168845BB,
99 | 0x1FFA4C3F,
100 | 0x20200C8E,
101 | 0x204C1921,
102 | 0x28DB931A,
103 | 0x2A28C8BE,
104 | 0x2A5AD412,
105 | 0x30C3D3D4,
106 | 0x32085E61,
107 | 0x333CDC06,
108 | 0x34135CC3,
109 | 0x3B04C75F,
110 | 0x3D2B5410,
111 | 0x3E40711D,
112 | 0x529D5458,
113 | 0x5365D651,
114 | 0x577C24AC,
115 | 0x5840D0DA,
116 | 0x5AC7E5A0,
117 | 0x5EB8810E,
118 | 0x634BE419,
119 | 0x66B2E37B,
120 | 0x746E78FC,
121 | 0x7A255377,
122 | 0x7CE8DAD6,
123 | 0x7DC54289,
124 | 0x7F282C4E,
125 | 0x835DAEC2,
126 | 0x8806025B,
127 | 0x8F6714AA,
128 | 0x94CD1F4D,
129 | 0x97A9A8C3,
130 | 0x9AD2AA40,
131 | 0x9E930716,
132 | 0xA4D3D842,
133 | 0xA56B702D,
134 | 0xAA5ABB5F,
135 | 0xACCECBEC,
136 | 0xB9DC787B,
137 | 0xBD255BDC,
138 | 0xBE896F61,
139 | 0xC1BAF928,
140 | 0xC6C18A58,
141 | 0xC6C381F5,
142 | 0xC8182ACF,
143 | 0xC883BF6A,
144 | 0xC9D2895B,
145 | 0xCEF38CBC,
146 | 0xDBE6AC3B,
147 | 0xDC172DE4,
148 | 0xE1B1B8F1,
149 | 0xE1DC3856,
150 | 0xE9D46CB4,
151 | 0xEB8AB425,
152 | 0xED0BCEB5,
153 | 0xF09C56EE,
154 | 0xF2CA0CC6,
155 | 0xF826E4EB,
156 | 0xF8CAE723,
157 | 0xFAA46AFE,
158 | 0xFB906D30,
159 | };
160 |
161 | // Saddle Bags - 0x80451C25
162 | public static List BagHashes = new List()
163 | {
164 | 0x817C4AB,
165 | 0xBFF9C93,
166 | 0xC283176,
167 | 0xD88946F,
168 | 0xE893DFD,
169 | 0xF2DB7B5,
170 | 0x10DBA6D6,
171 | 0x149EAC60,
172 | 0x15DB6032,
173 | 0x162D31BD,
174 | 0x18A6655C,
175 | 0x191DB6CF,
176 | 0x1B0CE7F4,
177 | 0x1CE65326,
178 | 0x1D4EDB88,
179 | 0x20AA8620,
180 | 0x2280CA64,
181 | 0x27E754ED,
182 | 0x293E17B3,
183 | 0x2AEFF6CA,
184 | 0x2F2C57AA,
185 | 0x31FB5D54,
186 | 0x34859D86,
187 | 0x36C306DF,
188 | 0x3A9E79D0,
189 | 0x3CD9F305,
190 | 0x3D327F83,
191 | 0x3DF3014C,
192 | 0x4401A15C,
193 | 0x513156DD,
194 | 0x5277E9BA,
195 | 0x577EF434,
196 | 0x5785A868,
197 | 0x5811C97C,
198 | 0x5EB0F1DC,
199 | 0x61C248A2,
200 | 0x67C848ED,
201 | 0x6862D558,
202 | 0x69D2ECCA,
203 | 0x744A78D3,
204 | 0x745FEDDD,
205 | 0x867B1D30,
206 | 0x88161591,
207 | 0x8BE10F93,
208 | 0x98BC41B2,
209 | 0x98ECB73E,
210 | 0x9D593283,
211 | 0xA15F4823,
212 | 0xA2C55EEA,
213 | 0xA5A844AC,
214 | 0xAB49E6CD,
215 | 0xABAA6716,
216 | 0xAE110017,
217 | 0xB05AFA15,
218 | 0xB251191B,
219 | 0xB433E1C3,
220 | 0xB4F40DD9,
221 | 0xBB3BFB09,
222 | 0xBB4F86D8,
223 | 0xBDF78BB0,
224 | 0xBF3A0198,
225 | 0xC019F804,
226 | 0xC05AA4AA,
227 | 0xCA541A0C,
228 | 0xCEFD2E33,
229 | 0xD03EB03E,
230 | 0xD048C482,
231 | 0xD2B91EC5,
232 | 0xD4B6AED1,
233 | 0xE08DBA6E,
234 | 0xE27A54B5,
235 | 0xE2ADE94C,
236 | 0xE2DFC8E3,
237 | 0xE4108D59,
238 | 0xE57042B4,
239 | 0xE77A8371,
240 | 0xEB4D0AAA,
241 | 0xEBBB5CDA,
242 | 0xEEC77E72,
243 | 0xEF396307,
244 | 0xF0C30271,
245 | 0xF105E52F,
246 | 0xF8FB69CA,
247 | 0xFB66AB49,
248 | 0xFCC2FEE9,
249 | 0xFDAB0075,
250 | 0xFDC114DC,
251 | };
252 |
253 | // Reins - 0x94B2E3AF
254 | public static List ReinsHashes = new List()
255 | {
256 | 0xC48F261,
257 | 0xCBA8E54,
258 | 0x1A7E09B0,
259 | 0x2F62D3A4,
260 | 0x433DE046,
261 | 0x5BC3AC4D,
262 | 0x63899BC6,
263 | 0x754C3F4B,
264 | 0x7956475F,
265 | 0x7E89F1D9,
266 | 0x874F0363,
267 | 0x880FE4D2,
268 | 0x95ADA020,
269 | 0xAAA9CA18,
270 | 0xB8F0E6A6,
271 | 0xCFFBF4B5,
272 | 0xD1D7988F,
273 | 0xE006B4ED,
274 | 0xE3139FF7,
275 | 0xF0D53B7A,
276 | 0xF18C3CE4,
277 | 0xFB2178EC,
278 | 0xFE8E56EC,
279 | };
280 |
281 | // Tails - 0xA63CAE10
282 | public static List TailHashes = new List()
283 | {
284 | 0x4951F22,
285 | 0x607E6DD,
286 | 0x66C266F,
287 | 0x73073A2,
288 | 0x84D6B90,
289 | 0xAFB492C,
290 | 0x12DBBBAF,
291 | 0x162191A0,
292 | 0x17EB79D3,
293 | 0x1A3B721B,
294 | 0x1BB5EAA1,
295 | 0x1E9A18C2,
296 | 0x1F7A99EA,
297 | 0x1FE89D6A,
298 | 0x25B51566,
299 | 0x2E753874,
300 | 0x30603BB5,
301 | 0x33E7B1CB,
302 | 0x383E86F3,
303 | 0x3AE050B5,
304 | 0x3B27D1DD,
305 | 0x3B8A8D0C,
306 | 0x3D1F13D4,
307 | 0x3D212D77,
308 | 0x4124CC49,
309 | 0x475D7417,
310 | 0x49CD2991,
311 | 0x4B51B039,
312 | 0x4F087BA9,
313 | 0x4F5268A4,
314 | 0x5062FC53,
315 | 0x508AD44A,
316 | 0x543203ED,
317 | 0x574BC82D,
318 | 0x5D7FA043,
319 | 0x5F4871C5,
320 | 0x607956E9,
321 | 0x6465A66B,
322 | 0x695B2E3F,
323 | 0x69756C80,
324 | 0x6DB6F164,
325 | 0x740701A3,
326 | 0x7522834F,
327 | 0x75C4C716,
328 | 0x7A248ABE,
329 | 0x810A5CE0,
330 | 0x82DB38EE,
331 | 0x84269E43,
332 | 0x84ADE4E4,
333 | 0x876B27E0,
334 | 0x88A2AA53,
335 | 0x894C290D,
336 | 0x96EDC3D1,
337 | 0x972AC447,
338 | 0x9CB1CFD8,
339 | 0xA0775A83,
340 | 0xA3DA055A,
341 | 0xA4F0E056,
342 | 0xA62C9657,
343 | 0xA7438C29,
344 | 0xA8A4673A,
345 | 0xB244FE1E,
346 | 0xB4374DB1,
347 | 0xB4AB3354,
348 | 0xBCD412B1,
349 | 0xC0AF3489,
350 | 0xC2FA4FF2,
351 | 0xC304EB4C,
352 | 0xC74FCC45,
353 | 0xCDFF359A,
354 | 0xCE62B5CE,
355 | 0xD143E02D,
356 | 0xD7D68A7B,
357 | 0xD9288D47,
358 | 0xD9EA1916,
359 | 0xDCE41557,
360 | 0xDD9F5447,
361 | 0xDDB48566,
362 | 0xE283AA65,
363 | 0xE38F5D96,
364 | 0xEAA5EEE7,
365 | 0xEABBBAB9,
366 | 0xEAEAB164,
367 | 0xEBC7218B,
368 | 0xED0397AC,
369 | 0xED787168,
370 | 0xEFA67855,
371 | 0xF4294320,
372 | 0xF4A3443C,
373 | 0xF6B0AB06,
374 | 0xF867D611,
375 | };
376 |
377 | // Manes - 0xAA0217AB
378 | public static List ManeHashes = new List()
379 | {
380 | 0x86BEA7,
381 | 0x1068859,
382 | 0x235DBF1,
383 | 0x31FED8D,
384 | 0x354F6B7,
385 | 0x512377B,
386 | 0x54A3CB0,
387 | 0x632F2B7,
388 | 0x73CA0C3,
389 | 0x75510E0,
390 | 0x9836E71,
391 | 0x9A640A3,
392 | 0x9B5FADD,
393 | 0xA1C6131,
394 | 0xA7115F0,
395 | 0xA8458A2,
396 | 0xAFB7C24,
397 | 0xB52F0BC,
398 | 0xDCF5321,
399 | 0xE60BA50,
400 | 0x102E87AA,
401 | 0x11C0A6DF,
402 | 0x127BA33B,
403 | 0x130E341A,
404 | 0x14098229,
405 | 0x1509BA80,
406 | 0x16923E26,
407 | 0x18199F48,
408 | 0x18D41981,
409 | 0x1A5A45B6,
410 | 0x1B9F384C,
411 | 0x1BDFED93,
412 | 0x1C289C3E,
413 | 0x1DF21752,
414 | 0x1ED05FAE,
415 | 0x1FDC6D0F,
416 | 0x2035B791,
417 | 0x21AD55A4,
418 | 0x23063239,
419 | 0x2338A1A1,
420 | 0x241D7FBD,
421 | 0x247F0B87,
422 | 0x25627B98,
423 | 0x25E6FAA8,
424 | 0x25F94F4C,
425 | 0x265E2510,
426 | 0x27D5B5D8,
427 | 0x2881B850,
428 | 0x2A371CD6,
429 | 0x2B676918,
430 | 0x2C1E693E,
431 | 0x2D47B5FD,
432 | 0x2E378E8A,
433 | 0x2FCAF0CB,
434 | 0x32244D2B,
435 | 0x3556E4A2,
436 | 0x35744ED1,
437 | 0x3590514D,
438 | 0x36A5FD2D,
439 | 0x388E4B32,
440 | 0x38BC5565,
441 | 0x3918F467,
442 | 0x397F831C,
443 | 0x3A7C2C86,
444 | 0x3AC55CD7,
445 | 0x3BFE2A17,
446 | 0x3DAC0C59,
447 | 0x3F1FEE4C,
448 | 0x419D9470,
449 | 0x41EA9196,
450 | 0x427C8606,
451 | 0x42B73FAC,
452 | 0x446A6F01,
453 | 0x457BD7C4,
454 | 0x464F05C5,
455 | 0x47F57737,
456 | 0x483AC803,
457 | 0x4BCA27B1,
458 | 0x4E59C375,
459 | 0x4F148D45,
460 | 0x4FCC51B3,
461 | 0x50AC7CC6,
462 | 0x51EB3AC6,
463 | 0x52DC15C8,
464 | 0x54402BD9,
465 | 0x5445B9C0,
466 | 0x54F6AAFA,
467 | 0x5924F189,
468 | 0x5CD349C3,
469 | 0x5D596CCD,
470 | 0x5DE62AE8,
471 | 0x5ED14B9F,
472 | 0x5F0395A3,
473 | 0x5F61FDE6,
474 | 0x5F712DB6,
475 | 0x5FE29755,
476 | 0x6038F7FF,
477 | 0x61EAC83A,
478 | 0x62BD2154,
479 | 0x63222A34,
480 | 0x648A3924,
481 | 0x65767C4E,
482 | 0x66215D77,
483 | 0x67ECBA72,
484 | 0x68601E7D,
485 | 0x6B3A6471,
486 | 0x6B67026D,
487 | 0x6C3B2C50,
488 | 0x6CB65CC5,
489 | 0x6CB9310E,
490 | 0x6D9412B5,
491 | 0x6DE910A2,
492 | 0x6F28EE6E,
493 | 0x6F4510C4,
494 | 0x6F5954BA,
495 | 0x7098D141,
496 | 0x7161F3C4,
497 | 0x724B740B,
498 | 0x74FE4E10,
499 | 0x75C33C19,
500 | 0x76787049,
501 | 0x7838F17E,
502 | 0x793984BF,
503 | 0x7C93AB45,
504 | 0x7CB2E0D9,
505 | 0x7D461CC8,
506 | 0x7D902D5A,
507 | 0x8035108A,
508 | 0x817B10F6,
509 | 0x83563E39,
510 | 0x835B98AD,
511 | 0x83760A4C,
512 | 0x838E5EB8,
513 | 0x83DF6AC7,
514 | 0x86457C9A,
515 | 0x8679685F,
516 | 0x8A47959B,
517 | 0x8C45F563,
518 | 0x8DC6717E,
519 | 0x8DEFC981,
520 | 0x90C786CE,
521 | 0x9209FC2C,
522 | 0x92A3B567,
523 | 0x92A63558,
524 | 0x92B2579E,
525 | 0x9432AE01,
526 | 0x946DDCC6,
527 | 0x94F58186,
528 | 0x95B8AED1,
529 | 0x95F82796,
530 | 0x960C1B33,
531 | 0x96FE6589,
532 | 0x97105EF6,
533 | 0x972AD502,
534 | 0x9782A63C,
535 | 0x97D095F4,
536 | 0x982FCDEC,
537 | 0x99884CB3,
538 | 0x99F5A3FA,
539 | 0x9C803ADB,
540 | 0x9DF8175C,
541 | 0x9F60D111,
542 | 0xA005148D,
543 | 0xA0F4F423,
544 | 0xA193A97A,
545 | 0xA44ED8BD,
546 | 0xA4E1B8DE,
547 | 0xA64BFD6D,
548 | 0xA6F8603C,
549 | 0xA7A4DD49,
550 | 0xAA3FAC1A,
551 | 0xABA8475F,
552 | 0xACA2B4B1,
553 | 0xB00AC1F7,
554 | 0xB13D134B,
555 | 0xB1AF4C55,
556 | 0xB288D42C,
557 | 0xB2FB934B,
558 | 0xB5F379E6,
559 | 0xB6007C20,
560 | 0xB881489D,
561 | 0xB9AF9821,
562 | 0xBD16FB35,
563 | 0xBD7B6B05,
564 | 0xC0085B74,
565 | 0xC09EBC9D,
566 | 0xC15371C1,
567 | 0xC207B6C9,
568 | 0xC3C189AA,
569 | 0xC5F59E3A,
570 | 0xC63030FC,
571 | 0xC8646863,
572 | 0xC929BFA7,
573 | 0xC9D16B31,
574 | 0xCA39613B,
575 | 0xCCA21CA3,
576 | 0xCDC9C8E7,
577 | 0xCF434F57,
578 | 0xCF4C9FA0,
579 | 0xCFEDE17C,
580 | 0xD01DB28A,
581 | 0xD114A330,
582 | 0xD152FE09,
583 | 0xD21B0A64,
584 | 0xD43503D5,
585 | 0xD4680433,
586 | 0xD4E65BE5,
587 | 0xD894BF28,
588 | 0xD9B8A432,
589 | 0xD9CE8DB4,
590 | 0xDC62E996,
591 | 0xDCB71C0A,
592 | 0xDCCE509C,
593 | 0xE02377D6,
594 | 0xE0BC27A6,
595 | 0xE12C9C64,
596 | 0xE1435081,
597 | 0xE166AA1B,
598 | 0xE2CF46A5,
599 | 0xE428F17A,
600 | 0xE49B16DC,
601 | 0xE8FCC18A,
602 | 0xE93C80A2,
603 | 0xE9FE04D0,
604 | 0xEA46E28C,
605 | 0xEAB72F85,
606 | 0xEC1D5B99,
607 | 0xEF69C645,
608 | 0xF1A20AED,
609 | 0xF2E555D8,
610 | 0xF304C014,
611 | 0xF3724E32,
612 | 0xF4B77BBD,
613 | 0xF571F429,
614 | 0xFA6BF836,
615 | 0xFBF310F4,
616 | 0xFC57549F,
617 | 0xFC74DF3B,
618 | 0xFE878F59,
619 | 0xFED279F2,
620 | 0xFEDA1FF1,
621 | 0xFF020F3A,
622 | 0xFF17AB82,
623 | 0xFF77B75B,
624 | 0xFFF3B76A,
625 | };
626 |
627 | // Saddles - 0xBAA7E618
628 | public static List SaddleHashes = new List()
629 | {
630 | 0x3897CA,
631 | 0x1EC65C0,
632 | 0x1F7C4C5,
633 | 0x205E696,
634 | 0x306806F,
635 | 0x522CCED,
636 | 0x5D717C9,
637 | 0x93B7057,
638 | 0xA39D34E,
639 | 0xDE47F51,
640 | 0xF2F0045,
641 | 0xF4118E4,
642 | 0x106961A8,
643 | 0x14168240,
644 | 0x150D0DAA,
645 | 0x15FB6791,
646 | 0x17153A45,
647 | 0x189F7005,
648 | 0x19FFCB58,
649 | 0x1C14443F,
650 | 0x1D0BF8F2,
651 | 0x1EE21489,
652 | 0x20359E53,
653 | 0x219D85E2,
654 | 0x219DE87C,
655 | 0x21E8DDFA,
656 | 0x24F24446,
657 | 0x2844E292,
658 | 0x2BEA8ED4,
659 | 0x2E216DBC,
660 | 0x2E3F3A62,
661 | 0x2E4668A3,
662 | 0x2ECD9E70,
663 | 0x2F8C7941,
664 | 0x335DC49F,
665 | 0x34CC8CDF,
666 | 0x353FC03C,
667 | 0x3827D232,
668 | 0x3A758C4B,
669 | 0x3D0C3AED,
670 | 0x3E949A74,
671 | 0x3F9F62CE,
672 | 0x40C53D24,
673 | 0x43FC9BB6,
674 | 0x445FEF15,
675 | 0x454BA1F7,
676 | 0x47D2CB3F,
677 | 0x4B372288,
678 | 0x4BC19FC4,
679 | 0x4C1A5ADB,
680 | 0x51314715,
681 | 0x534A7D59,
682 | 0x53739DBF,
683 | 0x5546EB7A,
684 | 0x56DA4514,
685 | 0x5A9E4F6C,
686 | 0x5B45F932,
687 | 0x5B6390D9,
688 | 0x5BBC54C3,
689 | 0x5EC8FD2D,
690 | 0x60DE5335,
691 | 0x622583DE,
692 | 0x6380DE5D,
693 | 0x6384D886,
694 | 0x64CEC6DF,
695 | 0x660B29F9,
696 | 0x694DE418,
697 | 0x6C622F8C,
698 | 0x6D403492,
699 | 0x6E3AF3D1,
700 | 0x6FEABF89,
701 | 0x7092A211,
702 | 0x70BB7EC1,
703 | 0x70C65BED,
704 | 0x73957E8A,
705 | 0x76887E89,
706 | 0x77A4AEDC,
707 | 0x78F07DFA,
708 | 0x791482E6,
709 | 0x7A23C686,
710 | 0x7C19770A,
711 | 0x7C2C580C,
712 | 0x7D795D72,
713 | 0x7DBB3E1C,
714 | 0x7ECB7A3F,
715 | 0x7FD859C2,
716 | 0x7FF31745,
717 | 0x80BB92BC,
718 | 0x846B4869,
719 | 0x87F421F7,
720 | 0x88C363C5,
721 | 0x8D163776,
722 | 0x8D9D754C,
723 | 0x8DABACD7,
724 | 0x8DD09A7C,
725 | 0x8E22730C,
726 | 0x8E64DDB5,
727 | 0x8EF048CA,
728 | 0x8FFCF06B,
729 | 0x90489DD2,
730 | 0x9054977C,
731 | 0x93DA8768,
732 | 0x9533FA8E,
733 | 0x95E9C95B,
734 | 0x98C71B0F,
735 | 0x9B1C95F8,
736 | 0x9C2977E5,
737 | 0x9CD94BC1,
738 | 0x9E0C3959,
739 | 0x9E163303,
740 | 0x9FF23EBF,
741 | 0xA1154105,
742 | 0xA21923E5,
743 | 0xA4D2725F,
744 | 0xA78E9B7F,
745 | 0xA7AC9F7B,
746 | 0xA8DB3175,
747 | 0xAB909F14,
748 | 0xAD4A6355,
749 | 0xAF96C329,
750 | 0xB03CD750,
751 | 0xB357E58A,
752 | 0xB5802A5F,
753 | 0xB61F0668,
754 | 0xB7B33F88,
755 | 0xB9BE555D,
756 | 0xBA6A921E,
757 | 0xBB335077,
758 | 0xBC52F5E6,
759 | 0xBCBE0337,
760 | 0xBE703DF7,
761 | 0xBFD09512,
762 | 0xC04FE429,
763 | 0xC0C04297,
764 | 0xC10B5450,
765 | 0xC1A0FA18,
766 | 0xC1AF1568,
767 | 0xC454830C,
768 | 0xC4E32120,
769 | 0xC76C46D9,
770 | 0xC7D58D0B,
771 | 0xC7FC601A,
772 | 0xCA9F6038,
773 | 0xCD4CFC95,
774 | 0xCE8C2F22,
775 | 0xD11CBF82,
776 | 0xD225CCA0,
777 | 0xD2C8F7CB,
778 | 0xD2FA64BC,
779 | 0xD61B2996,
780 | 0xD6BF27E1,
781 | 0xD7FC86BF,
782 | 0xD97573C1,
783 | 0xDA36048D,
784 | 0xDA84CF33,
785 | 0xDE5A2905,
786 | 0xE039FC0F,
787 | 0xE1430217,
788 | 0xE36C8274,
789 | 0xE52BAC3F,
790 | 0xE5510BB8,
791 | 0xE5B31D9F,
792 | 0xE6488B58,
793 | 0xE9B7AA35,
794 | 0xEB1139AB,
795 | 0xEC882931,
796 | 0xEF0CDA78,
797 | 0xF1BAA60D,
798 | 0xF36A78DE,
799 | 0xF373B920,
800 | 0xF3BEA853,
801 | 0xF4B14B4A,
802 | 0xF687A8AA,
803 | 0xF7682D97,
804 | 0xF94D5623,
805 | 0xFC6AF7AF,
806 | 0xFCE1D7A4,
807 | 0xFD4E14C5,
808 | 0xFDB0F237,
809 | };
810 |
811 | // Holsters - 0xAC106B30
812 | public static List HolsterHashes = new List()
813 | {
814 | 0xF772CED6,
815 | };
816 |
817 | // Masks - 0xD3500E5D
818 | public static List MaskHashes = new List()
819 | {
820 | 0x8A78F53,
821 | 0x13AC6E51,
822 | 0x226B2F76,
823 | 0x2E776EE6,
824 | 0x30044BAC,
825 | 0x406FC6C7,
826 | 0x48099436,
827 | 0x4A992729,
828 | 0x4C8C83A4,
829 | 0x4E22622C,
830 | 0x4E312E61,
831 | 0x53EEEBD4,
832 | 0x5B22BA68,
833 | 0x61BEAE08,
834 | 0x62C5B02A,
835 | 0x68DB4FAD,
836 | 0x68FB97DE,
837 | 0x69CD996E,
838 | 0x6B355791,
839 | 0x702A4AF3,
840 | 0x75637CBD,
841 | 0x77987353,
842 | 0x7A773AC1,
843 | 0x7BFA791B,
844 | 0x872A0C5A,
845 | 0x8C471684,
846 | 0x8DB38601,
847 | 0x8DCC1CBE,
848 | 0x90A62272,
849 | 0x9946F874,
850 | 0x9A11B219,
851 | 0x9DB125FC,
852 | 0xA45049C6,
853 | 0xAD6DDEFD,
854 | 0xB0395F88,
855 | 0xB395D1C5,
856 | 0xB567EBF5,
857 | 0xBD887906,
858 | 0xC4886BDC,
859 | 0xC70D8F40,
860 | 0xC907FCA9,
861 | 0xD6E279B1,
862 | 0xD70C73EA,
863 | 0xDDCDB9A0,
864 | 0xE3278C28,
865 | 0xEC10D626,
866 | 0xEEF65F11,
867 | 0xF0ED62FF,
868 | 0xF17728C7,
869 | 0xF606EC4A,
870 | 0xFA5B72BB,
871 | };
872 |
873 | // Stirrups - 0xDA6DADCA
874 | public static List StirrupHashes = new List()
875 | {
876 | 0xB565B8,
877 | 0x3B3AB08,
878 | 0xBD4C573,
879 | 0x260E6A14,
880 | 0x29E063EB,
881 | 0x317A705D,
882 | 0x3685C57A,
883 | 0x371CBE0B,
884 | 0x3B472220,
885 | 0x3C4AFBDD,
886 | 0x40E71A1B,
887 | 0x43DFDE38,
888 | 0x48D64E92,
889 | 0x4F031B50,
890 | 0x54461E47,
891 | 0x54A5B6E9,
892 | 0x587DD49F,
893 | 0x5EBFDFAB,
894 | 0x633EC1F4,
895 | 0x67AF7302,
896 | 0x75178DD2,
897 | 0x78CD59E6,
898 | 0x81CEFBFC,
899 | 0x8246282F,
900 | 0x843A3A5B,
901 | 0x86568D25,
902 | 0x8A641D93,
903 | 0x8D0BC7DA,
904 | 0x979F2EC0,
905 | 0x99EE35DA,
906 | 0x9B4862F5,
907 | 0x9C73677E,
908 | 0x9E7F8E3B,
909 | 0x9EE8E174,
910 | 0x9F98E768,
911 | 0xA023523A,
912 | 0xA0DD0F3E,
913 | 0xBC3DF1CE,
914 | 0xBDC364E1,
915 | 0xBDDDEAF4,
916 | 0xBDF19F85,
917 | 0xC481A076,
918 | 0xCB9A3AD6,
919 | 0xCC1096B0,
920 | 0xD22757E2,
921 | 0xD7ABBCB5,
922 | 0xD8AE54FE,
923 | 0xDB236FBB,
924 | 0xE1392DA2,
925 | 0xE1CDA19B,
926 | 0xE600E0BE,
927 | 0xE73FF221,
928 | 0xEDF82EF6,
929 | 0xFD31EA31,
930 | };
931 |
932 | // Bedrolls - 0xEFB31921
933 | public static List RollHashes = new List()
934 | {
935 | 0x84E5AFA,
936 | 0xAC1F34C,
937 | 0x12F0DF9F,
938 | 0x18BB6B30,
939 | 0x1B43F045,
940 | 0x27543EBB,
941 | 0x36BEDD90,
942 | 0x45FEA6D8,
943 | 0x4B7E0712,
944 | 0x55A0E4FE,
945 | 0x69B21ADD,
946 | 0x69B29DC5,
947 | 0x72FCB059,
948 | 0x73D157B4,
949 | 0x7B55D476,
950 | 0x7C8A149A,
951 | 0x841C784A,
952 | 0x8C9F7709,
953 | 0x8DD7B735,
954 | 0x98214B1C,
955 | 0x9D868568,
956 | 0x9FD99D7D,
957 | 0xA1FD8B43,
958 | 0xA643680C,
959 | 0xB4532FEE,
960 | 0xBC664014,
961 | 0xD020E789,
962 | 0xD258EF10,
963 | 0xD8258E14,
964 | 0xFFB0391E,
965 | };
966 |
967 | public static List MountHashes = new List()
968 | {
969 | "A_C_Donkey_01",
970 | "A_C_HorseMulePainted_01",
971 | "A_C_HorseMule_01",
972 | "A_C_Horse_AmericanPaint_Greyovero",
973 | "A_C_Horse_AmericanPaint_Overo",
974 | "A_C_Horse_AmericanPaint_SplashedWhite",
975 | "A_C_Horse_AmericanPaint_Tobiano",
976 | "A_C_Horse_AmericanStandardbred_Black",
977 | "A_C_Horse_AmericanStandardbred_Buckskin",
978 | "A_C_Horse_AmericanStandardbred_LightBuckskin",
979 | "A_C_Horse_AmericanStandardbred_PalominoDapple",
980 | "A_C_Horse_AmericanStandardbred_SilverTailBuckskin",
981 | "A_C_Horse_Andalusian_DarkBay",
982 | "A_C_Horse_Andalusian_Perlino",
983 | "A_C_Horse_Andalusian_RoseGray",
984 | "A_C_Horse_Appaloosa_BlackSnowflake",
985 | "A_C_Horse_Appaloosa_Blanket",
986 | "A_C_Horse_Appaloosa_BrownLeopard",
987 | "A_C_Horse_Appaloosa_FewSpotted_PC",
988 | "A_C_Horse_Appaloosa_Leopard",
989 | "A_C_Horse_Appaloosa_LeopardBlanket",
990 | "A_C_Horse_Arabian_Black",
991 | "A_C_Horse_Arabian_Grey",
992 | "A_C_Horse_Arabian_RedChestnut",
993 | "A_C_Horse_Arabian_RedChestnut_PC",
994 | "A_C_Horse_Arabian_RoseGreyBay",
995 | "A_C_Horse_Arabian_WarpedBrindle_PC",
996 | "A_C_Horse_Arabian_White",
997 | "A_C_Horse_Ardennes_BayRoan",
998 | "A_C_Horse_Ardennes_IronGreyRoan",
999 | "A_C_Horse_Ardennes_StrawberryRoan",
1000 | "A_C_Horse_Belgian_BlondChestnut",
1001 | "A_C_Horse_Belgian_MealyChestnut",
1002 | "A_C_Horse_Breton_GrulloDun",
1003 | "A_C_Horse_Breton_MealyDappleBay",
1004 | "A_C_Horse_Breton_RedRoan",
1005 | "A_C_Horse_Breton_sealbrown",
1006 | "A_C_Horse_Breton_Sorrel",
1007 | "A_C_Horse_Breton_SteelGrey",
1008 | "A_C_Horse_Buell_WarVets",
1009 | "A_C_Horse_Criollo_BayBrindle",
1010 | "A_C_Horse_Criollo_BayFrameOvero",
1011 | "A_C_Horse_Criollo_BlueRoanOvero",
1012 | "A_C_Horse_Criollo_Dun",
1013 | "A_C_Horse_Criollo_MarbleSabino",
1014 | "A_C_Horse_Criollo_SorrelOvero",
1015 | "A_C_Horse_DutchWarmblood_ChocolateRoan",
1016 | "A_C_Horse_DutchWarmblood_SealBrown",
1017 | "A_C_Horse_DutchWarmblood_SootyBuckskin",
1018 | "A_C_Horse_EagleFlies",
1019 | "A_C_Horse_Gang_Bill",
1020 | "A_C_Horse_Gang_Charles",
1021 | "A_C_Horse_Gang_Charles_EndlessSummer",
1022 | "A_C_Horse_Gang_Dutch",
1023 | "A_C_Horse_Gang_Hosea",
1024 | "A_C_Horse_Gang_Javier",
1025 | "A_C_Horse_Gang_John",
1026 | "A_C_Horse_Gang_Karen",
1027 | "A_C_Horse_Gang_Kieran",
1028 | "A_C_Horse_Gang_Lenny",
1029 | "A_C_Horse_Gang_Micah",
1030 | "A_C_Horse_Gang_Sadie",
1031 | "A_C_Horse_Gang_Sadie_EndlessSummer",
1032 | "A_C_Horse_Gang_Sean",
1033 | "A_C_Horse_Gang_Trelawney",
1034 | "A_C_Horse_Gang_Uncle",
1035 | "A_C_Horse_Gang_Uncle_EndlessSummer",
1036 | "A_C_Horse_GypsyCob_PalominoBlagdon",
1037 | "A_C_Horse_GypsyCob_Piebald",
1038 | "A_C_Horse_GypsyCob_Skewbald",
1039 | "A_C_Horse_GypsyCob_SplashedBay",
1040 | "A_C_Horse_GypsyCob_SplashedPiebald",
1041 | "A_C_Horse_GypsyCob_WhiteBlagdon",
1042 | "A_C_Horse_HungarianHalfbred_DarkDappleGrey",
1043 | "A_C_Horse_HungarianHalfbred_FlaxenChestnut",
1044 | "A_C_Horse_HungarianHalfbred_LiverChestnut",
1045 | "A_C_Horse_HungarianHalfbred_PiebaldTobiano",
1046 | "A_C_Horse_John_EndlessSummer",
1047 | "A_C_Horse_KentuckySaddle_Black",
1048 | "A_C_Horse_KentuckySaddle_ButterMilkBuckskin_PC",
1049 | "A_C_Horse_KentuckySaddle_ChestnutPinto",
1050 | "A_C_Horse_KentuckySaddle_Grey",
1051 | "A_C_Horse_KentuckySaddle_SilverBay",
1052 | "A_C_Horse_Kladruber_Black",
1053 | "A_C_Horse_Kladruber_Cremello",
1054 | "A_C_Horse_Kladruber_DappleRoseGrey",
1055 | "A_C_Horse_Kladruber_Grey",
1056 | "A_C_Horse_Kladruber_Silver",
1057 | "A_C_Horse_Kladruber_White",
1058 | "A_C_Horse_MissouriFoxTrotter_AmberChampagne",
1059 | "A_C_Horse_MissouriFoxTrotter_BlackTovero",
1060 | "A_C_Horse_MissouriFoxTrotter_BlueRoan",
1061 | "A_C_Horse_MissouriFoxTrotter_BuckskinBrindle",
1062 | "A_C_Horse_MissouriFoxTrotter_DappleGrey",
1063 | "A_C_Horse_MissouriFoxTrotter_SableChampagne",
1064 | "A_C_Horse_MissouriFoxTrotter_SilverDapplePinto",
1065 | "A_C_Horse_Morgan_Bay",
1066 | "A_C_Horse_Morgan_BayRoan",
1067 | "A_C_Horse_Morgan_FlaxenChestnut",
1068 | "A_C_Horse_Morgan_LiverChestnut_PC",
1069 | "A_C_Horse_Morgan_Palomino",
1070 | "A_C_Horse_MP_Mangy_Backup",
1071 | "A_C_Horse_MurfreeBrood_Mange_01",
1072 | "A_C_Horse_MurfreeBrood_Mange_02",
1073 | "A_C_Horse_MurfreeBrood_Mange_03",
1074 | "A_C_Horse_Mustang_BlackOvero",
1075 | "A_C_Horse_Mustang_Buckskin",
1076 | "A_C_Horse_Mustang_ChestnutTovero",
1077 | "A_C_Horse_Mustang_GoldenDun",
1078 | "A_C_Horse_Mustang_GrulloDun",
1079 | "A_C_Horse_Mustang_RedDunOvero",
1080 | "A_C_Horse_Mustang_TigerStripedBay",
1081 | "A_C_Horse_Mustang_WildBay",
1082 | "A_C_Horse_Nokota_BlueRoan",
1083 | "A_C_Horse_Nokota_ReverseDappleRoan",
1084 | "A_C_Horse_Nokota_WhiteRoan",
1085 | "A_C_Horse_NorfolkRoadster_Black",
1086 | "A_C_Horse_NorfolkRoadster_DappledBuckskin",
1087 | "A_C_Horse_NorfolkRoadster_PiebaldRoan",
1088 | "A_C_Horse_NorfolkRoadster_RoseGrey",
1089 | "A_C_Horse_NorfolkRoadster_SpeckledGrey",
1090 | "A_C_Horse_NorfolkRoadster_SpottedTricolor",
1091 | "A_C_Horse_Shire_DarkBay",
1092 | "A_C_Horse_Shire_LightGrey",
1093 | "A_C_Horse_Shire_RavenBlack",
1094 | "A_C_Horse_SuffolkPunch_RedChestnut",
1095 | "A_C_Horse_SuffolkPunch_Sorrel",
1096 | "A_C_Horse_TennesseeWalker_BlackRabicano",
1097 | "A_C_Horse_TennesseeWalker_Chestnut",
1098 | "A_C_Horse_TennesseeWalker_DappleBay",
1099 | "A_C_Horse_TennesseeWalker_FlaxenRoan",
1100 | "A_C_Horse_TennesseeWalker_GoldPalomino_PC",
1101 | "A_C_Horse_TennesseeWalker_MahoganyBay",
1102 | "A_C_Horse_TennesseeWalker_RedRoan",
1103 | "A_C_Horse_Thoroughbred_BlackChestnut",
1104 | "A_C_Horse_Thoroughbred_BloodBay",
1105 | "A_C_Horse_Thoroughbred_Brindle",
1106 | "A_C_Horse_Thoroughbred_DappleGrey",
1107 | "A_C_Horse_Thoroughbred_ReverseDappleBlack",
1108 | "A_C_Horse_Turkoman_Black",
1109 | "A_C_Horse_Turkoman_Chestnut",
1110 | "A_C_Horse_Turkoman_DarkBay",
1111 | "A_C_Horse_Turkoman_Gold",
1112 | "A_C_Horse_Turkoman_Grey",
1113 | "A_C_Horse_Turkoman_Silver",
1114 | "A_C_Horse_Winter02_01",
1115 | "P_C_Horse_01"
1116 | };
1117 | }
1118 | }
1119 |
--------------------------------------------------------------------------------
/RedMenu/RedMenuClient/data/TeleportData.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Linq.Expressions;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace RedMenuClient.data
9 | {
10 | class TeleportLocation
11 | {
12 | private string name;
13 | private float x, y, z, h;
14 | public TeleportLocation(string name, float x, float y, float z, float h)
15 | {
16 | this.name = name;
17 | this.x = x;
18 | this.y = y;
19 | this.z = z;
20 | this.h = h;
21 | }
22 |
23 | public string Name { get { return name; } }
24 | public float X { get { return x; } }
25 | public float Y { get { return y; } }
26 | public float Z { get { return z; } }
27 | public float H { get { return h; } }
28 | }
29 | class TeleportData
30 | {
31 | public static List TeleportLocations { get; } = new List()
32 | {
33 | new TeleportLocation("Annesburg", 2929.09f, 1291.44f, 44.66f, 70.79f),
34 | new TeleportLocation("Armadillo", -3742.67f, -2607.75f, -13.24f, 272.03f),
35 | new TeleportLocation("Blackwater", -731.29f, -1243.02f, 44.73f, 90.96f),
36 | new TeleportLocation("Colter", -1361.96f, 2392.64f, 306.61f, 332.11f),
37 | new TeleportLocation("Emerald Ranch", 1518.24f, 429.25f, 90.68f, 153.84f),
38 | new TeleportLocation("Guarma", 1268.31f, -6853.53f, 43.31f, 240.00f),
39 | new TeleportLocation("Lagras", 2099.73f, -583.10f, 41.55f, 209.05f),
40 | new TeleportLocation("Manzanita Post", -1948.67f, -1621.65f, 116.08f, 76.63f),
41 | new TeleportLocation("McFarland Ranch", -2499.87f, -2446.45f, 60.15f, 283.89f),
42 | new TeleportLocation("Mexico", -2140.34f, -3398.57f, 33.06f, 252.34f),
43 | new TeleportLocation("Rhodes", 1240.31f, -1289.46f, 76.91f, 301.61f),
44 | new TeleportLocation("Saint Denis", 2715.28f, -1431.62f, 46.08f, 24.32f),
45 | new TeleportLocation("Sisika Penitentiary", 3350.55f, -642.22f, 45.29f, 0f),
46 | new TeleportLocation("Strawberry", -1743.25f, -412.08f, 155.45f, 32.19f),
47 | new TeleportLocation("Thieves Landing", -1393.38f, -2233.62f, 43.35f, 147.97f),
48 | new TeleportLocation("Tumbleweed", -5432.90f, -2947.03f, 0.64f, 80.80f),
49 | new TeleportLocation("Valentine", -183.61f, 648.32f, 113.57f, 68.20f),
50 | new TeleportLocation("Van Horn", 2901.32f, 636.08f, 56.28f, 305.40f),
51 | new TeleportLocation("Wapiti", 489.37f, 2211.77f, 247.06f, 58.47f)
52 | };
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/RedMenu/RedMenuClient/data/VehicleData.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Data;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace RedMenuClient.data
9 | {
10 | class VehicleData
11 | {
12 | public static List BoatHashes = new List()
13 | {
14 | "boatSteam02x",
15 | "canoe",
16 | "CANOETREETRUNK",
17 | "horseBoat",
18 | "KEELBOAT",
19 | "PIROGUE",
20 | "PIROGUE2",
21 | "RCBOAT",
22 | "rowboat",
23 | "ROWBOATSWAMP",
24 | "ROWBOATSWAMP02",
25 | "SHIP_NBDGUAMA",
26 | "ship_nbdGuama2",
27 | "skiff",
28 | "SMUGGLER02",
29 | "TugBoat2",
30 | "TugBoat3",
31 | "turbineboat",
32 | };
33 |
34 | public static List WagonHashes = new List()
35 | {
36 | "armysupplywagon",
37 | "CHUCKWAGON000X",
38 | "CHUCKWAGON002X",
39 | "coal_wagon",
40 | "gatchuck",
41 | "gatchuck_2",
42 | "LOGWAGON",
43 | "logwagon2",
44 | "OILWAGON01X",
45 | "oilWagon02x",
46 | "POLICEWAGON01X",
47 | "policeWagongatling01x",
48 | "supplywagon",
49 | "supplywagon2",
50 | "utilliwag",
51 | "WAGON02X",
52 | "WAGON03X",
53 | "WAGON04X",
54 | "WAGON05X",
55 | "wagon06x",
56 | "wagonCircus01x",
57 | "wagonCircus02x",
58 | "wagondairy01x",
59 | "wagonDoc01x",
60 | "WAGONPRISON01X",
61 | "wagontraveller01x",
62 | "wagonWork01x",
63 | "warwagon2"
64 | };
65 |
66 | public static List BuggyHashes = new List()
67 | {
68 | "buggy01",
69 | "buggy02",
70 | "buggy03"
71 | };
72 |
73 | public static List CoachHashes = new List()
74 | {
75 | "COACH2",
76 | "COACH3",
77 | "coach3_cutscene",
78 | "coach4",
79 | "coach5",
80 | "coach6",
81 | "STAGECOACH001X",
82 | "STAGECOACH002X",
83 | "STAGECOACH003X",
84 | "STAGECOACH004X",
85 | "STAGECOACH005X",
86 | "STAGECOACH006X"
87 | };
88 |
89 | public static List CartHashes = new List()
90 | {
91 | "cart01",
92 | "cart02",
93 | "cart03",
94 | "cart04",
95 | "cart05",
96 | "cart06",
97 | "cart07",
98 | "cart08"
99 | };
100 |
101 | public static List MiscHashes = new List()
102 | {
103 | "BREACH_CANNON",
104 | "GATLING_GUN",
105 | "GATLINGMAXIM02",
106 | "hotairballoon01",
107 | "hotchkiss_cannon",
108 | "mineCart01x",
109 | };
110 | }
111 | }
112 |
--------------------------------------------------------------------------------
/RedMenu/RedMenuClient/menus/MainMenu.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using MenuAPI;
7 | using CitizenFX.Core;
8 | using static CitizenFX.Core.Native.API;
9 | using CitizenFX.Core.Native;
10 | using RedMenuShared;
11 | using RedMenuClient.util;
12 |
13 | namespace RedMenuClient.menus
14 | {
15 | class MainMenu
16 | {
17 | private static Menu mainMenu = new Menu("RedMenu", "Welcome to RedMenu!");
18 | private static bool setupDone = false;
19 |
20 | private static void SetupMenu()
21 | {
22 | if (setupDone) return;
23 | setupDone = true;
24 | mainMenu.MenuTitle = GetPlayerName(PlayerId());
25 |
26 | MenuController.AddMenu(mainMenu);
27 |
28 | // Online Players Menu
29 | if (PermissionsManager.IsAllowed(Permission.OPMMenu))
30 | {
31 | MenuController.AddSubmenu(mainMenu, OnlinePlayersMenu.GetMenu());
32 | MenuItem submenuBtn = new MenuItem("Online Players", "List of players in the server.")
33 | {
34 | RightIcon = MenuItem.Icon.ARROW_RIGHT
35 | };
36 |
37 | mainMenu.AddMenuItem(submenuBtn);
38 | MenuController.BindMenuItem(mainMenu, OnlinePlayersMenu.GetMenu(), submenuBtn);
39 | }
40 |
41 | // Player Menu
42 | if (PermissionsManager.IsAllowed(Permission.PMMenu))
43 | {
44 | MenuController.AddSubmenu(mainMenu, PlayerMenu.GetMenu());
45 | MenuItem submenuBtn = new MenuItem("Player Menu", "All kinds of player related options.")
46 | {
47 | RightIcon = MenuItem.Icon.ARROW_RIGHT
48 | };
49 |
50 | mainMenu.AddMenuItem(submenuBtn);
51 | MenuController.BindMenuItem(mainMenu, PlayerMenu.GetMenu(), submenuBtn);
52 | }
53 |
54 | // Weapons Menu
55 | if (PermissionsManager.IsAllowed(Permission.WMMenu))
56 | {
57 | MenuController.AddSubmenu(mainMenu, WeaponsMenu.GetMenu());
58 | MenuItem submenuBtn = new MenuItem("Weapons Menu", "Weapon and ammo related options.")
59 | {
60 | RightIcon = MenuItem.Icon.ARROW_RIGHT
61 | };
62 |
63 | mainMenu.AddMenuItem(submenuBtn);
64 | MenuController.BindMenuItem(mainMenu, WeaponsMenu.GetMenu(), submenuBtn);
65 | }
66 |
67 | if (PermissionsManager.IsAllowed(Permission.MMMenu))
68 | {
69 | MenuController.AddSubmenu(mainMenu, MountMenu.GetMenu());
70 | MenuItem submenuBtn = new MenuItem("Mount Menu", "Mount related options.")
71 | {
72 | RightIcon = MenuItem.Icon.ARROW_RIGHT
73 | };
74 |
75 | mainMenu.AddMenuItem(submenuBtn);
76 | MenuController.BindMenuItem(mainMenu, MountMenu.GetMenu(), submenuBtn);
77 | }
78 |
79 | if (PermissionsManager.IsAllowed(Permission.VMMenu))
80 | {
81 | MenuController.AddSubmenu(mainMenu, VehicleMenu.GetMenu());
82 | MenuItem submenuBtn = new MenuItem("Vehicle Menu", "Vehicle related options.")
83 | {
84 | RightIcon = MenuItem.Icon.ARROW_RIGHT
85 | };
86 |
87 | mainMenu.AddMenuItem(submenuBtn);
88 | MenuController.BindMenuItem(mainMenu, VehicleMenu.GetMenu(), submenuBtn);
89 | }
90 |
91 | // Teleport Menu
92 | if (PermissionsManager.IsAllowed(Permission.TMMenu))
93 | {
94 | MenuController.AddSubmenu(mainMenu, TeleportMenu.GetMenu());
95 | MenuItem submenuBtn = new MenuItem("Teleport Menu", "Teleport options.")
96 | {
97 | RightIcon = MenuItem.Icon.ARROW_RIGHT
98 | };
99 |
100 | mainMenu.AddMenuItem(submenuBtn);
101 | MenuController.BindMenuItem(mainMenu, TeleportMenu.GetMenu(), submenuBtn);
102 | }
103 |
104 | // World Options Menu
105 | if (PermissionsManager.IsAllowed(Permission.WOMenu))
106 | {
107 | MenuController.AddSubmenu(mainMenu, WorldMenu.GetMenu());
108 | MenuItem submenuBtn = new MenuItem("World Menu", "World related options.")
109 | {
110 | RightIcon = MenuItem.Icon.ARROW_RIGHT
111 | };
112 |
113 | mainMenu.AddMenuItem(submenuBtn);
114 | MenuController.BindMenuItem(mainMenu, WorldMenu.GetMenu(), submenuBtn);
115 | }
116 |
117 | // Voice Menu
118 | if (PermissionsManager.IsAllowed(Permission.VOMenu))
119 | {
120 | MenuController.AddSubmenu(mainMenu, VoiceMenu.GetMenu());
121 | MenuItem submenuBtn = new MenuItem("Voice Menu", "Voice related options.")
122 | {
123 | RightIcon = MenuItem.Icon.ARROW_RIGHT
124 | };
125 |
126 | mainMenu.AddMenuItem(submenuBtn);
127 | MenuController.BindMenuItem(mainMenu, VoiceMenu.GetMenu(), submenuBtn);
128 | }
129 |
130 | // Misc settings
131 | MenuController.AddSubmenu(mainMenu, MiscSettingsMenu.GetMenu());
132 | MenuItem miscBtn = new MenuItem("Misc Settings", "Miscellaneous settings and menu options.")
133 | {
134 | RightIcon = MenuItem.Icon.ARROW_RIGHT
135 | };
136 |
137 | mainMenu.AddMenuItem(miscBtn);
138 | MenuController.BindMenuItem(mainMenu, MiscSettingsMenu.GetMenu(), miscBtn);
139 |
140 |
141 | // Server Info
142 | MenuController.AddSubmenu(mainMenu, ServerInfoMenu.GetMenu());
143 | MenuItem serverBtn = new MenuItem("Server Info", "Information about this server.")
144 | {
145 | RightIcon = MenuItem.Icon.ARROW_RIGHT
146 | };
147 |
148 | mainMenu.AddMenuItem(serverBtn);
149 | MenuController.BindMenuItem(mainMenu, ServerInfoMenu.GetMenu(), serverBtn);
150 |
151 | }
152 |
153 | public static Menu GetMenu()
154 | {
155 | SetupMenu();
156 | return mainMenu;
157 | }
158 | }
159 | }
160 |
--------------------------------------------------------------------------------
/RedMenu/RedMenuClient/menus/MiscSettingsMenu.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using MenuAPI;
7 | using CitizenFX.Core;
8 | using static CitizenFX.Core.Native.API;
9 | using CitizenFX.Core.Native;
10 | using RedMenuShared;
11 | using RedMenuClient.util;
12 |
13 | namespace RedMenuClient.menus
14 | {
15 | class MiscSettingsMenu
16 | {
17 | private static Menu menu = new Menu("Misc Settings", $"RedMenu Version {ConfigManager.Version}");
18 | private static bool setupDone = false;
19 |
20 | private static void SetupMenu()
21 | {
22 | if (setupDone) return;
23 | setupDone = true;
24 |
25 | MenuCheckboxItem minimapKeybind = new MenuCheckboxItem("Minimap Controls", "Holding down the Select Radar Option button will allow you to toggle the minimap on/off when this option is enabled.", UserDefaults.MiscMinimapControls);
26 | MenuCheckboxItem showCores = new MenuCheckboxItem("Always Show Cores", "The cores above your radar will always be displayed when this option is enabled. The game will automatically show or hide the cores if this is disabled.", UserDefaults.MiscAlwaysShowCores);
27 | MenuItem clearArea = new MenuItem("Clear Area", "Clears the area around your player.");
28 |
29 | menu.AddMenuItem(minimapKeybind);
30 | menu.AddMenuItem(showCores);
31 |
32 | if (PermissionsManager.IsAllowed(Permission.MSClearArea))
33 | {
34 | menu.AddMenuItem(clearArea);
35 | }
36 |
37 | menu.OnItemSelect += (m, item, index) =>
38 | {
39 | if (item == clearArea)
40 | {
41 | int ent = 0;
42 | int handle;
43 | Vector3 coords1 = GetEntityCoords(PlayerPedId(), true, true);
44 | Vector3 coords2;
45 |
46 | handle = FindFirstObject(ref ent);
47 | coords2 = GetEntityCoords(ent, true, true);
48 | if (GetDistanceBetweenCoords(coords1.X, coords1.Y, coords1.Z, coords2.X, coords2.Y, coords2.Z, true) <= 100)
49 | {
50 | DeleteObject(ref ent);
51 | }
52 | while (FindNextObject(handle, ref ent))
53 | {
54 | coords2 = GetEntityCoords(ent, true, true);
55 | if (GetDistanceBetweenCoords(coords1.X, coords1.Y, coords1.Z, coords2.X, coords2.Y, coords2.Z, true) <= 100)
56 | {
57 | DeleteObject(ref ent);
58 | }
59 | }
60 | EndFindObject(handle);
61 |
62 | handle = FindFirstPed(ref ent);
63 | if (!IsPedAPlayer(ent))
64 | {
65 | coords2 = GetEntityCoords(ent, true, true);
66 |
67 | if (GetDistanceBetweenCoords(coords1.X, coords1.Y, coords1.Z, coords2.X, coords2.Y, coords2.Z, true) <= 100)
68 | {
69 | DeletePed(ref ent);
70 | }
71 | }
72 | while (FindNextPed(handle, ref ent))
73 | {
74 | if (!IsPedAPlayer(ent))
75 | {
76 | coords2 = GetEntityCoords(ent, true, true);
77 | if (GetDistanceBetweenCoords(coords1.X, coords1.Y, coords1.Z, coords2.X, coords2.Y, coords2.Z, true) <= 100)
78 | {
79 | DeletePed(ref ent);
80 | }
81 | }
82 | }
83 | EndFindPed(handle);
84 |
85 | handle = FindFirstVehicle(ref ent);
86 | coords2 = GetEntityCoords(ent, true, true);
87 | if (GetDistanceBetweenCoords(coords1.X, coords1.Y, coords1.Z, coords2.X, coords2.Y, coords2.Z, true) <= 100)
88 | {
89 | DeleteVehicle(ref ent);
90 | }
91 | while (FindNextVehicle(handle, ref ent))
92 | {
93 | coords2 = GetEntityCoords(ent, true, true);
94 | if (GetDistanceBetweenCoords(coords1.X, coords1.Y, coords1.Z, coords2.X, coords2.Y, coords2.Z, true) <= 100)
95 | {
96 | DeleteVehicle(ref ent);
97 | }
98 | }
99 | EndFindVehicle(handle);
100 | }
101 | };
102 |
103 | menu.OnCheckboxChange += (m, item, index, _checked) =>
104 | {
105 | if (item == minimapKeybind)
106 | {
107 | UserDefaults.MiscMinimapControls = _checked;
108 | }
109 | else if (item == showCores)
110 | {
111 | UserDefaults.MiscAlwaysShowCores = _checked;
112 | Function.Call((Hash)0xD4EE21B7CC7FD350, UserDefaults.MiscAlwaysShowCores); // _ALWAYS_SHOW_HORSE_CORES
113 | Function.Call((Hash)0x50C803A4CD5932C5, UserDefaults.MiscAlwaysShowCores); // _ALWAYS_SHOW_PLAYER_CORES
114 | }
115 | };
116 | }
117 |
118 | public static Menu GetMenu()
119 | {
120 | SetupMenu();
121 | return menu;
122 | }
123 | }
124 | }
125 |
--------------------------------------------------------------------------------
/RedMenu/RedMenuClient/menus/MountMenu.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using MenuAPI;
7 | using CitizenFX.Core;
8 | using static CitizenFX.Core.Native.API;
9 | using CitizenFX.Core.Native;
10 | using RedMenuShared;
11 | using RedMenuClient.util;
12 | using System.Net;
13 | using RedMenuClient.data;
14 |
15 | namespace RedMenuClient.menus
16 | {
17 | class MountMenu
18 | {
19 | private static Menu menu = new Menu("Mount", "Mount related options.");
20 | private static bool setupDone = false;
21 | private static int currentMount = 0;
22 | private static Random rng = new Random();
23 |
24 | private const int maxSavedMounts = 100;
25 |
26 | private static Dictionary currentMountComponents = new Dictionary();
27 |
28 | private static int GetLastMount(int ped)
29 | {
30 | return Function.Call((Hash)0x4C8B59171957BCF7, ped);
31 | }
32 |
33 | private static int CreatePed_2(uint model, float x, float y, float z, float heading, bool isNetwork, bool netMissionEntity, bool p7, bool p8)
34 | {
35 | return Function.Call((Hash)0xD49F9B0955C367DE, model, x, y, z, heading, isNetwork, netMissionEntity, p7, p8);
36 | }
37 |
38 | private static int BlipAddForEntity(int blipHash, int entity)
39 | {
40 | return Function.Call((Hash)0x23F74C2FDA6E7C61, blipHash, entity);
41 | }
42 |
43 | private static void SetPedFaceFeature(int ped, int index, float value)
44 | {
45 | Function.Call((Hash)0x5653AB26C82938CF, ped, index, value);
46 | }
47 |
48 | private static void UpdatePedVariation(int ped, bool p1, bool p2, bool p3, bool p4, bool p5)
49 | {
50 | Function.Call((Hash)0xCC8CA3E88256E58F, ped, p1, p2, p3, p4, p5);
51 | }
52 |
53 | private static bool IsThisModelAHorse(int ped)
54 | {
55 | return Function.Call((Hash)0x772A1969F649E902, ped);
56 | }
57 |
58 | private static void SetPedAsSaddleHorseForPlayer(int player, int mount)
59 | {
60 | Function.Call((Hash)0xD2CB0FB0FDCB473D, player, mount);
61 | }
62 |
63 | private static int GetTargetMount(int ped)
64 | {
65 | if (IsThisModelAHorse(GetEntityModel(ped)))
66 | {
67 | return ped;
68 | }
69 | else
70 | {
71 | int lastMount = GetLastMount(ped);
72 |
73 | if (DoesEntityExist(lastMount))
74 | {
75 | return GetLastMount(ped);
76 | }
77 | else
78 | {
79 | return currentMount;
80 | }
81 | }
82 | }
83 |
84 | private async static void SpawnMount(uint model)
85 | {
86 | if (currentMount != 0)
87 | {
88 | DeleteEntity(ref currentMount);
89 | currentMount = 0;
90 | }
91 |
92 | int ped = PlayerPedId();
93 | Vector3 coords = GetEntityCoords(ped, false, false);
94 | float h = GetEntityHeading(ped);
95 |
96 | // Get a point in front of the player
97 | float r = -h * (float)(Math.PI / 180);
98 | float x2 = coords.X + (float)(5 * Math.Sin(r));
99 | float y2 = coords.Y + (float)(5 * Math.Cos(r));
100 |
101 | if (IsModelInCdimage(model))
102 | {
103 | RequestModel(model, false);
104 | while (!HasModelLoaded(model))
105 | {
106 | RequestModel(model, false);
107 | await BaseScript.Delay(0);
108 | }
109 |
110 | currentMount = CreatePed_2(model, x2, y2, coords.Z, 0.0f, true, true, true, true);
111 | SetModelAsNoLongerNeeded(model);
112 | SetPedOutfitPreset(currentMount, 0, 0);
113 | SetPedAsSaddleHorseForPlayer(PlayerId(), currentMount);
114 | SetPedConfigFlag(currentMount, 297, true); // Enable leading
115 | SetPedConfigFlag(currentMount, 312, true); // Won't flee when shooting
116 | SetPedConfigFlag(currentMount, 442, true); // Remove Flee prompt
117 | BlipAddForEntity(-1230993421, currentMount);
118 | }
119 | else
120 | {
121 | Debug.WriteLine($"^1[ERROR] This ped model is not present in the game files {model}.^7");
122 | }
123 |
124 | SetEntityInvincible(currentMount, UserDefaults.MountGodMode);
125 | }
126 |
127 | private static void ResetCurrentMountComponents()
128 | {
129 | int[] keys = currentMountComponents.Keys.ToArray();
130 | for (int i = 0; i < keys.Length; ++i)
131 | {
132 | currentMountComponents[keys[i]] = 0;
133 | }
134 | }
135 |
136 | private static async Task GetUserInput(string windowTitle, string defaultText, int maxInputLength)
137 | {
138 | var spacer = "\t";
139 | AddTextEntry($"{GetCurrentResourceName().ToUpper()}_WINDOW_TITLE", $"{windowTitle ?? "Enter"}:{spacer}(MAX {maxInputLength} Characters)");
140 | DisplayOnscreenKeyboard(0, $"{GetCurrentResourceName().ToUpper()}_WINDOW_TITLE", "", defaultText ?? "", "", "", "", maxInputLength); await BaseScript.Delay(0);
141 | while (true)
142 | {
143 | int keyboardStatus = UpdateOnscreenKeyboard();
144 | switch (keyboardStatus)
145 | {
146 | case 3:
147 | case 2:
148 | return null;
149 | case 1:
150 | return GetOnscreenKeyboardResult();
151 | default:
152 | await BaseScript.Delay(0);
153 | break;
154 | }
155 | }
156 | }
157 |
158 | private static void SetMountSex(int mount, int sex)
159 | {
160 | switch (sex)
161 | {
162 | case 0:
163 | SetPedFaceFeature(mount, 41611, 0.0f);
164 | break;
165 | case 1:
166 | SetPedFaceFeature(mount, 41611, 1.0f);
167 | break;
168 | default:
169 | break;
170 | }
171 |
172 | UpdatePedVariation(mount, false, true, true, true, false);
173 | }
174 |
175 | private static void SetupMenu()
176 | {
177 | if (setupDone) return;
178 | setupDone = true;
179 |
180 | MenuListItem restoreInnerCores = new MenuListItem("Restore Inner Cores", new List() { "All", "Health", "Stamina" }, 0, "Restore horse inner cores.");
181 | MenuListItem restoreOuterCores = new MenuListItem("Restore Outer Cores", new List() { "All", "Health", "Stamina" }, 0, "Restore horse outer cores.");
182 | MenuListItem fortifyCores = new MenuListItem("Fortify Cores", new List() { "All", "Health", "Stamina" }, 0, "Fortify horse inner cores.");
183 | MenuCheckboxItem godMode = new MenuCheckboxItem("God Mode", "Prevents your mount from taking damage.", UserDefaults.MountGodMode);
184 | MenuCheckboxItem infiniteStamina = new MenuCheckboxItem("Infinite Stamina", "Your mount will never run out of stamina.", UserDefaults.MountInfiniteStamina);
185 | MenuItem cleanMount = new MenuItem("Clean Mount", "Remove all dirt and other decals from the mount you are currently riding.");
186 | MenuItem deleteMount = new MenuItem("Delete Mount", "Delete the mount you are currently riding.");
187 |
188 | List mounts = new List();
189 | MenuListItem mountPeds = new MenuListItem("Spawn Mount", mounts, 0, "Spawn a mount.");
190 | for (int i = 0; i < data.MountData.MountHashes.Count(); i++)
191 | {
192 | mounts.Add($"{data.MountData.MountHashes[i]} ({i + 1}/{data.MountData.MountHashes.Count()}");
193 | }
194 |
195 | MenuListItem sex = new MenuListItem("Sex", new List() { "Male", "Female" }, 0, "Set the sex of your mount.");
196 |
197 | MenuItem randomMount = new MenuItem("Spawn Random Mount", "Spawn a random mount.");
198 | MenuItem randomTack = new MenuItem("Randomize Tack", "Add random tack to your horse.");
199 |
200 | if (PermissionsManager.IsAllowed(Permission.MMSavedMounts))
201 | {
202 | MenuItem savedMounts = new MenuItem("Saved Mounts", "Save and load mounts.") { RightIcon = MenuItem.Icon.ARROW_RIGHT };
203 | Menu savedMountsMenu = new Menu("Saved Mounts", "Save and load mounts");
204 | menu.AddMenuItem(savedMounts);
205 | MenuController.AddSubmenu(menu, savedMountsMenu);
206 | MenuController.BindMenuItem(menu, savedMountsMenu, savedMounts);
207 |
208 | for (int i = 0; i <= 11; ++i)
209 | {
210 | currentMountComponents[i] = 0;
211 | }
212 |
213 | for (int i = 1; i <= maxSavedMounts; ++i)
214 | {
215 | int mountIndex = i;
216 |
217 | if (!StorageManager.TryGet("SavedMounts_" + mountIndex + "_name", out string mountName))
218 | {
219 | mountName = "Mount " + mountIndex;
220 | }
221 |
222 | MenuItem savedMount = new MenuItem(mountName) { RightIcon = MenuItem.Icon.ARROW_RIGHT };
223 | savedMountsMenu.AddMenuItem(savedMount);
224 |
225 | Menu savedMountOptionsMenu = new Menu(mountName);
226 | MenuController.AddSubmenu(savedMountsMenu, savedMountOptionsMenu);
227 | MenuController.BindMenuItem(savedMountsMenu, savedMountOptionsMenu, savedMount);
228 |
229 | MenuItem load = new MenuItem("Load", "Load this mount.");
230 | MenuItem save = new MenuItem("Save", "Save current mount to this slot.");
231 | savedMountOptionsMenu.AddMenuItem(load);
232 | savedMountOptionsMenu.AddMenuItem(save);
233 |
234 | savedMountOptionsMenu.OnItemSelect += async (m, item, index) =>
235 | {
236 | if (item == load)
237 | {
238 | if (StorageManager.TryGet("SavedMounts_" + mountIndex + "_model", out int model))
239 | {
240 | SpawnMount((uint)model);
241 | }
242 |
243 | await BaseScript.Delay(500);
244 |
245 | ResetCurrentMountComponents();
246 |
247 | int[] keys = currentMountComponents.Keys.ToArray();
248 |
249 | for (int j = 0; j < keys.Length; ++j)
250 | {
251 | if (StorageManager.TryGet("SavedMounts_" + mountIndex + "_c_" + keys[j], out int hash))
252 | {
253 | switch ((uint)hash)
254 | {
255 | case 0x17CEB41A:
256 | case 0x5447332:
257 | case 0x80451C25:
258 | case 0x94B2E3AF:
259 | case 0xA63CAE10:
260 | case 0xAA0217AB:
261 | case 0xBAA7E618:
262 | case 0xD3500E5D:
263 | case 0xDA6DADCA:
264 | case 0xEFB31921:
265 | case 0x1530BE1C:
266 | Function.Call((Hash)0xD710A5007C2AC539, currentMount, hash, 0);
267 | Function.Call((Hash)0xCC8CA3E88256E58F, currentMount, false, true, true, true, false);
268 | break;
269 | default:
270 | Function.Call((Hash)0xD3A7B003ED343FD9, currentMount, (uint)hash, true, true, false);
271 | break;
272 | }
273 | currentMountComponents[keys[j]] = (uint)hash;
274 | }
275 | else
276 | {
277 | currentMountComponents[keys[j]] = 0;
278 | }
279 | }
280 |
281 | if (StorageManager.TryGet("SavedMounts_" + mountIndex + "_sex", out int mountSex))
282 | {
283 | SetMountSex(currentMount, mountSex);
284 | }
285 |
286 | SetPedPromptName(currentMount, mountName);
287 | }
288 | else if (item == save)
289 | {
290 | string newName = await GetUserInput("Enter mount name", mountName, 20);
291 |
292 | if (newName != null)
293 | {
294 | StorageManager.Save("SavedMounts_" + mountIndex + "_model", GetEntityModel(currentMount), true);
295 | foreach (KeyValuePair entry in currentMountComponents)
296 | {
297 | StorageManager.Save("SavedMounts_" + mountIndex + "_c_" + entry.Key, (int)entry.Value, true);
298 | }
299 | StorageManager.Save("SavedMounts_" + mountIndex + "_sex", sex.ListIndex, true);
300 | StorageManager.Save("SavedMounts_" + mountIndex + "_name", newName, true);
301 | savedMount.Text = newName;
302 | savedMountOptionsMenu.MenuTitle = newName;
303 | mountName = newName;
304 | }
305 | }
306 | };
307 | }
308 | }
309 |
310 | if (PermissionsManager.IsAllowed(Permission.MMSpawn))
311 | {
312 | menu.AddMenuItem(mountPeds);
313 | menu.AddMenuItem(randomMount);
314 | }
315 |
316 | if (PermissionsManager.IsAllowed(Permission.MMSex))
317 | {
318 | menu.AddMenuItem(sex);
319 | }
320 |
321 | if (PermissionsManager.IsAllowed(Permission.MMTack))
322 | {
323 | Menu tackMenu = new Menu("Tack", "Customize mount tack.");
324 | MenuItem tack = new MenuItem("Tack", "Customize mount tack.") { RightIcon = MenuItem.Icon.ARROW_RIGHT };
325 | menu.AddMenuItem(tack);
326 | MenuController.AddSubmenu(menu, tackMenu);
327 | MenuController.BindMenuItem(menu, tackMenu, tack);
328 |
329 | menu.AddMenuItem(randomTack);
330 |
331 | List blankets = new List();
332 | List grips = new List();
333 | List bags = new List();
334 | List reins = new List();
335 | List tails = new List();
336 | List manes = new List();
337 | List saddles = new List();
338 | List masks = new List();
339 | List stirrups = new List();
340 | List rolls = new List();
341 | List lanterns = new List();
342 | foreach (var k in data.MountData.BlanketHashes) { blankets.Add($"({data.MountData.BlanketHashes.IndexOf(k) + 1}/{data.MountData.BlanketHashes.Count()}) 0x{k.ToString("X08")}"); }
343 | foreach (var k in data.MountData.GripHashes) { grips.Add($"({data.MountData.GripHashes.IndexOf(k) + 1}/{data.MountData.GripHashes.Count()}) 0x{k.ToString("X08")}"); }
344 | foreach (var k in data.MountData.BagHashes) { bags.Add($"({data.MountData.BagHashes.IndexOf(k) + 1}/{data.MountData.BagHashes.Count()}) 0x{k.ToString("X08")}"); }
345 | foreach (var k in data.MountData.ReinsHashes) { reins.Add($"({data.MountData.ReinsHashes.IndexOf(k) + 1}/{data.MountData.ReinsHashes.Count()}) 0x{k.ToString("X08")}"); }
346 | foreach (var k in data.MountData.TailHashes) { tails.Add($"({data.MountData.TailHashes.IndexOf(k) + 1}/{data.MountData.TailHashes.Count()}) 0x{k.ToString("X08")}"); }
347 | foreach (var k in data.MountData.ManeHashes) { manes.Add($"({data.MountData.ManeHashes.IndexOf(k) + 1}/{data.MountData.ManeHashes.Count()}) 0x{k.ToString("X08")}"); }
348 | foreach (var k in data.MountData.SaddleHashes) { saddles.Add($"({data.MountData.SaddleHashes.IndexOf(k) + 1}/{data.MountData.SaddleHashes.Count()}) 0x{k.ToString("X08")}"); }
349 | foreach (var k in data.MountData.MaskHashes) { masks.Add($"({data.MountData.MaskHashes.IndexOf(k) + 1}/{data.MountData.MaskHashes.Count()}) 0x{k.ToString("X08")}"); }
350 | foreach (var k in data.MountData.StirrupHashes) { stirrups.Add($"({data.MountData.StirrupHashes.IndexOf(k) + 1}/{data.MountData.StirrupHashes.Count()}) 0x{k.ToString("X08")}"); }
351 | foreach (var k in data.MountData.RollHashes) { rolls.Add($"({data.MountData.RollHashes.IndexOf(k) + 1}/{data.MountData.RollHashes.Count()}) 0x{k.ToString("X08")}"); }
352 | foreach (var k in data.MountData.LanternHashes) { lanterns.Add($"({data.MountData.LanternHashes.IndexOf(k) + 1}/{data.MountData.LanternHashes.Count()}) 0x{k.ToString("X08")}"); }
353 | tackMenu.AddMenuItem(new MenuListItem("Blankets", blankets, 0));
354 | tackMenu.AddMenuItem(new MenuListItem("Horns", grips, 0));
355 | tackMenu.AddMenuItem(new MenuListItem("Saddlebags", bags, 0));
356 | tackMenu.AddMenuItem(new MenuListItem("Reins", reins, 0));
357 | tackMenu.AddMenuItem(new MenuListItem("Tails", tails, 0));
358 | tackMenu.AddMenuItem(new MenuListItem("Manes", manes, 0));
359 | tackMenu.AddMenuItem(new MenuListItem("Saddles", saddles, 0));
360 | tackMenu.AddMenuItem(new MenuListItem("Masks", masks, 0));
361 | tackMenu.AddMenuItem(new MenuListItem("Stirrups", stirrups, 0));
362 | tackMenu.AddMenuItem(new MenuListItem("Bedrolls", rolls, 0));
363 | tackMenu.AddMenuItem(new MenuListItem("Lanterns", lanterns, 0));
364 |
365 | tackMenu.OnListIndexChange += (m, item, oldIndex, newIndex, itemIndex) =>
366 | {
367 | uint hash;
368 | switch (itemIndex)
369 | {
370 | case 0: hash = data.MountData.BlanketHashes[newIndex]; break;
371 | case 1: hash = data.MountData.GripHashes[newIndex]; break;
372 | case 2: hash = data.MountData.BagHashes[newIndex]; break;
373 | case 3: hash = data.MountData.ReinsHashes[newIndex]; break;
374 | case 4: hash = data.MountData.TailHashes[newIndex]; break;
375 | case 5: hash = data.MountData.ManeHashes[newIndex]; break;
376 | case 6: hash = data.MountData.SaddleHashes[newIndex]; break;
377 | case 7: hash = data.MountData.MaskHashes[newIndex]; break;
378 | case 8: hash = data.MountData.StirrupHashes[newIndex]; break;
379 | case 9: hash = data.MountData.RollHashes[newIndex]; break;
380 | case 10: hash = data.MountData.LanternHashes[newIndex]; break;
381 | default: hash = 0; break;
382 | }
383 | if (hash != 0)
384 | {
385 | Function.Call((Hash)0xD3A7B003ED343FD9, GetTargetMount(PlayerPedId()), hash, true, true, false);
386 | currentMountComponents[itemIndex] = hash;
387 | }
388 | };
389 |
390 | tackMenu.OnListItemSelect += (m, item, selectedIndex, itemIndex) =>
391 | {
392 | uint hash;
393 | switch (itemIndex)
394 | {
395 | case 0: hash = 0x17CEB41A; break;
396 | case 1: hash = 0x5447332; break;
397 | case 2: hash = 0x80451C25; break;
398 | case 3: hash = 0x94B2E3AF; break;
399 | case 4: hash = 0xA63CAE10; break;
400 | case 5: hash = 0xAA0217AB; break;
401 | case 6: hash = 0xBAA7E618; break;
402 | case 7: hash = 0xD3500E5D; break;
403 | case 8: hash = 0xDA6DADCA; break;
404 | case 9: hash = 0xEFB31921; break;
405 | case 10: hash = 0x1530BE1C; break;
406 | default: hash = 0; break;
407 | }
408 | if (hash != 0)
409 | {
410 | Function.Call((Hash)0xD710A5007C2AC539, GetTargetMount(PlayerPedId()), hash, 0);
411 | Function.Call((Hash)0xCC8CA3E88256E58F, GetTargetMount(PlayerPedId()), false, true, true, true, false);
412 | currentMountComponents[itemIndex] = hash;
413 | }
414 | };
415 | }
416 |
417 | if (PermissionsManager.IsAllowed(Permission.MMRestoreInnerCores))
418 | {
419 | menu.AddMenuItem(restoreInnerCores);
420 | }
421 |
422 | if (PermissionsManager.IsAllowed(Permission.MMRestoreOuterCores))
423 | {
424 | menu.AddMenuItem(restoreOuterCores);
425 | }
426 |
427 | if (PermissionsManager.IsAllowed(Permission.MMFortifyCores))
428 | {
429 | menu.AddMenuItem(fortifyCores);
430 | }
431 |
432 | if (PermissionsManager.IsAllowed(Permission.MMGodMode))
433 | {
434 | menu.AddMenuItem(godMode);
435 | }
436 |
437 | if (PermissionsManager.IsAllowed(Permission.MMInfiniteStamina))
438 | {
439 | menu.AddMenuItem(infiniteStamina);
440 | }
441 |
442 | if (PermissionsManager.IsAllowed(Permission.MMClean))
443 | {
444 | menu.AddMenuItem(cleanMount);
445 | }
446 |
447 | if (PermissionsManager.IsAllowed(Permission.MMDelete))
448 | {
449 | menu.AddMenuItem(deleteMount);
450 | }
451 |
452 | menu.OnItemSelect += (m, item, index) =>
453 | {
454 | if (item == cleanMount)
455 | {
456 | int ped = GetTargetMount(PlayerPedId());
457 | ClearPedEnvDirt(ped);
458 | ClearPedDamageDecalByZone(ped, 10, "ALL");
459 | ClearPedBloodDamage(ped);
460 | }
461 | else if (item == deleteMount)
462 | {
463 | int mount = GetMount(PlayerPedId());
464 |
465 | if (mount != 0)
466 | {
467 | DeleteEntity(ref mount);
468 | }
469 | }
470 | else if (item == randomMount)
471 | {
472 | int r = rng.Next(data.MountData.MountHashes.Count);
473 | uint model = (uint)GetHashKey(data.MountData.MountHashes[r]);
474 | SpawnMount(model);
475 | }
476 | else if (item == randomTack)
477 | {
478 | int rBlanket = rng.Next(data.MountData.BlanketHashes.Count);
479 | int rGrip = rng.Next(data.MountData.GripHashes.Count);
480 | int rBag = rng.Next(data.MountData.BagHashes.Count);
481 | int rSaddle = rng.Next(data.MountData.SaddleHashes.Count);
482 | int rStirrup = rng.Next(data.MountData.StirrupHashes.Count);
483 | int rRoll = rng.Next(data.MountData.RollHashes.Count);
484 |
485 | int mount = GetTargetMount(PlayerPedId());
486 |
487 | uint hBlanket = data.MountData.BlanketHashes[rBlanket];
488 | uint hGrip = data.MountData.GripHashes[rGrip];
489 | uint hBag = data.MountData.BagHashes[rBag];
490 | uint hSaddle = data.MountData.SaddleHashes[rSaddle];
491 | uint hStirrup = data.MountData.StirrupHashes[rStirrup];
492 | uint hRoll = data.MountData.RollHashes[rRoll];
493 |
494 | Function.Call((Hash)0xD3A7B003ED343FD9, mount, hBlanket, true, true, false);
495 | Function.Call((Hash)0xD3A7B003ED343FD9, mount, hGrip, true, true, false);
496 | Function.Call((Hash)0xD3A7B003ED343FD9, mount, hBag, true, true, false);
497 | Function.Call((Hash)0xD3A7B003ED343FD9, mount, hSaddle, true, true, false);
498 | Function.Call((Hash)0xD3A7B003ED343FD9, mount, hStirrup, true, true, false);
499 | Function.Call((Hash)0xD3A7B003ED343FD9, mount, hRoll, true, true, false);
500 |
501 | currentMountComponents[0] = hBlanket;
502 | currentMountComponents[1] = hGrip;
503 | currentMountComponents[2] = hBag;
504 | currentMountComponents[5] = hSaddle;
505 | currentMountComponents[6] = hStirrup;
506 | currentMountComponents[7] = hRoll;
507 | }
508 | };
509 |
510 | menu.OnListItemSelect += (m, item, listIndex, itemIndex) =>
511 | {
512 | if (item == mountPeds)
513 | {
514 | uint model = (uint)GetHashKey(data.MountData.MountHashes[listIndex]);
515 | SpawnMount(model);
516 | }
517 | else if (item == sex)
518 | {
519 | SetMountSex(GetTargetMount(PlayerPedId()), listIndex);
520 | }
521 | else if (item == restoreInnerCores)
522 | {
523 | switch (listIndex)
524 | {
525 | case 0:
526 | Function.Call((Hash)0xC6258F41D86676E0, GetTargetMount(PlayerPedId()), 0, 100);
527 | Function.Call((Hash)0xC6258F41D86676E0, GetTargetMount(PlayerPedId()), 1, 100);
528 | break;
529 | case 1:
530 | Function.Call((Hash)0xC6258F41D86676E0, GetTargetMount(PlayerPedId()), 0, 100);
531 | break;
532 | case 2:
533 | Function.Call((Hash)0xC6258F41D86676E0, GetTargetMount(PlayerPedId()), 1, 100);
534 | break;
535 | default:
536 | break;
537 | }
538 | }
539 | else if (item == restoreOuterCores)
540 | {
541 | int mount = GetTargetMount(PlayerPedId());
542 |
543 | switch (listIndex)
544 | {
545 | case 0: // all
546 | Function.Call((Hash)0xAC2767ED8BDFAB15, mount, 100.0, 0);
547 | Function.Call((Hash)0x675680D089BFA21F, mount, 100.0f);
548 | break;
549 | case 1: // health
550 | Function.Call((Hash)0xAC2767ED8BDFAB15, mount, 100.0, 0);
551 | break;
552 | case 2: // stamina
553 | Function.Call((Hash)0x675680D089BFA21F, mount, 100.0f);
554 | break;
555 | default: // invalid index
556 | break;
557 | }
558 | }
559 | else if (item == fortifyCores)
560 | {
561 | switch (listIndex)
562 | {
563 | case 0:
564 | Function.Call((Hash)0x4AF5A4C7B9157D14, GetTargetMount(PlayerPedId()), 0, 100.0f, true);
565 | Function.Call((Hash)0x4AF5A4C7B9157D14, GetTargetMount(PlayerPedId()), 1, 100.0f, true);
566 | break;
567 | case 1:
568 | Function.Call((Hash)0x4AF5A4C7B9157D14, GetTargetMount(PlayerPedId()), 0, 100.0f, true);
569 | break;
570 | case 2:
571 | Function.Call((Hash)0x4AF5A4C7B9157D14, GetTargetMount(PlayerPedId()), 1, 100.0f, true);
572 | break;
573 | default:
574 | break;
575 | }
576 | }
577 | };
578 |
579 | menu.OnListIndexChange += (m, listItem, oldIndex, newIndex, itemIndex) =>
580 | {
581 | if (listItem == sex)
582 | {
583 | SetMountSex(GetTargetMount(PlayerPedId()), newIndex);
584 | }
585 | };
586 |
587 | menu.OnCheckboxChange += (m, item, index, _checked) =>
588 | {
589 | if (item == godMode)
590 | {
591 | UserDefaults.MountGodMode = _checked;
592 | SetEntityInvincible(currentMount, _checked);
593 | }
594 | else if (item == infiniteStamina)
595 | {
596 | UserDefaults.MountInfiniteStamina = _checked;
597 | }
598 | };
599 | }
600 |
601 | public static Menu GetMenu()
602 | {
603 | SetupMenu();
604 | return menu;
605 | }
606 | }
607 | }
608 |
--------------------------------------------------------------------------------
/RedMenu/RedMenuClient/menus/OnlinePlayersMenu.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using MenuAPI;
7 | using CitizenFX.Core;
8 | using static CitizenFX.Core.Native.API;
9 | using CitizenFX.Core.Native;
10 | using RedMenuShared;
11 | using RedMenuClient.util;
12 | using System.Net;
13 | using RedMenuClient.data;
14 |
15 | namespace RedMenuClient.menus
16 | {
17 | class OnlinePlayersMenu
18 | {
19 | private static Menu menu = new Menu("Online Players", "Players in the server");
20 | private static bool setupDone = false;
21 | private static List players = new List();
22 |
23 | private static int GetTeleportTarget()
24 | {
25 | int ped = PlayerPedId();
26 | int veh = GetVehiclePedIsIn(ped, false);
27 | int mnt = GetMount(ped);
28 |
29 | if (veh != 0)
30 | {
31 | return veh;
32 | }
33 | else if (mnt != 0)
34 | {
35 | return mnt;
36 | }
37 | else
38 | {
39 | return ped;
40 | }
41 | }
42 |
43 | private static void DoOnItemSelect(Menu m, MenuItem item, int index)
44 | {
45 | int ped = GetTeleportTarget();
46 | int target = GetPlayerPed(players[index]);
47 | Vector3 coords = GetEntityCoords(target, true, true);
48 | float h = GetEntityHeading(target);
49 | FreezeEntityPosition(ped, true);
50 | SetEntityCoords(ped, coords.X, coords.Y, coords.Z, false, false, false, false);
51 | SetEntityHeading(ped, h);
52 | FreezeEntityPosition(ped, false);
53 | }
54 |
55 | private static void SetupMenu()
56 | {
57 | if (setupDone) return;
58 | setupDone = true;
59 |
60 | players.Clear();
61 | var p = API.GetActivePlayers();
62 |
63 | foreach (var player in p)
64 | {
65 | int id = GetPlayerServerId(player);
66 | string name = GetPlayerName(player);
67 | MenuItem item = new MenuItem(id.ToString() + ": " + name);
68 | menu.AddMenuItem(item);
69 | players.Add(player);
70 | }
71 |
72 | menu.OnItemSelect += DoOnItemSelect;
73 | menu.OnMenuOpen += UpdatePlayerlist;
74 | }
75 | public static Menu GetMenu()
76 | {
77 | SetupMenu();
78 | return menu;
79 | }
80 |
81 | public static void UpdatePlayerlist(Menu m)
82 | {
83 | menu.ClearMenuItems();
84 | menu.OnItemSelect -= DoOnItemSelect;
85 | menu.OnMenuOpen -= UpdatePlayerlist;
86 | setupDone = false;
87 | SetupMenu();
88 | }
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/RedMenu/RedMenuClient/menus/ServerInfoMenu.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using MenuAPI;
7 | using CitizenFX.Core;
8 | using static CitizenFX.Core.Native.API;
9 | using CitizenFX.Core.Native;
10 | using RedMenuShared;
11 | using RedMenuClient.util;
12 |
13 | namespace RedMenuClient.menus
14 | {
15 | class ServerInfoMenu
16 | {
17 | private static Menu menu = new Menu("Server Info", $"{ConfigManager.ServerInfoSubtitle}");
18 | private static bool setupDone = false;
19 |
20 | private static void SetupMenu()
21 | {
22 | if (setupDone) return;
23 | setupDone = true;
24 |
25 | MenuItem item = new MenuItem("Soon.", "This menu is coming soon. Server owners can configure the information displayed here.")
26 | {
27 | Enabled = false,
28 | LeftIcon = MenuItem.Icon.LOCK
29 | };
30 |
31 | menu.AddMenuItem(item);
32 | }
33 |
34 | public static Menu GetMenu()
35 | {
36 | SetupMenu();
37 | return menu;
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/RedMenu/RedMenuClient/menus/TeleportMenu.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using MenuAPI;
7 | using CitizenFX.Core;
8 | using static CitizenFX.Core.Native.API;
9 | using CitizenFX.Core.Native;
10 | using RedMenuShared;
11 | using RedMenuClient.util;
12 | using System.Net;
13 | using RedMenuClient.data;
14 |
15 | namespace RedMenuClient.menus
16 | {
17 | class TeleportMenu
18 | {
19 | private static Menu menu = new Menu("Teleport Menu", "Teleport options.");
20 | private static Menu locationsMenu = new Menu("Locations", "A list of locations to teleport to.");
21 | private static bool setupDone = false;
22 |
23 | private static int GetTeleportTarget()
24 | {
25 | int ped = PlayerPedId();
26 | int veh = GetVehiclePedIsIn(ped, false);
27 | int mnt = GetMount(ped);
28 |
29 | if (veh != 0)
30 | {
31 | return veh;
32 | }
33 | else if (mnt != 0)
34 | {
35 | return mnt;
36 | }
37 | else
38 | {
39 | return ped;
40 | }
41 | }
42 |
43 | private static void SetupMenu()
44 | {
45 | if (setupDone) return;
46 | setupDone = true;
47 |
48 | MenuItem teleportToWaypoint = new MenuItem("Teleport to Waypoint", "Teleport to the currently set waypoint.");
49 |
50 | if (PermissionsManager.IsAllowed(Permission.TMTeleportToWaypoint))
51 | {
52 | menu.AddMenuItem(teleportToWaypoint);
53 | }
54 |
55 | if (PermissionsManager.IsAllowed(Permission.TMLocations))
56 | {
57 | MenuItem locations = new MenuItem("Locations", "A list of locations to teleport to.") { RightIcon = MenuItem.Icon.ARROW_RIGHT };
58 | MenuController.AddSubmenu(menu, locationsMenu);
59 | menu.AddMenuItem(locations);
60 | MenuController.BindMenuItem(menu, locationsMenu, locations);
61 |
62 | foreach (var location in data.TeleportData.TeleportLocations)
63 | {
64 | MenuItem item = new MenuItem(location.Name);
65 | locationsMenu.AddMenuItem(item);
66 | }
67 |
68 | locationsMenu.OnItemSelect += (m, item, index) =>
69 | {
70 | TeleportLocation loc = data.TeleportData.TeleportLocations[index];
71 | int ped = GetTeleportTarget();
72 | FreezeEntityPosition(ped, true);
73 | SetEntityCoords(ped, loc.X, loc.Y, loc.Z, false, false, false, false);
74 | SetEntityHeading(ped, loc.H);
75 | FreezeEntityPosition(ped, false);
76 | };
77 | }
78 |
79 | menu.OnItemSelect += (m, item, index) =>
80 | {
81 | if (item == teleportToWaypoint)
82 | {
83 | if (IsWaypointActive())
84 | {
85 | int ped = GetTeleportTarget();
86 | FreezeEntityPosition(ped, true);
87 | Vector3 waypoint = GetWaypointCoords();
88 | SetEntityCoords(ped, waypoint.X, waypoint.Y, 1000.0f, false, false, false, false);
89 | Vector3 coords = GetEntityCoords(ped, false, false);
90 | float groundz = GetHeightmapBottomZForPosition(coords.X, coords.Y);
91 | SetEntityInvincible(ped, true);
92 | SetEntityCoords(ped, coords.X, coords.Y, groundz + 10.0f, false, false, false, false);
93 | FreezeEntityPosition(ped, false);
94 | Wait(3000);
95 |
96 | if (PermissionsManager.IsAllowed(Permission.PMGodMode) && UserDefaults.PlayerGodMode)
97 | {
98 | SetEntityInvincible(ped, true);
99 | }
100 | else
101 | {
102 | SetEntityInvincible(ped, false);
103 | }
104 | }
105 | }
106 | };
107 | }
108 | public static Menu GetMenu()
109 | {
110 | SetupMenu();
111 | return menu;
112 | }
113 | }
114 | }
115 |
--------------------------------------------------------------------------------
/RedMenu/RedMenuClient/menus/VehicleMenu.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using MenuAPI;
7 | using CitizenFX.Core;
8 | using static CitizenFX.Core.Native.API;
9 | using CitizenFX.Core.Native;
10 | using RedMenuShared;
11 | using RedMenuClient.util;
12 | using System.Net;
13 | using RedMenuClient.data;
14 |
15 | namespace RedMenuClient.menus
16 | {
17 | class VehicleDistance
18 | {
19 | public int vehicle;
20 | public float distance;
21 |
22 | public VehicleDistance(int vehicle)
23 | {
24 | this.vehicle = vehicle;
25 |
26 | Vector3 pCoords = GetEntityCoords(PlayerPedId(), true, true);
27 | Vector3 vCoords = GetEntityCoords(vehicle, true, true);
28 | distance = GetDistanceBetweenCoords(pCoords.X, pCoords.Y, pCoords.Z, vCoords.X, vCoords.Y, vCoords.Z, true);
29 | }
30 | }
31 | class VehicleMenu
32 | {
33 | private static Menu menu = new Menu("Vehicle Menu", "Vehicle related options.");
34 | private static bool setupDone = false;
35 | private static int currentVehicle = 0;
36 |
37 | private static int BlipAddForEntity(int blipHash, int entity)
38 | {
39 | return Function.Call((Hash)0x23F74C2FDA6E7C61, blipHash, entity);
40 | }
41 |
42 | private static void FixHotAirBalloon(int veh)
43 | {
44 | SetVehicleAsNoLongerNeeded(ref veh);
45 | }
46 |
47 | private static void AddVehicleSubmenu(Menu menu, List hashes, string name, string description)
48 | {
49 | Menu submenu = new Menu(name, description);
50 | MenuItem submenuBtn = new MenuItem(name, description) { RightIcon = MenuItem.Icon.ARROW_RIGHT };
51 | menu.AddMenuItem(submenuBtn);
52 | MenuController.AddSubmenu(menu, submenu);
53 | MenuController.BindMenuItem(menu, submenu, submenuBtn);
54 |
55 | foreach (var hash in hashes)
56 | {
57 | submenu.AddMenuItem(new MenuItem(hash));
58 | }
59 |
60 | submenu.OnItemSelect += async (m, item, index) =>
61 | {
62 | if (currentVehicle != 0)
63 | {
64 | DeleteVehicle(ref currentVehicle);
65 | currentVehicle = 0;
66 | }
67 |
68 | uint model = (uint)GetHashKey(hashes[index]);
69 |
70 | int ped = PlayerPedId();
71 | Vector3 coords = GetEntityCoords(ped, false, false);
72 | float h = GetEntityHeading(ped);
73 |
74 | // Get a point in front of the player
75 | float r = -h * (float)(Math.PI / 180);
76 | float x2 = coords.X + (float)(5 * Math.Sin(r));
77 | float y2 = coords.Y + (float)(5 * Math.Cos(r));
78 |
79 | if (IsModelInCdimage(model))
80 | {
81 | RequestModel(model, false);
82 | while (!HasModelLoaded(model))
83 | {
84 | await BaseScript.Delay(0);
85 | }
86 |
87 | currentVehicle = CreateVehicle(model, x2, y2, coords.Z, h, true, true, false, true);
88 | SetModelAsNoLongerNeeded(model);
89 | SetVehicleOnGroundProperly(currentVehicle, 0);
90 | SetEntityVisible(currentVehicle, true);
91 | BlipAddForEntity(631964804, currentVehicle);
92 |
93 | if (UserDefaults.VehicleSpawnInside)
94 | {
95 | TaskWarpPedIntoVehicle(ped, currentVehicle, -1);
96 | }
97 |
98 | // If this isn't done, the hot air balloon won't move with the wind for some reason
99 | if (hashes[index] == "hotairballoon01")
100 | {
101 | FixHotAirBalloon(currentVehicle);
102 | }
103 | }
104 | else
105 | {
106 | Debug.WriteLine($"^1[ERROR] This vehicle model is not present in the game files {model}.^7");
107 | }
108 | };
109 | }
110 |
111 | private static int GetNearestVehicle()
112 | {
113 | List vehicles = new List();
114 | int veh = 0;
115 | int handle = FindFirstVehicle(ref veh);
116 | vehicles.Add(new VehicleDistance(veh));
117 | while (FindNextVehicle(handle, ref veh))
118 | {
119 | vehicles.Add(new VehicleDistance(veh));
120 | }
121 | return vehicles.OrderBy(v => v.distance).First().vehicle;
122 | }
123 |
124 | private static void SetVehicleTint(int vehicle, int tint)
125 | {
126 | Function.Call((Hash)0x8268B098F6FCA4E2, vehicle, tint);
127 | }
128 |
129 | public static void SetupMenu()
130 | {
131 | if (setupDone) return;
132 | setupDone = true;
133 |
134 | MenuCheckboxItem spawnInside = new MenuCheckboxItem("Spawn Inside Vehicle", "Automatically spawn inside vehicles.", UserDefaults.VehicleSpawnInside);
135 | MenuItem repairVehicle = new MenuItem("Repair Vehicle", "Repair the vehicle you are currently in.");
136 | MenuItem teleport = new MenuItem("Teleport Into Vehicle", "Teleport into the closest vehicle with an open seat.");
137 | MenuListItem engineOnOff = new MenuListItem("Engine", new List() { "On", "Off" }, 0, "Set vehicle engine on/off.");
138 | MenuListItem lightsOnOff = new MenuListItem("Lights", new List() { "On", "Off" }, 0, "Set vehicle lights on/off.");
139 | MenuItem deleteVehicle = new MenuItem("Delete Vehicle", "Delete the vehicle you are currently in.");
140 |
141 | MenuDynamicListItem vehicleTint = new MenuDynamicListItem("Vehicle Tint", "0", new MenuDynamicListItem.ChangeItemCallback((item, left) =>
142 | {
143 | if (int.TryParse(item.CurrentItem, out int val))
144 | {
145 | int newVal = val;
146 | if (left)
147 | {
148 | newVal--;
149 | if (newVal < 0)
150 | {
151 | newVal = 0;
152 | }
153 | }
154 | else
155 | {
156 | newVal++;
157 | }
158 | SetVehicleTint(GetVehiclePedIsIn(PlayerPedId(), false), newVal);
159 | return newVal.ToString();
160 | }
161 | return "0";
162 | }), "Select a predefined tint for the vehicle you are currently in.");
163 |
164 | if (PermissionsManager.IsAllowed(Permission.VMSpawn))
165 | {
166 | Menu spawnVehicleMenu = new Menu("Spawn Vehicle", "Spawn a vehicle.");
167 | MenuItem spawnVehicle = new MenuItem("Spawn Vehicle", "Spawn a vehicle.") { RightIcon = MenuItem.Icon.ARROW_RIGHT };
168 | menu.AddMenuItem(spawnVehicle);
169 | MenuController.AddSubmenu(menu, spawnVehicleMenu);
170 | MenuController.BindMenuItem(menu, spawnVehicleMenu, spawnVehicle);
171 |
172 | AddVehicleSubmenu(spawnVehicleMenu, data.VehicleData.BuggyHashes, "Buggies", "Spawn a buggy.");
173 | AddVehicleSubmenu(spawnVehicleMenu, data.VehicleData.BoatHashes, "Boats", "Spawn a boat.");
174 | AddVehicleSubmenu(spawnVehicleMenu, data.VehicleData.CartHashes, "Carts", "Spawn a cart.");
175 | AddVehicleSubmenu(spawnVehicleMenu, data.VehicleData.CoachHashes, "Coaches", "Spawn a coach.");
176 | AddVehicleSubmenu(spawnVehicleMenu, data.VehicleData.WagonHashes, "Wagons", "Spawn a wagon.");
177 | AddVehicleSubmenu(spawnVehicleMenu, data.VehicleData.MiscHashes, "Misc", "Spawn a miscellaneous vehicle.");
178 | }
179 |
180 | if (PermissionsManager.IsAllowed(Permission.VMSelectTint))
181 | {
182 | menu.AddMenuItem(vehicleTint);
183 | }
184 |
185 | if (PermissionsManager.IsAllowed(Permission.VMSpawnInside))
186 | {
187 | menu.AddMenuItem(spawnInside);
188 | }
189 |
190 | if (PermissionsManager.IsAllowed(Permission.VMRepair))
191 | {
192 | menu.AddMenuItem(repairVehicle);
193 | }
194 |
195 | if (PermissionsManager.IsAllowed(Permission.VMTeleport))
196 | {
197 | menu.AddMenuItem(teleport);
198 | }
199 |
200 | if (PermissionsManager.IsAllowed(Permission.VMEngineOnOff))
201 | {
202 | menu.AddMenuItem(engineOnOff);
203 | }
204 |
205 | if (PermissionsManager.IsAllowed(Permission.VMLightsOnOff))
206 | {
207 | menu.AddMenuItem(lightsOnOff);
208 | }
209 |
210 | if (PermissionsManager.IsAllowed(Permission.VMDoors))
211 | {
212 | Menu doorsMenu = new Menu("Doors", "Open/Close vehicle doors.");
213 | MenuItem doors = new MenuItem("Doors", "Open/Close vehicle doors.") { RightIcon = MenuItem.Icon.ARROW_RIGHT };
214 | menu.AddMenuItem(doors);
215 | MenuController.AddSubmenu(menu, doorsMenu);
216 | MenuController.BindMenuItem(menu, doorsMenu, doors);
217 |
218 | MenuListItem all = new MenuListItem("All", new List() { "Open", "Close" }, 0);
219 | MenuListItem frontL = new MenuListItem("Front Left", new List() { "Open", "Close" }, 0);
220 | MenuListItem frontR = new MenuListItem("Front Right", new List() { "Open", "Close" }, 0);
221 | MenuListItem backL = new MenuListItem("Back Left", new List() { "Open", "Close" }, 0);
222 | MenuListItem backR = new MenuListItem("Back Right", new List() { "Open", "Close" }, 0);
223 | MenuListItem hood = new MenuListItem("Hood", new List() { "Open", "Close" }, 0);
224 | MenuListItem trunk = new MenuListItem("Trunk", new List() { "Open", "Close" }, 0);
225 | MenuListItem back1 = new MenuListItem("Back 1", new List() { "Open", "Close" }, 0);
226 | MenuListItem back2 = new MenuListItem("Back 2", new List() { "Open", "Close" }, 0);
227 |
228 | doorsMenu.AddMenuItem(all);
229 | doorsMenu.AddMenuItem(frontL);
230 | doorsMenu.AddMenuItem(frontR);
231 | doorsMenu.AddMenuItem(backL);
232 | doorsMenu.AddMenuItem(backR);
233 | doorsMenu.AddMenuItem(hood);
234 | doorsMenu.AddMenuItem(trunk);
235 | doorsMenu.AddMenuItem(back1);
236 | doorsMenu.AddMenuItem(back2);
237 |
238 | doorsMenu.OnListItemSelect += (m, listItem, selectedIndex, itemIndex) =>
239 | {
240 | int doorIndex;
241 |
242 | if (listItem == frontL)
243 | {
244 | doorIndex = 0;
245 | }
246 | else if (listItem == frontR)
247 | {
248 | doorIndex = 1;
249 | }
250 | else if (listItem == backL)
251 | {
252 | doorIndex = 2;
253 | }
254 | else if (listItem == backR)
255 | {
256 | doorIndex = 3;
257 | }
258 | else if (listItem == hood)
259 | {
260 | doorIndex = 4;
261 | }
262 | else if (listItem == trunk)
263 | {
264 | doorIndex = 5;
265 | }
266 | else if (listItem == back1)
267 | {
268 | doorIndex = 6;
269 | }
270 | else if (listItem == back2)
271 | {
272 | doorIndex = 7;
273 | }
274 | else
275 | {
276 | doorIndex = -1;
277 | }
278 |
279 | string selected = listItem.GetCurrentSelection();
280 |
281 | int veh = GetVehiclePedIsIn(PlayerPedId(), false);
282 |
283 | if (selected == "Open")
284 | {
285 | if (doorIndex == -1)
286 | {
287 | for (int i = 0; i < 8; ++i)
288 | {
289 | SetVehicleDoorOpen(veh, i, false, false);
290 | }
291 | }
292 | else
293 | {
294 | SetVehicleDoorOpen(veh, doorIndex, false, false);
295 | }
296 | }
297 | else
298 | {
299 | if (doorIndex == -1)
300 | {
301 | SetVehicleDoorsShut(veh, false);
302 | }
303 | else
304 | {
305 | SetVehicleDoorShut(veh, doorIndex, false);
306 | }
307 | }
308 | };
309 | }
310 |
311 | if (PermissionsManager.IsAllowed(Permission.VMDelete))
312 | {
313 | menu.AddMenuItem(deleteVehicle);
314 | }
315 |
316 | menu.OnItemSelect += (m, item, index) =>
317 | {
318 | if (item == repairVehicle)
319 | {
320 | int veh = GetVehiclePedIsIn(PlayerPedId(), true);
321 |
322 | if (veh != 0)
323 | {
324 | SetVehicleFixed(veh);
325 | }
326 | }
327 | else if (item == teleport)
328 | {
329 | int veh = GetNearestVehicle();
330 |
331 | if (veh != 0)
332 | {
333 | NetworkRequestControlOfEntity(veh);
334 | TaskWarpPedIntoVehicle(PlayerPedId(), veh, -1);
335 | }
336 | }
337 | else if (item == deleteVehicle)
338 | {
339 | int veh = GetVehiclePedIsIn(PlayerPedId(), true);
340 |
341 | if (veh != 0)
342 | {
343 | DeleteEntity(ref veh);
344 | }
345 | }
346 | };
347 |
348 | menu.OnCheckboxChange += (m, item, index, _checked) =>
349 | {
350 | if (item == spawnInside)
351 | {
352 | UserDefaults.VehicleSpawnInside = _checked;
353 | }
354 | };
355 |
356 | menu.OnListItemSelect += (m, item, listIndex, itemIndex) =>
357 | {
358 | if (item == engineOnOff)
359 | {
360 | switch (listIndex)
361 | {
362 | case 0: // on
363 | SetVehicleEngineOn(GetVehiclePedIsIn(PlayerPedId(), false), 1, 0);
364 | break;
365 | case 1: // off
366 | SetVehicleEngineOn(GetVehiclePedIsIn(PlayerPedId(), false), 0, 0);
367 | break;
368 | default:
369 | break;
370 | }
371 | }
372 | else if (item == lightsOnOff)
373 | {
374 | switch (listIndex)
375 | {
376 | case 0: // on
377 | SetVehicleLights(GetVehiclePedIsIn(PlayerPedId(), true), 0);
378 | break;
379 | case 1: // off
380 | SetVehicleLights(GetVehiclePedIsIn(PlayerPedId(), true), 1);
381 | break;
382 | default:
383 | break;
384 | }
385 | }
386 | };
387 | }
388 |
389 | public static Menu GetMenu()
390 | {
391 | SetupMenu();
392 | return menu;
393 | }
394 | }
395 | }
396 |
--------------------------------------------------------------------------------
/RedMenu/RedMenuClient/menus/VoiceMenu.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using MenuAPI;
7 | using CitizenFX.Core;
8 | using static CitizenFX.Core.Native.API;
9 | using CitizenFX.Core.Native;
10 | using RedMenuShared;
11 | using RedMenuClient.util;
12 | using System.Net;
13 | using RedMenuClient.data;
14 |
15 | namespace RedMenuClient.menus
16 | {
17 | class VoiceMenu
18 | {
19 | private static Menu menu = new Menu("Voice Menu", "Voice related options");
20 | private static bool setupDone = false;
21 |
22 | private static void SetVoiceRange(float range)
23 | {
24 | Function.Call((Hash)0x08797A8C03868CB8, range);
25 | Function.Call((Hash)0xEC8703E4536A9952);
26 | Function.Call((Hash)0x58125B691F6827D5, range);
27 | }
28 |
29 | public static void SetupMenu()
30 | {
31 | if (setupDone) return;
32 | setupDone = true;
33 |
34 | List proximityRange = new List()
35 | {
36 | 5f,
37 | 10f,
38 | 15f,
39 | 20f,
40 | 100f,
41 | 300f,
42 | 1000f,
43 | 2000f,
44 | 0f
45 | };
46 |
47 | List proximity = new List()
48 | {
49 | "5 m",
50 | "10 m",
51 | "15 m",
52 | "20 m",
53 | "100 m",
54 | "300 m",
55 | "1 km",
56 | "2 km",
57 | "Global"
58 | };
59 |
60 | MenuListItem range = new MenuListItem("Range", proximity, proximityRange.IndexOf(UserDefaults.VoiceRange), "Set the range of voice chat.");
61 |
62 | if (PermissionsManager.IsAllowed(Permission.VORange))
63 | {
64 | menu.AddMenuItem(range);
65 | SetVoiceRange(UserDefaults.VoiceRange);
66 | }
67 |
68 | menu.OnListIndexChange += (m, listItem, oldIndex, newIndex, itemIndex) =>
69 | {
70 | if (listItem == range)
71 | {
72 | float r = proximityRange[range.ListIndex];
73 | SetVoiceRange(r);
74 | UserDefaults.VoiceRange = r;
75 | }
76 | };
77 | }
78 |
79 | public static Menu GetMenu()
80 | {
81 | SetupMenu();
82 | return menu;
83 | }
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/RedMenu/RedMenuClient/menus/WorldMenu.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using MenuAPI;
7 | using CitizenFX.Core;
8 | using static CitizenFX.Core.Native.API;
9 | using CitizenFX.Core.Native;
10 | using RedMenuShared;
11 | using RedMenuClient.util;
12 | using System.Net;
13 | using RedMenuClient.data;
14 |
15 | namespace RedMenuClient.menus
16 | {
17 | class WorldMenu : BaseScript
18 | {
19 | private static Menu menu = new Menu("World Menu", "World related options");
20 | private static bool setupDone = false;
21 |
22 | private static void NetworkOverrideClockTime(int hour, int minute, int second, int transitionTime, bool freezeTime)
23 | {
24 | Function.Call((Hash)0x669E223E64B1903C, hour, minute, second, transitionTime, freezeTime);
25 | }
26 |
27 | private static void SetWeatherType(int weatherHash, bool p1, bool p2, bool p3, float p4, bool p5)
28 | {
29 | Function.Call((Hash)0x59174F1AFE095B5A, weatherHash, p1, p2, p3, p4, p5);
30 | }
31 |
32 | private static void SetSnowCoverageType(int type)
33 | {
34 | Function.Call((Hash)0xF02A9C330BBFC5C7, type);
35 | }
36 |
37 | public static void SetupMenu()
38 | {
39 | if (setupDone) return;
40 | setupDone = true;
41 |
42 | if (PermissionsManager.IsAllowed(Permission.WOTime))
43 | {
44 | Menu timeOptionsMenu = new Menu("Time Options", "Set the current time");
45 | MenuItem timeOptions = new MenuItem("Time Options", "Set the current time.") { RightIcon = MenuItem.Icon.ARROW_RIGHT };
46 |
47 | menu.AddMenuItem(timeOptions);
48 | MenuController.AddSubmenu(menu, timeOptionsMenu);
49 | MenuController.BindMenuItem(menu, timeOptionsMenu, timeOptions);
50 |
51 | List hourRange = new List();
52 | for (int i = 0; i <= 23; ++i)
53 | {
54 | hourRange.Add(i.ToString());
55 | }
56 |
57 | List minuteSecondRange = new List();
58 | for (int i = 0; i <= 59; ++i)
59 | {
60 | minuteSecondRange.Add(i.ToString());
61 | }
62 |
63 | MenuListItem hour = new MenuListItem("Hour", hourRange, 0, "The hour to set.");
64 | MenuListItem minute = new MenuListItem("Minute", minuteSecondRange, 0, "The minute to set.");
65 | MenuListItem second = new MenuListItem("Second", minuteSecondRange, 0, "The second to set.");
66 | MenuListItem transition = new MenuListItem("Transition", new List() { "0", "1000", "5000", "10000", "30000" }, 1, "Transition time in milliseconds.");
67 | MenuCheckboxItem freeze = new MenuCheckboxItem("Freeze", "Whether to freeze time.");
68 | MenuItem apply = new MenuItem("Apply", "Apply the selected time settings.");
69 |
70 | timeOptionsMenu.AddMenuItem(hour);
71 | timeOptionsMenu.AddMenuItem(minute);
72 | timeOptionsMenu.AddMenuItem(second);
73 | timeOptionsMenu.AddMenuItem(transition);
74 | timeOptionsMenu.AddMenuItem(freeze);
75 | timeOptionsMenu.AddMenuItem(apply);
76 |
77 | timeOptionsMenu.OnItemSelect += (menu, item, index) =>
78 | {
79 | if (item == apply)
80 | {
81 | TriggerEvent("weatherSync:toggleSync", false);
82 | NetworkOverrideClockTime(hour.ListIndex, minute.ListIndex, second.ListIndex, Int32.Parse(transition.GetCurrentSelection()), freeze.Checked);
83 | }
84 | };
85 | }
86 |
87 | if (PermissionsManager.IsAllowed(Permission.WOWeather))
88 | {
89 | Menu weatherOptionsMenu = new Menu("Weather Options", "Set the current weather");
90 | MenuItem weatherOptions = new MenuItem("Weather Options", "Set the current weather.") { RightIcon = MenuItem.Icon.ARROW_RIGHT };
91 | menu.AddMenuItem(weatherOptions);
92 | MenuController.AddSubmenu(menu, weatherOptionsMenu);
93 | MenuController.BindMenuItem(menu, weatherOptionsMenu, weatherOptions);
94 |
95 | MenuListItem weatherType = new MenuListItem("Weather Type", data.WorldData.WeatherTypes, 0, "The main type of weather.");
96 | MenuListItem transition = new MenuListItem("Transition", new List() { "1.0", "5.0", "10.0", "30.0" }, 0, "Transition time in seconds.");
97 | MenuListItem snowCoverageType = new MenuListItem("Snow Coverage", new List() { "Primary", "Secondary", "Xmas", "XmasSecondary" }, 0, "Type of ground snow coverage.");
98 | MenuItem apply = new MenuItem("Apply", "Apply the selected weather settings.");
99 |
100 | weatherOptionsMenu.AddMenuItem(weatherType);
101 | weatherOptionsMenu.AddMenuItem(transition);
102 | weatherOptionsMenu.AddMenuItem(snowCoverageType);
103 | weatherOptionsMenu.AddMenuItem(apply);
104 |
105 | weatherOptionsMenu.OnItemSelect += (menu, item, index) =>
106 | {
107 | if (item == apply)
108 | {
109 | TriggerEvent("weatherSync:toggleSync", false);
110 | SetWeatherType(GetHashKey(weatherType.GetCurrentSelection()), true, false, true, float.Parse(transition.GetCurrentSelection()), false);
111 | SetSnowCoverageType(snowCoverageType.ListIndex);
112 | }
113 | };
114 | }
115 |
116 | if (PermissionsManager.IsAllowed(Permission.WOTimecycleModifiers))
117 | {
118 | Menu timecycleModifiersMenu = new Menu("Timecycle", "Set/Clear timecycle modifiers");
119 | MenuItem timeCycleModifiers = new MenuItem("Timecycle Modifiers", "Set/Clear timecycle modifiers.") { RightIcon = MenuItem.Icon.ARROW_RIGHT };
120 | menu.AddMenuItem(timeCycleModifiers);
121 | MenuController.AddSubmenu(menu, timecycleModifiersMenu);
122 | MenuController.BindMenuItem(menu, timecycleModifiersMenu, timeCycleModifiers);
123 |
124 | MenuListItem modifier = new MenuListItem("Modifier", data.WorldData.TimecycleModifiers, 0, "Set a timecycle modifier.");
125 | MenuItem clear = new MenuItem("Clear Timecycle Modifier", "Clear the timecycle modifier.");
126 |
127 | timecycleModifiersMenu.AddMenuItem(modifier);
128 | timecycleModifiersMenu.AddMenuItem(clear);
129 |
130 | timecycleModifiersMenu.OnListItemSelect += (menu, listItem, selectedIndex, itemIndex) =>
131 | {
132 | if (listItem == modifier)
133 | {
134 | SetTimecycleModifier(modifier.GetCurrentSelection());
135 | }
136 | };
137 |
138 | timecycleModifiersMenu.OnListIndexChange += (menu, listItem, oldSelectionIndex, newSelectionIndex, itemIndex) =>
139 | {
140 | if (listItem == modifier)
141 | {
142 | SetTimecycleModifier(modifier.GetCurrentSelection());
143 | }
144 | };
145 |
146 | timecycleModifiersMenu.OnItemSelect += (menu, item, index) =>
147 | {
148 | if (item == clear)
149 | {
150 | ClearTimecycleModifier();
151 | }
152 | };
153 | }
154 |
155 | if (PermissionsManager.IsAllowed(Permission.WOAnimpostfx))
156 | {
157 | Menu animpostfxMenu = new Menu("Animpostfx", "Play animated post-effects");
158 | MenuItem animpostfx = new MenuItem("Animpostfx", "Play animated post-effects.") { RightIcon = MenuItem.Icon.ARROW_RIGHT };
159 | menu.AddMenuItem(animpostfx);
160 | MenuController.AddSubmenu(menu, animpostfxMenu);
161 | MenuController.BindMenuItem(menu, animpostfxMenu, animpostfx);
162 |
163 | MenuListItem effect = new MenuListItem("Effect", data.WorldData.AnimpostfxEffects, 0, "Choose an effect.");
164 | MenuItem play = new MenuItem("Play", "Start playing the selected effect.");
165 | MenuItem stop = new MenuItem("Stop", "Stop playing the selected effect.");
166 | MenuItem stopAll = new MenuItem("Stop All", "Stop playing all effects.");
167 |
168 | animpostfxMenu.AddMenuItem(effect);
169 | animpostfxMenu.AddMenuItem(play);
170 | animpostfxMenu.AddMenuItem(stop);
171 | animpostfxMenu.AddMenuItem(stopAll);
172 |
173 | animpostfxMenu.OnItemSelect += (menu, item, index) =>
174 | {
175 | if (item == play)
176 | {
177 | AnimpostfxPlay(effect.GetCurrentSelection());
178 | }
179 | else if (item == stop)
180 | {
181 | AnimpostfxStop(effect.GetCurrentSelection());
182 | }
183 | else if (item == stopAll)
184 | {
185 | AnimpostfxStopAll();
186 | }
187 | };
188 | }
189 | }
190 |
191 | public static Menu GetMenu()
192 | {
193 | SetupMenu();
194 | return menu;
195 | }
196 | }
197 | }
198 |
--------------------------------------------------------------------------------
/RedMenu/RedMenuClient/util/StorageManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using CitizenFX.Core;
7 | using static CitizenFX.Core.Native.API;
8 |
9 | namespace RedMenuClient.util
10 | {
11 | public static class StorageManager
12 | {
13 |
14 | #region Setters
15 | ///
16 | /// Save a value to client storage.
17 | ///
18 | /// The name of the value you want to store.
19 | /// The value to store.
20 | /// If you want to override any exisiting values with the same key.
21 | /// True if save was successful, false if save name is already in use.
22 | public static bool Save(string key, string value, bool overrideExisting)
23 | {
24 | if (Exists(key))
25 | {
26 | if (overrideExisting)
27 | {
28 | if (GetType(key) != typeof(string))
29 | {
30 | Delete(key);
31 | }
32 | }
33 | else
34 | {
35 | return false;
36 | }
37 | }
38 |
39 | SetResourceKvp($"string_{key}", value);
40 | return true;
41 | }
42 |
43 | ///
44 | /// Save an value to client storage.
45 | ///
46 | /// The name of the value you want to store.
47 | /// The value to store.
48 | /// If you want to override any exisiting values with the same key.
49 | /// True if save was successful, false if save name is already in use.
50 | public static bool Save(string key, int value, bool overrideExisting)
51 | {
52 | if (Exists(key))
53 | {
54 | if (overrideExisting)
55 | {
56 | if (GetType(key) != typeof(int))
57 | {
58 | Delete(key);
59 | }
60 | }
61 | else
62 | {
63 | return false;
64 | }
65 | }
66 |
67 | SetResourceKvpInt($"int_{key}", value);
68 | return true;
69 | }
70 |
71 | ///
72 | /// Save a value to client storage.
73 | ///
74 | /// The name of the value you want to store.
75 | /// The value to store.
76 | /// If you want to override any exisiting values with the same key.
77 | /// True if save was successful, false if save name is already in use.
78 | public static bool Save(string key, float value, bool overrideExisting)
79 | {
80 | if (Exists(key))
81 | {
82 | if (overrideExisting)
83 | {
84 | if (GetType(key) != typeof(float))
85 | {
86 | Delete(key);
87 | }
88 | }
89 | else
90 | {
91 | return false;
92 | }
93 | }
94 |
95 | SetResourceKvpFloat($"float_{key}", value);
96 | return true;
97 | }
98 |
99 | ///
100 | /// Save a value to client storage.
101 | ///
102 | /// The name of the value you want to store.
103 | /// The value to store.
104 | /// If you want to override any exisiting values with the same key.
105 | /// True if save was successful, false if save name is already in use.
106 | public static bool Save(string key, bool value, bool overrideExisting)
107 | {
108 | if (Exists(key))
109 | {
110 | if (overrideExisting)
111 | {
112 | if (GetType(key) != typeof(string))
113 | {
114 | Delete(key);
115 | }
116 | }
117 | else
118 | {
119 | return false;
120 | }
121 | }
122 |
123 | // string prefix because it's saved as a string, if there's ever a bool function implemented we'll use a bool prefix to prevent conflicting saved data.
124 | SetResourceKvp($"string_{key}", value.ToString());
125 | return true;
126 | }
127 |
128 | ///
129 | /// Save a value to client storage.
130 | ///
131 | /// The name of the value you want to store.
132 | /// The value to store.
133 | /// If you want to override any exisiting values with the same key.
134 | /// True if save was successful, false if save name is already in use.
135 | public static bool Save(string key, Vector3 value, bool overrideExisting)
136 | {
137 | if (Exists(key))
138 | {
139 | if (overrideExisting)
140 | {
141 | if (GetType(key) != typeof(Vector3))
142 | {
143 | Delete(key);
144 | }
145 | }
146 | else
147 | {
148 | return false;
149 | }
150 | }
151 |
152 | // Unlikely to ever have a real Vector3 kvp option so it's safe to use vector3_ as a prefix even though it's a float.
153 | SetResourceKvpFloat($"vector3_x_{key}", value.X);
154 | SetResourceKvpFloat($"vector3_y_{key}", value.Y);
155 | SetResourceKvpFloat($"vector3_z_{key}", value.Z);
156 | return true;
157 | }
158 | #endregion
159 |
160 | #region Getters
161 | ///
162 | /// Get a saved value from client storage.
163 | ///
164 | ///
165 | ///
166 | /// Returns false if the key does not exist.
167 | public static bool TryGet(string key, out string output)
168 | {
169 | if (!ExistsWithType(key, "string"))
170 | {
171 | output = null;
172 | return false;
173 | }
174 | output = GetResourceKvpString($"string_{key}");
175 | return true;
176 | }
177 |
178 | ///
179 | /// Get a saved value from client storage.
180 | ///
181 | ///
182 | ///
183 | /// Returns false if the key does not exist.
184 | public static bool TryGet(string key, out int output)
185 | {
186 | if (!ExistsWithType(key, "int"))
187 | {
188 | output = 0;
189 | return false;
190 | }
191 | output = GetResourceKvpInt($"int_{key}");
192 | return true;
193 | }
194 |
195 | ///
196 | /// Get a saved value from client storage.
197 | ///
198 | ///
199 | ///
200 | /// Returns false if the key does not exist.
201 | public static bool TryGet(string key, out float output)
202 | {
203 | if (!ExistsWithType(key, "float"))
204 | {
205 | output = 0f;
206 | return false;
207 | }
208 | output = GetResourceKvpFloat($"float_{key}");
209 | return true;
210 | }
211 |
212 | ///
213 | /// Get a saved value from client storage.
214 | ///
215 | ///
216 | ///
217 | /// Returns false if the key does not exist.
218 | public static bool TryGet(string key, out bool output)
219 | {
220 | if (!ExistsWithType(key, "string"))
221 | {
222 | output = false;
223 | return false;
224 | }
225 | if (bool.TryParse(GetResourceKvpString($"string_{key}"), out bool value))
226 | {
227 | output = value;
228 | return true;
229 | }
230 | output = false;
231 | return false;
232 | }
233 |
234 | ///
235 | /// Get a saved value from client storage.
236 | ///
237 | ///
238 | ///
239 | /// Returns false if the key does not exist.
240 | public static bool TryGet(string key, out Vector3 output)
241 | {
242 | if (ExistsWithType(key, "vector3_x") && ExistsWithType(key, "vector3_y") && ExistsWithType(key, "vector3_z"))
243 | {
244 | float x = GetResourceKvpFloat($"vector3_x_{key}");
245 | float y = GetResourceKvpFloat($"vector3_y_{key}");
246 | float z = GetResourceKvpFloat($"vector3_z_{key}");
247 | output = new Vector3(x, y, z);
248 | return true;
249 | }
250 | output = Vector3.Zero;
251 | return false;
252 | }
253 | #endregion
254 |
255 | #region misc
256 | ///
257 | /// Returns a list of all stored keys.
258 | ///
259 | ///
260 | public static List GetAllKeys()
261 | {
262 | List kvps = new List();
263 | int handle = StartFindKvp("");
264 | while (true)
265 | {
266 | string kvp = FindKvp(handle);
267 | if (string.IsNullOrEmpty(kvp))
268 | {
269 | break;
270 | }
271 | kvps.Add(kvp);
272 | }
273 | EndFindKvp(handle);
274 | return kvps;
275 | }
276 |
277 | ///
278 | /// Returns true if this key is saved, regardless of the type.
279 | ///
280 | ///
281 | ///
282 | public static bool Exists(string key)
283 | {
284 | return GetAllKeys().Any((v) => v.EndsWith($"_{key}"));
285 | }
286 |
287 | ///
288 | /// Returns true if this key is saved as the specified type.
289 | ///
290 | ///
291 | ///
292 | ///
293 | public static bool ExistsWithType(string key, string type)
294 | {
295 | return GetAllKeys().Any((v) => v == $"{type}_{key}");
296 | }
297 |
298 | ///
299 | /// Returns the type of the saved key. Returns null if the key does not exist or the key type is unknown.
300 | ///
301 | ///
302 | ///
303 | private static Type GetType(string key)
304 | {
305 | if (!Exists(key))
306 | {
307 | return null;
308 | }
309 | string foundKvp = GetAllKeys().Find((v) => v.EndsWith($"_{key}"));
310 | if (foundKvp.StartsWith("string_"))
311 | {
312 | return typeof(string);
313 | }
314 | else if (foundKvp.StartsWith("int_"))
315 | {
316 | return typeof(int);
317 | }
318 | else if (foundKvp.StartsWith("float_"))
319 | {
320 | return typeof(float);
321 | }
322 | else if (foundKvp.StartsWith("vector3_"))
323 | {
324 | return typeof(Vector3);
325 | }
326 | return null;
327 | }
328 |
329 | ///
330 | /// Deletes the specified key if it exists.
331 | ///
332 | ///
333 | public static void Delete(string key)
334 | {
335 | if (Exists(key))
336 | {
337 | var type = GetType(key);
338 | if (type == typeof(string))
339 | {
340 | DeleteResourceKvp($"string_{key}");
341 | }
342 | else if (type == typeof(int))
343 | {
344 | DeleteResourceKvp($"int_{key}");
345 | }
346 | else if (type == typeof(float))
347 | {
348 | DeleteResourceKvp($"float_{key}");
349 | }
350 | else if (type == typeof(Vector3))
351 | {
352 | DeleteResourceKvp($"vector3_x_{key}");
353 | DeleteResourceKvp($"vector3_y_{key}");
354 | DeleteResourceKvp($"vector3_z_{key}");
355 | }
356 | }
357 | }
358 | #endregion
359 | }
360 | }
361 |
--------------------------------------------------------------------------------
/RedMenu/RedMenuClient/util/UiPrompt.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using CitizenFX.Core;
7 | using CitizenFX.Core.Native;
8 | using static CitizenFX.Core.Native.API;
9 | using static CitizenFX.Core.Native.Function;
10 |
11 | namespace RedMenuClient
12 | {
13 | public class UiPromptsCollection : BaseScript
14 | {
15 | public static List prompts = new List();
16 |
17 | public UiPromptsCollection() { }
18 |
19 | [EventHandler("onResourceStop")]
20 | public void OnResourceStop(string name)
21 | {
22 | if (name == GetCurrentResourceName())
23 | {
24 | var allPrompts = prompts.ToList();
25 | foreach (var d in allPrompts)
26 | {
27 | d.Dispose();
28 | }
29 | }
30 | }
31 | }
32 |
33 | public class UiPrompt
34 | {
35 | //private long text;
36 | private string textString;
37 | private Control[] controls;
38 | private int promptHandle;
39 | private string optionalThing;
40 |
41 | ///
42 | /// Constructor
43 | ///
44 | ///
45 | ///
46 | public UiPrompt(Control[] controls, string text, string optionalThing = null)
47 | {
48 | this.controls = controls;
49 | this.textString = text;
50 | this.promptHandle = 0;
51 | this.optionalThing = optionalThing;
52 |
53 | if (!UiPromptsCollection.prompts.Contains(this))
54 | {
55 | UiPromptsCollection.prompts.Add(this);
56 | }
57 | }
58 |
59 | ///
60 | /// Prepare the instructional button before it is displayed.
61 | ///
62 | public void Prepare()
63 | {
64 | if (this.IsPrepared())
65 | {
66 | return;
67 | //this.Dispose();
68 | }
69 |
70 | this.promptHandle = Call((Hash)0x04F97DE45A519419); // UipromptRegisterBegin
71 | Call((Hash)0x5DD02A8318420DD7, this.promptHandle, Call((Hash)0xFA925AC00EB830B9, 10, "LITERAL_STRING", textString)); // UipromptSetText
72 | if (!string.IsNullOrEmpty(this.optionalThing))
73 | {
74 | Call((Hash)0xDEC85C174751292B, this.promptHandle, optionalThing); // _UIPROMPT_SET_TAG
75 | }
76 | foreach (var c in this.controls)
77 | {
78 | Call((Hash)0xB5352B7494A08258, this.promptHandle, c); // UipromptSetControlAction
79 | }
80 | Call((Hash)0xCC6656799977741B, this.promptHandle, true); // UipromptSetStandardMode
81 | Call((Hash)0xF7AA2696A22AD8B9, this.promptHandle); // UipromptRegisterEnd
82 | //this.SetEnabled(false, false);
83 |
84 | if (!UiPromptsCollection.prompts.Contains(this))
85 | {
86 | UiPromptsCollection.prompts.Add(this);
87 | }
88 | }
89 |
90 | ///
91 | /// Check if it is ready to be displayed.
92 | ///
93 | ///
94 | public bool IsPrepared()
95 | {
96 | if (Call((Hash)0x347469FBDD1589A9, this.promptHandle)) // UipromptIsValid
97 | {
98 | return true;
99 | }
100 | return false;
101 | }
102 |
103 | ///
104 | /// Enables or disables the prompt on screen. You must prepare the prompt first using .
105 | ///
106 | ///
107 | ///
108 | public void SetEnabled(bool visible, bool enabled)
109 | {
110 | Call((Hash)0x71215ACCFDE075EE, this.promptHandle, visible); // UipromptSetVisible
111 | Call((Hash)0x8A0FB4D03A630D21, this.promptHandle, enabled); // UipromptSetEnabled
112 | }
113 |
114 | ///
115 | /// Disposes the prompt. Requires you to call again before you can use it again.
116 | ///
117 | public void Dispose()
118 | {
119 | if (this.IsPrepared())
120 | {
121 | this.SetEnabled(false, false);
122 | Call((Hash)0x00EDE88D4D13CF59, this.promptHandle); // UipromptDelete
123 | }
124 |
125 | this.promptHandle = 0;
126 |
127 | if (UiPromptsCollection.prompts.Contains(this))
128 | {
129 | UiPromptsCollection.prompts.Remove(this);
130 | }
131 | }
132 |
133 | public string GetTextString() => textString;
134 | public Control[] GetControls() => controls;
135 | }
136 | }
137 |
--------------------------------------------------------------------------------
/RedMenu/RedMenuClient/util/UserDefaults.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using CitizenFX.Core;
7 | using static CitizenFX.Core.Native.API;
8 | using RedMenuShared;
9 | using CitizenFX.Core.Native;
10 |
11 | namespace RedMenuClient.util
12 | {
13 | public static class UserDefaults
14 | {
15 |
16 | ///
17 | /// Default: false
18 | ///
19 | public static bool PlayerGodMode
20 | {
21 | get
22 | {
23 | if (StorageManager.TryGet("PlayerGodMode", out bool val))
24 | {
25 | return val;
26 | }
27 | PlayerGodMode = false;
28 | return false;
29 | }
30 | set
31 | {
32 | StorageManager.Save("PlayerGodMode", value, true);
33 | }
34 | }
35 |
36 | ///
37 | /// Default: false
38 | ///
39 | public static bool PlayerInfiniteStamina
40 | {
41 | get
42 | {
43 | if (StorageManager.TryGet("PlayerInfiniteStamina", out bool val))
44 | {
45 | return val;
46 | }
47 | PlayerInfiniteStamina = false;
48 | return false;
49 | }
50 | set
51 | {
52 | StorageManager.Save("PlayerInfiniteStamina", value, true);
53 | }
54 | }
55 |
56 | ///
57 | /// Default: false
58 | ///
59 | public static bool PlayerInfiniteDeadEye
60 | {
61 | get
62 | {
63 | if (StorageManager.TryGet("PlayerInfiniteDeadEye", out bool val))
64 | {
65 | return val;
66 | }
67 | PlayerInfiniteDeadEye = false;
68 | return false;
69 | }
70 | set
71 | {
72 | StorageManager.Save("PlayerInfiniteDeadEye", value, true);
73 | }
74 | }
75 |
76 | ///
77 | /// Default: true
78 | ///
79 | public static bool MiscMinimapControls
80 | {
81 | get
82 | {
83 | if (StorageManager.TryGet("MiscMinimapControls", out bool val))
84 | {
85 | return val;
86 | }
87 | MiscMinimapControls = true;
88 | return true;
89 | }
90 | set
91 | {
92 | StorageManager.Save("MiscMinimapControls", value, true);
93 | }
94 | }
95 |
96 |
97 | ///
98 | /// Default: false
99 | ///
100 | public static bool MiscAlwaysShowCores
101 | {
102 | get
103 | {
104 | if (StorageManager.TryGet("MiscAlwaysShowCores", out bool val))
105 | {
106 | return val;
107 | }
108 | MiscAlwaysShowCores = false;
109 | return true;
110 | }
111 | set
112 | {
113 | StorageManager.Save("MiscAlwaysShowCores", value, true);
114 | }
115 | }
116 |
117 | public static bool WeaponInfiniteAmmo
118 | {
119 | get
120 | {
121 | if (StorageManager.TryGet("WeaponInfiniteAmmo", out bool val))
122 | {
123 | return val;
124 | }
125 | WeaponInfiniteAmmo = false;
126 | return false;
127 | }
128 | set
129 | {
130 | StorageManager.Save("WeaponInfiniteAmmo", value, true);
131 | }
132 | }
133 |
134 | public static bool PlayerEveryoneIgnore
135 | {
136 | get
137 | {
138 | if (StorageManager.TryGet("PlayerEveryoneIgnore", out bool val))
139 | {
140 | return val;
141 | }
142 | PlayerEveryoneIgnore = false;
143 | return false;
144 | }
145 | set
146 | {
147 | StorageManager.Save("PlayerEveryoneIgnore", value, true);
148 | }
149 | }
150 |
151 | public static bool PlayerDisableRagdoll
152 | {
153 | get
154 | {
155 | if (StorageManager.TryGet("PlayerDisableRagdoll", out bool val))
156 | {
157 | return val;
158 | }
159 | PlayerDisableRagdoll = false;
160 | return false;
161 | }
162 | set
163 | {
164 | StorageManager.Save("PlayerDisableRagdoll", value, true);
165 | }
166 | }
167 |
168 | public static bool VehicleSpawnInside
169 | {
170 | get
171 | {
172 | if (StorageManager.TryGet("VehicleSpawnInside", out bool val))
173 | {
174 | return val;
175 | }
176 | VehicleSpawnInside = false;
177 | return false;
178 | }
179 | set
180 | {
181 | StorageManager.Save("VehicleSpawnInside", value, true);
182 | }
183 | }
184 |
185 | public static float VoiceRange
186 | {
187 | get
188 | {
189 | if (StorageManager.TryGet("VoiceRange", out float val))
190 | {
191 | return val;
192 | }
193 | VoiceRange = 0f;
194 | return 0f;
195 | }
196 | set
197 | {
198 | StorageManager.Save("VoiceRange", value, true);
199 | }
200 | }
201 |
202 | public static bool MountGodMode
203 | {
204 | get
205 | {
206 | if (StorageManager.TryGet("MountGodMode", out bool val))
207 | {
208 | return val;
209 | }
210 | MountGodMode = false;
211 | return false;
212 | }
213 | set
214 | {
215 | StorageManager.Save("MountGodMode", value, true);
216 | }
217 | }
218 |
219 | public static bool MountInfiniteStamina
220 | {
221 | get
222 | {
223 | if (StorageManager.TryGet("MountInfiniteStamina", out bool val))
224 | {
225 | return val;
226 | }
227 | MountInfiniteStamina = false;
228 | return false;
229 | }
230 | set
231 | {
232 | StorageManager.Save("MountInfiniteStamina", value, true);
233 | }
234 | }
235 |
236 | public static int PlayerDefaultSavedPed
237 | {
238 | get
239 | {
240 | if (StorageManager.TryGet("PlayerDefaultSavedPed", out int val))
241 | {
242 | return val;
243 | }
244 | PlayerDefaultSavedPed = 0;
245 | return 0;
246 | }
247 | set
248 | {
249 | StorageManager.Save("PlayerDefaultSavedPed", value, true);
250 | }
251 | }
252 |
253 | public static int WeaponDefaultSavedLoadout
254 | {
255 | get
256 | {
257 | if (StorageManager.TryGet("WeaponDefaultSavedLoadout", out int val))
258 | {
259 | return val;
260 | }
261 | WeaponDefaultSavedLoadout = 0;
262 | return 0;
263 | }
264 | set
265 | {
266 | StorageManager.Save("WeaponDefaultSavedLoadout", value, true);
267 | }
268 | }
269 | }
270 | }
271 |
--------------------------------------------------------------------------------
/RedMenu/RedMenuClient/util/Util.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using MenuAPI;
7 | using CitizenFX.Core;
8 | using static CitizenFX.Core.Native.API;
9 |
10 | namespace RedMenuClient
11 | {
12 | static class Util
13 | {
14 |
15 | ///
16 | /// Returns true if the control is pressed.
17 | ///
18 | ///
19 | ///
20 | public static bool IsControlPressed(Control control)
21 | {
22 | if (CitizenFX.Core.Native.Function.Call(CitizenFX.Core.Native.Hash.IS_CONTROL_PRESSED, 0, (uint)control))
23 | {
24 | return true;
25 | }
26 | return false;
27 | }
28 |
29 | ///
30 | /// Returns true if the control is just pressed.
31 | ///
32 | ///
33 | ///
34 | public static bool IsControlJustPressed(Control control)
35 | {
36 | if (CitizenFX.Core.Native.Function.Call(CitizenFX.Core.Native.Hash.IS_CONTROL_JUST_PRESSED, 0, (uint)control))
37 | {
38 | return true;
39 | }
40 | return false;
41 | }
42 |
43 | ///
44 | /// Returns true if the disabled control is pressed.
45 | ///
46 | ///
47 | ///
48 | public static bool IsDisabledControlPressed(Control control)
49 | {
50 | if (CitizenFX.Core.Native.Function.Call(CitizenFX.Core.Native.Hash.IS_DISABLED_CONTROL_PRESSED, 0, (uint)control))
51 | {
52 | return true;
53 | }
54 | return false;
55 | }
56 |
57 | ///
58 | /// Returns true if the disabled control is just pressed.
59 | ///
60 | ///
61 | ///
62 | public static bool IsDisabledControlJustPressed(Control control)
63 | {
64 | if (CitizenFX.Core.Native.Function.Call(CitizenFX.Core.Native.Hash.IS_DISABLED_CONTROL_JUST_PRESSED, 0, (uint)control))
65 | {
66 | return true;
67 | }
68 | return false;
69 | }
70 |
71 | ///
72 | /// Returns true if the control is released.
73 | ///
74 | ///
75 | ///
76 | public static bool IsControlReleased(Control control)
77 | {
78 | if (CitizenFX.Core.Native.Function.Call(CitizenFX.Core.Native.Hash.IS_CONTROL_RELEASED, 0, (uint)control))
79 | {
80 | return true;
81 | }
82 | return false;
83 | }
84 |
85 | ///
86 | /// Returns true if the control is just released.
87 | ///
88 | ///
89 | ///
90 | public static bool IsControlJustReleased(Control control)
91 | {
92 | if (CitizenFX.Core.Native.Function.Call(CitizenFX.Core.Native.Hash.IS_CONTROL_JUST_RELEASED, 0, (uint)control))
93 | {
94 | return true;
95 | }
96 | return false;
97 | }
98 |
99 | ///
100 | /// Returns true if the disabled control is released.
101 | ///
102 | ///
103 | ///
104 | public static bool IsDisabledControlReleased(Control control)
105 | {
106 | if (CitizenFX.Core.Native.Function.Call(CitizenFX.Core.Native.Hash.IS_DISABLED_CONTROL_PRESSED, 0, (uint)control))
107 | {
108 | return false;
109 | }
110 | return true;
111 | }
112 |
113 | ///
114 | /// Returns true if the disabled control is just released.
115 | ///
116 | ///
117 | ///
118 | public static bool IsDisabledControlJustReleased(Control control)
119 | {
120 | if (CitizenFX.Core.Native.Function.Call(CitizenFX.Core.Native.Hash.IS_DISABLED_CONTROL_JUST_RELEASED, 0, (uint)control))
121 | {
122 | return true;
123 | }
124 | return false;
125 | }
126 |
127 | ///
128 | /// Returns true if the control is enabled.
129 | ///
130 | ///
131 | ///
132 | public static bool IsControlEnabled(Control control)
133 | {
134 | return CitizenFX.Core.Native.Function.Call(CitizenFX.Core.Native.Hash.IS_CONTROL_ENABLED, 0, (uint)control);
135 | }
136 |
137 | }
138 | }
139 |
--------------------------------------------------------------------------------
/RedMenu/RedMenuClient/vendor/cfx/CitizenFX.Core.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kibook/RedMenu/d8748e65f6b86a0c1b729e391fbd39da63edfcd7/RedMenu/RedMenuClient/vendor/cfx/CitizenFX.Core.dll
--------------------------------------------------------------------------------
/RedMenu/RedMenuServer/MainServer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using CitizenFX.Core;
7 | using static CitizenFX.Core.Native.API;
8 | using RedMenuShared;
9 |
10 | namespace RedMenuServer
11 | {
12 | public class MainServer : BaseScript
13 | {
14 | public MainServer()
15 | {
16 | if (!ConfigManager.EnablePermissions && !ConfigManager.IgnoreConfigWarning)
17 | {
18 | Debug.WriteLine("^3[WARNING] RedMenu is setup to ignore permissions! If this was not intended, please read the installation instructions. You can silence this warning by adding ^7setr ignore_config_warning \"true\" ^3to your server.cfg, above the ^7start RedMenu ^3line.^7");
19 | }
20 | else if (!ConfigManager.IgnoreConfigWarning)
21 | {
22 | Debug.WriteLine("^2[RedMenu] You successfully executed the config.cfg file, good job.^7");
23 | }
24 |
25 | if (GetCurrentResourceName() != "RedMenu")
26 | {
27 | Debug.WriteLine("^1[ERROR] RedMenu is not correctly installed. Please make sure that the folder is called RedMenu (case sensitive)! RedMenu will not function if it's incorrectly named.^7");
28 | throw new Exception("Installation error: Invalid resource name.");
29 | }
30 | else
31 | {
32 | Debug.WriteLine("^2[RedMenu] The resource is installed in the correct folder, well done.^7");
33 | }
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/RedMenu/RedMenuServer/RedMenuServer.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | net452
4 | embedded
5 | Release;Debug
6 | RedMenuServer.net
7 | $(AssemblyName)
8 |
9 |
10 | x64
11 |
12 |
13 | TRACE;SERVER
14 |
15 |
16 | DEBUG;SERVER
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | vendor\cfx\CitizenFX.Core.dll
29 | false
30 |
31 |
32 | ..\Newtonsoft.Json.dll
33 | false
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/RedMenu/RedMenuServer/vendor/cfx/CitizenFX.Core.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kibook/RedMenu/d8748e65f6b86a0c1b729e391fbd39da63edfcd7/RedMenu/RedMenuServer/vendor/cfx/CitizenFX.Core.dll
--------------------------------------------------------------------------------
/RedMenu/shared/classes/ConfigManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using CitizenFX.Core;
7 | using static CitizenFX.Core.Native.API;
8 |
9 | namespace RedMenuShared
10 | {
11 | public static class ConfigManager
12 | {
13 | public static string Version
14 | {
15 | get
16 | {
17 | return GetResourceMetadata(GetCurrentResourceName(), "version", 0) ?? "unknown";
18 | }
19 | }
20 |
21 |
22 | public static string ServerInfoSubtitle
23 | {
24 | get
25 | {
26 | return GetConvar("server_info_subtitle", "www.vespura.com");
27 | }
28 | }
29 |
30 |
31 | public static bool UnlockFullMap
32 | {
33 | get
34 | {
35 | return GetConvar("unlock_full_map", "true").ToLower() == "true";
36 | }
37 | }
38 |
39 |
40 | public static bool EnablePermissions
41 | {
42 | get
43 | {
44 | return GetConvar("enable_permissions", "false").ToLower() == "true";
45 | }
46 | }
47 |
48 | public static bool IgnoreConfigWarning
49 | {
50 | get
51 | {
52 | return GetConvar("ignore_config_warning", "false").ToLower() == "true";
53 | }
54 | }
55 |
56 | public static bool EnableMaxStats
57 | {
58 | get
59 | {
60 | return GetConvar("enable_max_stats", "true").ToLower() == "true";
61 | }
62 | }
63 |
64 |
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/RedMenu/shared/classes/PermissionsManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using CitizenFX.Core;
7 | using static CitizenFX.Core.Native.API;
8 | using Newtonsoft.Json;
9 |
10 | namespace RedMenuShared
11 | {
12 | ///
13 | /// All permissions.
14 | ///
15 | public enum Permission
16 | {
17 | // Online Players Menu
18 | OPMMenu,
19 |
20 | // Player Menu
21 | PMMenu,
22 | PMRestoreInnerCores,
23 | PMRestoreOuterCores,
24 | PMGodMode,
25 | PMInfiniteStamina,
26 | PMInfiniteDeadEye,
27 | PMClearTasks,
28 | PMHogtieSelf,
29 | PMCleanPed,
30 | PMDryPed,
31 | PMSelectPlayerModel,
32 | PMSelectOutfit,
33 | PMCustomizeMpPeds,
34 | PMSavedPeds,
35 | PMSavedOutfits,
36 | PMScenarios,
37 | PMKillSelf,
38 | PMEveryoneIgnore,
39 | PMFortifyCores,
40 | PMEmotes,
41 | PMDisableRagdoll,
42 | PMWalkingStyle,
43 | PMMood,
44 |
45 | // Weapons Menu
46 | WMDropWeapon,
47 | WMRefillAmmo,
48 | WMMenu,
49 | WMItems,
50 | WMBows,
51 | WMMelee,
52 | WMPistols,
53 | WMRepeaters,
54 | WMRevolvers,
55 | WMRifles,
56 | WMShotguns,
57 | WMSniperRifles,
58 | WMThrowables,
59 | WMInfiniteAmmo,
60 | WMGetAll,
61 | WMDualWield,
62 | WMCleanWeapon,
63 | WMDirtyWeapon,
64 | WMRemoveAmmo,
65 | WMCustomize,
66 | WMSavedLoadouts,
67 | WMInspectWeapon,
68 |
69 | // Mount Menu
70 | MMMenu,
71 | MMSpawn,
72 | MMSex,
73 | MMTack,
74 | MMRestoreInnerCores,
75 | MMRestoreOuterCores,
76 | MMFortifyCores,
77 | MMClean,
78 | MMDelete,
79 | MMSavedMounts,
80 | MMGodMode,
81 | MMInfiniteStamina,
82 |
83 | // Vehicle Menu
84 | VMMenu,
85 | VMSpawn,
86 | VMSpawnInside,
87 | VMDelete,
88 | VMRepair,
89 | VMTeleport,
90 | VMEngineOnOff,
91 | VMLightsOnOff,
92 | VMSelectTint,
93 | VMDoors,
94 |
95 | // Teleport Menu
96 | TMMenu,
97 | TMTeleportToWaypoint,
98 | TMLocations,
99 |
100 | // World Related Options Menu
101 | WOMenu,
102 | WOTime,
103 | WOWeather,
104 | WOTimecycleModifiers,
105 | WOAnimpostfx,
106 |
107 | // Voice Menu
108 | VOMenu,
109 | VORange,
110 |
111 | // Misc Settings
112 | MSClearArea
113 | }
114 |
115 |
116 | public class PermissionsManager : BaseScript
117 | {
118 | ///
119 | /// Constructor, only used for the client side to trigger the permissions event.
120 | ///
121 | public PermissionsManager()
122 | {
123 | #if CLIENT
124 | TriggerServerEvent("rm:getUserPermissions");
125 | #endif
126 | }
127 |
128 | #if SERVER
129 | ///
130 | /// Returns the actual ace name corresponding to the provided the enum name.
131 | ///
132 | /// enum name.
133 | ///
134 | private static string GetAceNameFromPermission(string permissionName)
135 | {
136 | const string prefix = "RedMenu";
137 | if (permissionName.StartsWith("OPM"))
138 | {
139 | return prefix + ".OnlinePlayersMenu." + permissionName.Substring(3);
140 | }
141 | if (permissionName.StartsWith("PM"))
142 | {
143 | return prefix + ".PlayerMenu." + permissionName.Substring(2);
144 | }
145 | if (permissionName.StartsWith("WM"))
146 | {
147 | return prefix + ".WeaponsMenu." + permissionName.Substring(2);
148 | }
149 | if (permissionName.StartsWith("MM"))
150 | {
151 | return prefix + ".MountMenu." + permissionName.Substring(2);
152 | }
153 | if (permissionName.StartsWith("VM"))
154 | {
155 | return prefix + ".VehicleMenu." + permissionName.Substring(2);
156 | }
157 | if (permissionName.StartsWith("TM"))
158 | {
159 | return prefix + ".TeleportMenu." + permissionName.Substring(2);
160 | }
161 | if (permissionName.StartsWith("WO"))
162 | {
163 | return prefix + ".WorldMenu." + permissionName.Substring(2);
164 | }
165 | if (permissionName.StartsWith("VO"))
166 | {
167 | return prefix + ".VoiceMenu." + permissionName.Substring(2);
168 | }
169 | if (permissionName.StartsWith("MS"))
170 | {
171 | return prefix + ".MiscSettingsMenu." + permissionName.Substring(2);
172 | }
173 | return null;
174 | }
175 |
176 | ///
177 | /// Eventhandler to send all allowed permissions to the requesting client.
178 | ///
179 | /// THe client that requests the permissions.
180 | [EventHandler("rm:getUserPermissions")]
181 | private static void GetUserPermissions([FromSource]Player source)
182 | {
183 | List perms = new List();
184 | foreach (var v in Enum.GetNames(typeof(Permission)))
185 | {
186 | string aceName = GetAceNameFromPermission(v);
187 | if (!string.IsNullOrEmpty(aceName))
188 | {
189 | if (IsPlayerAceAllowed(source.Handle.ToString(), aceName))
190 | {
191 | perms.Add(v);
192 | }
193 | }
194 | }
195 | source.TriggerEvent("rm:setUserPermissions", perms);
196 | }
197 | #endif
198 |
199 | #if CLIENT
200 | ///
201 | /// List of all allowed permissions, for internal use please use instead.
202 | ///
203 | private static List allowedPermissions = new List();
204 |
205 | ///
206 | /// Sets the allowed permissions received from the server event.
207 | ///
208 | /// The permissions object received from the server.
209 | [EventHandler("rm:setUserPermissions")]
210 | private static void SetPermissions(List