Skip to content

Commit

Permalink
0.4.5 (#3)
Browse files Browse the repository at this point in the history
* Beta

* SNS Pistol Fix

* changelog start

* Added version check

* Updated version-check.lua

* Added directory check to data-saving,lua, also some cleaning up

* Version Check Cleanup

* Local Saving Toggle System

* Spacing and other shit

* Cleaned up warning message

* Organised sokme fules, added steam only config option

* Organised all of the files

* Missed some files, woops

* Cleaned up config

* Changed client_script to client_scripts

* Noclip File Rough Draft

* Noclip Basic

* Copyrights/Delete License

* Create LICENSE

* Basic Noclip Working

* Time Crash Fix

* Fixed startup wait and sent saving config setting to client

* Added change speed to noclip (LSHIFT)

* Cleaned up cl_noclip.lua

* Fixed data saving toggle

* Fixed my noclip mistake, change down key to Z

* Added basic kick, started world menu

* Rough ban mockup (needs work)

* Added temp ban, changed DATASAVE:GetSteamId

* Started cl_world.lua

* Fixed kick and ban

* Changed keys due to conflicts with controller

Teleport to waypoint is now F7
Noclip mode is now F8

* I'm a doughnut

* Potential controller confliction fix?

F1 - open trainer
F2 - Noclip
F3 - Teleport to waypoint

* Fixed controller confliction!

* Added gradient, modified colours

* Updated changelog

* Revert "Added gradient, modified colours"

This reverts commit 1f7ecfd.

* WolfKnight's Modified CSS Updates

The Gradient was too bright

* v 0.4.5

* Readme & Changelog Update

* Noclip Menu

Created new JS events (resettrainer and removeSelectedClass)
globalized the `showtrainer` variable to help with noclip menu

* Admin Only Noclip Toggle

* adminStatus fix

* Remove Toggle Notification

* v0.4.5

* v0.4.5 file structure
  • Loading branch information
WolfKnight98 authored Aug 23, 2017
1 parent 290f6a7 commit a1d4d86
Show file tree
Hide file tree
Showing 27 changed files with 1,168 additions and 295 deletions.
26 changes: 26 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
<h1>v0.4.5 (08-22-2017)</h1>
New Noclip Mode, Admin kick & temp ban, and some bug fixes.

<h3>Changes</h3>
<ul>
<li>Changed Control Keys to prevent controller conflictions</li>
<li>Fixed SNS Pistol Menu issues</li>
<li>Data saving can now be toggled in the sv_config.lua file</li>
<li>Restructued all of the files for easier managment</li>
<li>Fixed Time Forward/Backwards causing crashes</li>
<li>Changed some menu colours</li>
</ul>

<h3>Additions</h3>
<ul>
<li>Added a directory check to the data saving system</li>
<li>Version check, the trainer will now let you know if you are running an outdated version. (Credits to EssentialMode)</li>
<li>Added Noclip Mode, can be toggled with F2</li>
<li>Added Admin Only Noclip toggle in sv_config.lua</li>
<li>Added a Steam Only connection option which kicks any player not using steam. Toggleable in the sv_config.lua file</li>
<li>Added Kick and Temp Ban to the admin menu</li>
</ul>




<h1>v0.4.0 (08-15-2017)</h1>
New vehicle and skin saving system, a few bug fixes.

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
47 changes: 36 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,51 @@ As of v0.4.0, players are required to be logged into the Steam client in order f
<table>
<tbody>
<tr><th>Key</th><th>Action</th></tr>
<tr><td>F6</td><td>Open/Close the trainer</td></tr>
<tr><td>F1</td><td>Open/Close the trainer</td></tr>
<tr><td>Arrow Keys</td><td>Move up,down,left, and right respectively.</td></tr>
<tr><td>Enter</td><td>Select the current trainer option</td></tr>
<tr><td>Backspace</td><td>Go back to the previous menu</td></tr>
<tr><td>F2</td><td>Toggle No-Clip Mode</td></tr>
<tr><td>F3</td><td>Teleport to Current Way Point</td></tr>
</tbody>
</table>



<h2>No Clip Controls</h2>
<table>
<tbody>
<tr><th>Key</th><th>Action</th></tr>
<tr><td>F2</td><td>Toggle No-Clip Mode</td></tr>
<tr><td>Shift</td><td>Switch No-Clip Movement Speed</td></tr>
<tr><td>Q</td><td>Move Upwards</td></tr>
<tr><td>Z</td><td>Move Downwards</td></tr>
<tr><td>W</td><td>Move Forwards</td></tr>
<tr><td>S</td><td>Move Backwards</td></tr>
<tr><td>A</td><td>Rotate Left</td></tr>
<tr><td>D</td><td>Rotate Right</td></tr>
</tbody>
</table>


<h1>Features</h1>
<ul>
<li>Online Players Menu with Spectate and Teleport Option</li>
<li>Player Skin Changing and customization</li>
<li>Player Toggle Options (God Mode, ETC)</li>
<li>Vehicle Spawning & Spawning Options</li>
<li>Vehicle Customization and Modifications</li>
<li>Weapon Spawning</li>
<li>Weapon Attachments/Infinite ammo</li>
<li>General Settings (Hide/Enlarge Map, Player Blips)</li>
<li>Toggle-able Map Blips</li>
<li>Admin Menu w/ Working Permissions</li>
<li>Admin Menu w/ Working Permissions</li>
<li>Admin Only Trainer Options (Time/Weather, syncs with online players)</li>
<li>General Settings (Map Blips, Player Blips, Overhead Names, etc)</li>
<li>Online Players Menu w/ Spectate & Teleport Option</li>
<li>Player Death Messages</li>
<li>Player Join/Leave Notifications</li>
<li>Player Skin Changing and Customization</li>
<li>Player Skin Save & Load System</li>
<li>Player Toggle Options (God Mode, ETC)</li>
<li>Vehicle Spawning & Spawning Options</li>
<li>Vehicle Customization and Modifications</li>
<li>Vehicle Save & Load System</li>
<li>Weapon Spawning</li>
<li>Weapon Attachments/Infinite ammo</li>
<li>Voice Overlay & Options (Proximity/Channel/Toggle)</li>
<li>Noclip Abilities with Admin Only Toggle</li>
</ul>


Expand Down
44 changes: 20 additions & 24 deletions mellotrainer/__resource.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,25 @@ files {
"nui/Roboto-Black.ttf"
}

client_script 'utils.lua'

client_scripts {
"variables.lua", -- Create all default variables.
"general.lua", -- User Managment/Trainer Controls/Global Functions
"map.lua", -- Map Blips.
"player.lua", -- Player Toggles & Options
"settings.lua", -- General Settings (Player Blips etc)
"settings-voice.lua", -- Handles all voice-chat related settings
"settings-notifications.lua", -- Handles Player & Death Notifications
"player-skin.lua", -- Player Skins & Props
"player-online.lua", -- Other Player Options (Teleport/Spectate)
"vehicles.lua", -- Vehicle Spawning/Modifications
"weapons.lua", -- Weapon Spawning/Attachments
"admin.lua" -- Handles Admin Menu Access & Options
client_scripts {
'cl_utils.lua', -- Clientsided utilites.
'cl_variables.lua', -- Create all default variables.
'cl_general.lua', -- User Managment/Trainer Controls/Global Functions
'cl_map.lua', -- Map Blips.
'cl_player.lua', -- Player Toggles & Options
'cl_settings.lua', -- General Settings (Player Blips etc)
'cl_settings_voice.lua', -- Handles all voice-chat related settings
'cl_settings_notifications.lua', -- Handles Player & Death Notifications
'cl_player_skin.lua', -- Player Skins & Props
'cl_player_online.lua', -- Other Player Options (Teleport/Spectate)
'cl_vehicles.lua', -- Vehicle Spawning/Modifications
'cl_weapons.lua', -- Weapon Spawning/Attachments
'cl_admin.lua', -- Handles Admin Menu Access & Options
'cl_noclip.lua', -- Handles all No Clip features
'cl_world.lua' -- World stuff, teleportation
}



server_script 'config.lua'
server_script 'data-saving.lua'


server_scripts{
"admin-server.lua" -- Handles Cross-Player Admin Commands
}
server_script 'sv_config.lua' -- MelloTrainer config file
server_script 'sv_main.lua' -- Main serversided file
server_script 'sv_data_saving.lua' -- Data saving system
server_script 'sv_admin.lua' -- Handles Cross-Player Admin Commands
159 changes: 151 additions & 8 deletions mellotrainer/admin.lua → mellotrainer/cl_admin.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,144 @@
-- DO NOT TOUCHY, CONTACT Michael G/TheStonedTurtle if anything is broken.
-- DO NOT TOUCHY, CONTACT Michael G/TheStonedTurtle if anything is broken.
-- DO NOT TOUCHY, CONTACT Michael G/TheStonedTurtle if anything is broken.
-- DO NOT TOUCHY, CONTACT Michael G/TheStonedTurtle if anything is broken.
-- DO NOT TOUCHY, CONTACT Michael G/TheStonedTurtle if anything is broken.
--[[--------------------------------------------------------------------------
*
* Mello Trainer
* (C) Michael Goodwin 2017
* http://github.com/thestonedturtle/mellotrainer/releases
*
* This menu used the Scorpion Trainer as a framework to build off of.
* https://github.com/pongo1231/ScorpionTrainer
* (C) Emre Cürgül 2017
*
* A lot of useful functionality has been converted from the lambda menu.
* https://lambda.menu
* (C) Oui 2017
*
* Additional Contributors:
* WolfKnight (https://forum.fivem.net/u/WolfKnight)
*
---------------------------------------------------------------------------]]


--[[------------------------------------------------------------------------
Player Management
------------------------------------------------------------------------]]--
function GetNetworkPlayers()
local players = {}

for i = 0, 31 do
if ( NetworkIsPlayerActive( i ) ) then
table.insert( players, i )
end
end

if ( next( players ) == nil ) then return nil else return players end
end

--[[ function GeneratePlayerBans( id )
local bans = { 0.016667, 0.085, 0.17, 0.25, 0.5, 1, 2, 3, 4, 5, 8, 10, 15, 20, 30, 40, 60, 120, 240, 480 }
local options = {}
for k, v in pairs( bans ) do
local option = {
[ "menuName" ] = tostring( v ) .. " hours",
[ "data" ] = {
[ "action" ] = "adminban " .. id .. " " .. v
}
}
table.insert( options, option )
end
return options
end ]]--

function GeneratePlayerAdminMenus( id )
local serverid = GetPlayerServerId( id )

local kick = {
[ "menuName" ] = "Kick",
[ "data" ] = {
[ "action" ] = "adminkick " .. serverid
}
}

local kick_reason = {
[ "menuName" ] = "Kick (specify reason)",
[ "data" ] = {
[ "action" ] = "adminkick input " .. serverid
}
}

local temp_ban = {
[ "menuName" ] = "Temp Ban",
[ "data" ] = {
[ "action" ] = "admintempban " .. serverid
}
}

--[[ local banOptions = GeneratePlayerBans( serverid )
local ban = {
[ "menuName" ] = "Ban",
[ "data" ] = {
[ "sub" ] = 3
},
[ "submenu" ] = banOptions
} ]]--

local options = { kick, kick_reason, temp_ban }

return options
end

RegisterNUICallback( "playermanagement", function( data, cb )
local players = GetNetworkPlayers()
local validOptions = {}

for k, v in pairs( players ) do
local playerOptions = GeneratePlayerAdminMenus( v )

table.insert( validOptions, {
[ "menuName" ] = GetPlayerName( v ),
[ "data" ] = {
[ "sub" ] = GetPlayerServerId( v )
},
[ "submenu" ] = playerOptions
} )
end

local customJSON = "{}"

if ( getTableLength( validOptions ) > 0 ) then
customJSON = json.encode( validOptions, { indent = true } )
end

SendNUIMessage( {
createmenu = true,
menuName = "playermanagement",
menudata = customJSON
} )

if ( cb ) then cb( "ok" ) end
end )

RegisterNUICallback( "adminkick", function( data, cb )
if ( data.action == "input" ) then
local id = tonumber( data.data[3] )
local reason = requestInput( "", 60 )

if ( reason ) then
TriggerServerEvent( 'mellotrainer:adminKick', id, "Kicked: " .. reason )
end
else
local id = tonumber( data.action )

TriggerServerEvent( 'mellotrainer:adminKick', id, "Kicked: You have been kicked from the server." )
end
end )

RegisterNUICallback( "admintempban", function( data, cb )
local id = tonumber( data.action )
TriggerServerEvent( 'mellotrainer:adminTempBan', id )
end )


-- _______ _ ____ _ _
Expand All @@ -16,13 +152,21 @@

-- Forward one hour
function getForwardTime()
return {h=GetClockHours() + 1,m= GetClockMinutes(),s=GetClockSeconds()}
local hour = GetClockHours() + 1
if(hour == 24)then
hour = 0
end
return {h=hour,m=GetClockMinutes(),s=GetClockSeconds()}
end


-- Back one hour
function getReverseTime()
return {h=GetClockHours() - 1,m= GetClockMinutes(),s=GetClockSeconds()}
local hour = GetClockHours() - 1
if(hour < 0)then
hour = 23
end
return {h=hour,m=GetClockMinutes(),s=GetClockSeconds()}
end


Expand Down Expand Up @@ -184,7 +328,6 @@ Citizen.CreateThread(function()

if NetworkIsSessionStarted() then
TriggerServerEvent( "mellotrainer:firstJoinProper", PlayerId() )
TriggerServerEvent( 'wk:AddPlayerToDataSave' )
return
end
end
Expand Down
Loading

0 comments on commit a1d4d86

Please sign in to comment.