[Release] EasyAdmin, an advanced & customisable Admin Menu + Discord Bot

Can you make it so we know which admin banned/kicked who.

you can add that to the ban reason, for example:
line 45
reason = reason.." ( Nickname: "..GetPlayerName(playerId).. " )"

change that to

reason = reason.." ( Nickname: "..GetPlayerName(playerId).. " ), Banned by "..GetPlayerName(source)

Thank you so much for listening to our requests about the reason feature <3

1 Like

No problem, i’m also working on makingthe unban menu a bit more usable! :wink:

http://gay.furfag.de/hmm/thats/interesting/cdyengnn6lqurif.png

1 Like

He’ll yes! Would love to use that because the amount of times I’ve accidently banned myself is unbeleivable :joy:

Release 3.6(1)

Please Read!

This update ( sadly ) took a bit longer than expected due to unexpected hiccups when updating

NOTE: THIS UPDATE ** WILL ** CONVERT THE BANLIST TO A NEW FORMAT AND POSSIBLY BREAK THINGS, DOUBLE CHECK YOUR UPDATED BANLIST AFTER UPDATING TO THE NEWEST VERSION

I redesigned the main menu to be a bit bigger but less crowded with buttons, banlist refresh and changing between reasons and identifiers ( see below ) have also been added to the settings

The unban menu was made shinier, you can now display unban reasons or identifiers ( depending on need ), both didn’t fit.

The banlist file has been changed, it is now sorted to be one ban per line, works like following:
license:abecd;reason
license:hjdsas;another reason
This should make manual unbans easier

New bans will automatically have the banned users’ nickname + the banning admins name in the reason incase you have multiple admins, this will make it easier to identify them.

Plus! The banlist now refreshes every 5 minutes incase the banlist gets modifyed manually, this should take nothing but a (milli)second

Quickfix 3.61

after quickly looking trough the code i also noticed why the “unban” list may or may not populate, 3.61 should fix that now, i merged it with the 3.6 release so you will just have to download it from the releases section

oh and what i forgot to mention, this update prepares EasyAdmin for a thing :wink:

Have Fun!

3 Likes

i didnt update it yet but what license does it ban?

are you going to add other features like noclips and freezing and a teleport to a waypoint would be cool.

it bans your GTA V license that you recieve when you buy GTA, the bit of text you mentioned is part of the “options” with which you can change weither you want to view the ban reasons or identifiers in the unban menu

No as that can be handled by trainers.

Can you please tell me how to add other admins. Im still new to all of this .Lua stuff lol, Thanks

it’s really not hard, there is an “admins” table there, it even has a few examples

Right I did that, but I want to add multiple admins, how do I do that, I tried to do it myself and it wasn’t working, it would only have me as an admin.

admins = { 
"steam:A246A196C9", -- steamid64 converted to hex, this might need to be in lowercase, i didn't test
"license:examplelicence", -- license as displayed by FiveM
"ip:127.0.0.1", -- i don't recommend using an ip *at all*, but it still works
}

see what the example says, each new line is a new admin.

So I just repeat those for every admin?

Can you show me an example of what it should look like with more then 1 admin on the .Lua please?

just add another license / steamid for a new admin, like you did for yourself, so its

admins = { 
"steam:A246A196C9",  -- one admin
"steam:B5312BCEAH",  -- another admin
}

Can anyone help me out i have hit F2 and the menu is not opening and here is the admin_server

-- note that nothing has changed, i just added some examples, put your admins here as you've always did!
admins = { 
"steam:A246A196C9","steam:1100001172c095b","steam:110000109580091", -- steamid64 converted to hex, this might need to be in lowercase, i didn't test
"license:examplelicence", -- license as displayed by FiveM
"ip:127.0.0.1" -- i don't recommend using an ip *at all*, but it still works

}

Citizen.CreateThread(function()

RegisterServerEvent('amiadmin')
AddEventHandler('amiadmin', function()
	local numIds = GetPlayerIdentifiers(source)
	for i,admin in ipairs(admins) do
		for i,theId in ipairs(numIds) do
			if admin == theId then -- is the player an admin?
				TriggerClientEvent("adminresponse", source, true)
			end
		end
	end
end)

RegisterServerEvent("kickPlayer")
AddEventHandler('kickPlayer', function(playerId,reason)
	local numIds = GetPlayerIdentifiers(source)
	for i,admin in ipairs(admins) do
		for i,theId in ipairs(numIds) do
			if admin == theId then -- is the player requesting the kick ACTUALLY AN ADMIN?
				DropPlayer(playerId, "Kicked by "..GetPlayerName(source)..", Reason: "..reason)
			end
		end
	end
end)


RegisterServerEvent("banPlayer")
AddEventHandler('banPlayer', function(playerId,reason)
	local numIds = GetPlayerIdentifiers(source)
	for i,admin in ipairs(admins) do
		for i,theId in ipairs(numIds) do
			if admin == theId then -- is the player requesting the kick ACTUALLY AN ADMIN?
				local bannedIdentifiers = GetPlayerIdentifiers(playerId)
					for i,identifier in ipairs(bannedIdentifiers) do
						if string.find(identifier, "license:") then
							reason = reason.." ( Nickname: "..GetPlayerName(playerId).. " ), Banned by: "..GetPlayerName(source)
							reason = string.gsub(reason, "|", "") -- filter out any characters that could break me
							reason = string.gsub(reason, ";", "")
							updateBlacklist(identifier..";"..reason)
						end
					end
				DropPlayer(playerId, "Banned by an Admin, Reason: "..reason)
			end
		end
	end
end)

RegisterServerEvent("banCheater")
AddEventHandler('banCheater', function(playerId)

same here man, someone please help

Have you added the resource to server.cfg? (gotta ask the obvious questions)