forked from AlterGamingNetwork/mellotrainer
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsv_main.lua
51 lines (45 loc) · 1.89 KB
/
sv_main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
--[[--------------------------------------------------------------------------
*
* 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)
*
---------------------------------------------------------------------------]]
_VERSION = '0.5.5'
--[[------------------------------------------------------------------------
Version Check
Credits to EssentialMode
------------------------------------------------------------------------]]--
PerformHttpRequest( "https://thestonedturtle.github.io/mellotrainer/version", function( err, text, headers )
Citizen.Wait( 1000 ) -- just to reduce clutter in the console on startup
RconPrint( "\nCurrent MelloTrainer Version: " .. _VERSION)
RconPrint( "\nLatest MelloTrainer Version: " .. text)
if ( text ~= _VERSION ) then
RconPrint( "\n\n\t|||||||||||||||||||||||||||||||||\n\t|| MelloTrainer is Outdated ||\n\t|| Download the latest version ||\n\t|| From the FiveM Forums ||\n\t|||||||||||||||||||||||||||||||||\n\n" )
else
RconPrint( "\nMelloTrainer is up to date!\n" )
end
end, "GET", "", { what = 'this' } )
--[[------------------------------------------------------------------------
Steam Only Connection
------------------------------------------------------------------------]]--
AddEventHandler( 'playerConnecting', function( name, cb )
if ( Config.settings.steamOnly ) then
local id = DATASAVE:GetIdentifier( source, "steam" )
if ( id == nil ) then
cb( "This server requires you to be logged into the Steam client." )
CancelEvent()
end
end
end )