Delete me 4

cl_general.lua

Starts line 234

Thank you <3 Worked <3

How do i make Weapons, admin only?

Make sure to make yourself admin.

Well, Mello trainer works again, on my new VPS server. But I am failing to add custom car category through JSON file. I don’t want to force players to spawn my add ons everytime through codes. Is it possible? If so, what I might be doing wrong here? After server reset, there is no custom category, just standard ones. Pic below

JSON%20test

EDIT.: I managed to finally get it working, to create whole new car class visible in in-game trainer. But I couldn’t click it through, so I went to mellotrainer/nui/trainer file, did exactly the same with other categories and Mello isn’t working at all. Again. FFS! Deleteing cache both on client and Server didn’t help. Could somebody post tutorial how to do this right? :confused:

SOLVED

nui://mellotrainer/nui/trainer.js:747, Uncaught TypeError: Cannot read property ‘menu’ of undefined

@Claush
@Lior_boehm
@Endernix - maybe you were doing some unfortunate file changes as well… Hope this helps!

When I was adding new category of cars to spawn, I’ve broke the code chain. Basically, I didn’t know where to look and what to edit and how. That’s why Mello wasn’t loading on my server.

You need to properly add new informations in 3 files in “nui” folder - for all this I recommend Notepad++:

mellotrainer.JSON
trainer.html
trainer.js

Since my server is getting close to almost 200 add on vehicles and with special handling for all of them, I wanted to add new category for sedans, “Sedans C”

More details in provided picture below as an example for NEW category of vehicles:

Hope picture is understandable enough and don’t forget to SAVE the files and restart Mello through console (or better yet, whole server).

Have fun editing this!!! :slight_smile:

which file do i edit so that only admins can see some of the options. like the online players tab?

Resolved the issue. warblgarble.

I’m trying to resolve all of the menu conflicts and I would like to change the noclip menu to open with CTRL+F1 instead of F2.

This seems to be the important bit:

if ( IsControlJustReleased( 0, 289 ) or IsDisabledControlJustReleased( 0, 289 ) ) and GetLastInputMethod( 0 ) and ((settings["adminOnlyNoclip"] == true and adminStatus == true) or settings["adminOnlyNoclip"] == false) then toggleNoClipMode() end

And I found this in a lot of spots in the code, seems to be a keymap:

["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57, ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177, ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18, ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182, ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81, ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70, ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178, ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173, ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118

So I tried changing it to this:

if ( IsControlJustReleased( 36, 288 ) or IsDisabledControlJustReleased( 36, 288 ) ) and GetLastInputMethod( 0 ) and ((settings["adminOnlyNoclip"] == true and adminStatus == true) or settings["adminOnlyNoclip"] == false) then toggleNoClipMode() end

Which just causes noclip menu to open on either F1 or CTRL+F1.

Is there a way to bind this menu to a combined keypress?

It’s not. It’s a misleading table that people should just forgot about. GTA Natives don’t know about “keys”, instead they only know about “controls”. This allows natives to do stuff on the controls (e.g. “move_forward” control) without having to deal with other keyboard layouts or any other headaches that using keys would entail.

https://wiki.fivem.net/wiki/Controls

Thanks very much for the link and explanation. Am I correct that it would not be possible with the current code to apply a CTRL+F1 keybind to that menu?

Assuming you have “DUCK” bound to left CTRL and “INPUT_REPLAY_START_STOP_RECORDING” to F1. Yes. I imagine you could do something like

if (IsControlJustPressed(0, 38) --[[ DUCK ]] and IsControlJustPressed(0,288) --[[ INPUT_REPLAY_START_STOP_RECORDING ]] ) then
    -- do something
end

The Mello trainer on our server has a lot of input lag. I read in earlier comments that we are not the only ones experiences this issue. I tried a clean Mello trainer on a clean FX server, but the input lag stays. It’s pretty hard to select the correct menu item when it keeps skipping items. Does anyone have an idea what causes this and/or how to fix said issue?

1 Like

has anyone else had the issue of “childish trolls” hooking into mello to kick and ban people, i had this during a stream last night,

to avoid this happening i commented out this from sv_admin.lua
once i disabled this they then proceeded to explode all vehicles but i’m unsure how they are doing this, any help would be appreciated

--[[------------------------------------------------------------------------
	Kick Player 
------------------------------------------------------------------------]]--
--[[RegisterServerEvent( 'mellotrainer:adminKick' )
AddEventHandler( 'mellotrainer:adminKick', function( id, reason ) 
	DropPlayer( id, reason )
end )]]--

--[[------------------------------------------------------------------------
	Temp Ban Player 
------------------------------------------------------------------------]]--
--[[local tempBannedUsers = {}

RegisterServerEvent( 'mellotrainer:adminTempBan' )
AddEventHandler( 'mellotrainer:adminTempBan', function( id ) 
	local license = DATASAVE:GetIdentifier( id, "license" )

	if ( license ~= nil ) then 
		tempBannedUsers[license] = true 
		DATASAVE:print( GetPlayerName( id ) .. " has been temporarily banned by " .. GetPlayerName( source ) .. "." )
		DropPlayer( id, "Banned: You have been temporarily banned." )
	end 
end ) 

AddEventHandler( 'playerConnecting', function( name, setReason ) 
	local license = DATASAVE:GetIdentifier( source, "license" )

	if ( license ~= nil ) then 
		if ( tempBannedUsers[license] ) then 
			DATASAVE:print( GetPlayerName( source ) .. " is temporarily banned, refusing connection." )
			setReason( "Banned: You have been temporarily banned." )
			CancelEvent()
		end 
	end 
end ) ]]--

--[[------------------------------------------------------------------------
	Kill Player 
------------------------------------------------------------------------]]--
--[[RegisterNetEvent( 'mellotrainer:s_adminKill' )
AddEventHandler( 'mellotrainer:s_adminKill', function( id ) 
	TriggerClientEvent( 'mellotrainer:adminKill', id )
end ) ]]--

--[[------------------------------------------------------------------------
	Teleport Plsyer 
------------------------------------------------------------------------]]--
--[[RegisterNetEvent( 'mellotrainer:s_adminTp' )
AddEventHandler( 'mellotrainer:s_adminTp', function( id ) 
	TriggerClientEvent( 'mellotrainer:adminTp', id, source )
end )]]--

Hey, I was having an issue with some input lag and its really upsetting because I can never select something on the menu, I have reset my fivem and redownloaded it on my FXserver, please help. This might be just my computer or something because my LEO menu wont work also and a couple other things

If I see how many people have this, then it’s either an incompatibility between the Mello trainer and FiveM or a client sided change that made the Mello trainer work improperly. Maybe the latest FiveM updates broke something?

Continuing the discussion from [Release][v0.5.5] Mello Trainer [Server Sided][Custom Permissions]:

Yeah but it works for everyone else on my server just fine. I don’t understand

I’ve also had issues before the newest FiveM update on my server

We ended up removing it completely last night, the only way to stop the ‘kiddie scripters’ some serious vulnerabilities in these add-ons.

Awesome trainer though!

Is there custom permissions that only certain people in certain group can have certain peds, vehicles and weapons. E.g: Police can have police ped, police cars, no guns