Check is admin export

Does anyone know how i would go about doing a check is admin export for scripts.

for instance

isAdmin = export.es_extended.isAdmin() or isAdmin = exports["es_extended’]:isAdmin()

You’d need to make such function, for instance if you’re using JavaScript you could use .filter() or use a loop.

im using lua to try and make the function but i have not had any luck yet :’(

You would need to add this to the fxmanifest.lua of your es_extended or whatever script where you originally created the isAdmin Function

exports {
	'isAdmin'
}

that’s of course if you already set-up the function to return your admin status

im guessing i need to run the function through client to server?

Add this function to ^

self.isAdmin = function()
    return self.group == "admin"
end

Then you can simply use it whenever you create a Player instance, like:

local xPlayer = ESX.GetPlayerFromId(source) -- Not creating but getting an already existing player instance (ESX handles this you don't need to instantiate anything)

xPlayer.isAdmin()