A FiveM (GTA5 Modded Multiplayer) Trainer Made by TheStonedTurtle. This is a server-side trainer written in Lua with a NUI written with HTML, CSS, and JS.
- Drag and drop the mellotrainer folder into the resources folder of your server.
- Add start mellotrainer to your server.cfg file.
- Restart your server.
Key | Action |
---|---|
F1 | Open/Close the trainer |
Arrow Keys | Move up,down,left, and right respectively. |
Enter | Select the current trainer option |
Backspace | Go back to the previous menu |
F2 | Toggle No-Clip Mode |
F3 | Teleport to Current Way Point |
Z | Toggle Between Big & Small Minimap |
Key | Action |
---|---|
F2 | Toggle No-Clip Mode |
Shift | Switch No-Clip Movement Speed |
Q | Move Upwards |
Z | Move Downwards |
W | Move Forwards |
S | Move Backwards |
A | Rotate Left |
D | Rotate Right |
- Admin Menu w/ Working Permissions
- Admin Only Trainer Options (Time/Weather, syncs with online players)
- General Settings (Map Blips, Player Blips, Overhead Names, etc)
- Online Players Menu w/ Spectate & Teleport Option
- Player Death Messages
- Player Join/Leave Notifications
- Player Skin Changing and Customization
- Player Skin Save & Load System
- Player Toggle Options (God Mode, ETC)
- Vehicle Spawning & Spawning Options
- Vehicle Customization and Modifications
- Vehicle Save & Load System
- Weapon Spawning
- Weapon Attachments/Infinite ammo
- Voice Overlay & Options (Proximity/Channel/Toggle)
- Noclip Abilities with Admin Only Toggle
- Scorpion Trainer for a lot of the basic NUI functionality & structure.
- Lambda Menu which I used to convert useful functionality from C++ to Lua.
- Simple Speedometer for the speedometer used by the trainer. (Black Outline)
- Player Blips for the basic blip system.
Attribute | Explanation |
---|---|
data-action | The action to callback to lua via a NUICallback. Space delimited values with the first value being the name of the NUICallback. |
data-hover | Exact same as data-action but this triggers when they change to the option instead of selecting the option. |
data-state | Holds a "ON"/"OFF" value for toggle options. |
data-toggle | Global boolean lua variable to sync data-state with. |
data-sub | ID of the new menu to show when selected. |
data-share | Information to share with the sub menu action options.(won't do anything unless data-sub is also specified) |
data-shareid | Updates the submenu ID to this if it exists. Useful for ensuring that a menu that is used my multiple different options will return to the correct place within the trainer. |
data-require | Used for permission checks for data-action and data-sub events. See Below |
Attribute | Explanation |
---|---|
data-container | Prevents this div from being turned into a menu by JS. |
data-parent | The ID of the parent element so if they try to go back |
data-staticmenu | A menu that will be created from static JSON by JS. This will require updating JS so it is recommended you use data-dynamicmenu instead. |
data-dynamicmenu | Holds the name of the NUI Callback that will return a JSON object to populate the current menu with (includes sub menus). See JSON format below. |
data-sharedinfo | Usually added by JS from the data-share attribute of the option. This information will be appended to the end of every data-action and data-hover when requested. |
{
"menuName": "Example Text",
"data": {
"action": "String",
"sub": "String",
"state": "String"
},
"submenu": []
}
-- Request Cop Status
RegisterNUICallback("requirecop", function(data, cb)
TriggerServerEvent("mellotrainer:requestCopStatus")
end)
-- Recieve Cop Status
RegisterNetEvent("mellotrainer:copstatus")
AddEventHandler("mellotrainer:copstatus", function(status)
if(status)then
SendNUIMessage({customprivilegecheck = true})
else
drawNotification("~r~Permission Denied!")
end
end)
Add the below to any server lua file.
RegisterServerEvent('mellotrainer:requestCopStatus')
AddEventHandler('mellotrainer:requestCopStatus', function(id)
local result = false
-- Logic to check if they are a cop here
TriggerClientEvent("mellotrainer:copstatus",source,result)
end)
Atribute | Explanation |
---|---|
menuName | The text to show in the menu |
data | An object containg key value pairs for all data-* attributes to be added to new menu option |
submenu | An Array of of objects that are formatted in the exact same way as the current object. Used for creating linked sub menus. |