[Release][ESX / vRP / Standalone] Drag & Drop chat command packs

It works fine now! Thanks man, your job is amazing and you are amazing!

Anyone know how to make it so you dont have to type /ooc to talk out of character. Instead it just automatically dose an OOC message?

FiveM to Discord is no longer available. Just an FYI.

@glitchdetector hi !

i got a bit of an issue here, could you help me a bit ?
your script show my fivem name (or whatever it is) and not the esx_identity name

have i missed something ? :thinking:

It’s very possible that the method of getting the identity name in ESX has changed over the years. I don’t use ESX and don’t follow their updates, so I’m unable to troubleshoot this at the moment.

ok thanks for your reply anyway, i can live with that for the moment.

but if anyone see this and got a solution (for esx 1.1 final) i’ld be glad to get it :grin:

This is the method that is used to obtain the players identity, at the time no function existed for this purpose. If you have some other resource that fetches the players identity, see if you can copy that over there.

    local xPlayer = ESX.GetPlayerFromId(source)
    MySQL.Async.fetchAll('SELECT firstname, lastname FROM users WHERE identifier = @identifier', {['@identifier'] = xPlayer.identifier},
    function(data) 
        if (data[1] ~= nil) then
            local firstName = data[1].firstname
            local lastName = data[1].lastname
            cb(firstName, lastName)
        else
            cb(false)
        end
    end)

i got this one in another script working but i got trouble to understand your part and edit it correctly, i have to admit it’s way over my knoweldge :joy:

each time i tried to edit it i get error message saying commands dont exist but i’m not surprised since it seem to be a different layout (also a servercallback, not a function, dunno if it change something tbh)

function getIdentity(source, callback)
	local xPlayer = ESX.GetPlayerFromId(source)

	MySQL.Async.fetchAll('SELECT identifier, firstname, lastname, dateofbirth, sex, height FROM `users` WHERE `identifier` = @identifier', {
		['@identifier'] = xPlayer.identifier
	}, function(result)
		if result[1].firstname ~= nil then
			local data = {
				identifier	= result[1].identifier,
				firstname	= result[1].firstname,
				lastname	= result[1].lastname,
				dateofbirth	= result[1].dateofbirth,
				sex			= result[1].sex,
				height		= result[1].height
			}

			callback(data)
		else
			local data = {
				identifier	= '',
				firstname	= '',
				lastname	= '',
				dateofbirth	= '',
				sex			= '',
				height		= ''
			}

			callback(data)
		end
	end)
end

and this it the similar function directly in esx_identity i use, it’s looking a bit more similare maybe it’s a better way to go, i’ll keep trying to understand exactly how work your part
:yum:

 local ok, firstName, lastName = getESXPlayername()

this line especialy, it’s the first time i see something like that