Clipboard

Just a simple import for setting clipboard text.
It works by waiting for a keypress event on the nui. Do whatever with it. lul

AddEventHandler('playerSpawned', function ()
    local playerPed = PlayerPedId()
    local coords = GetEntityCoords(playerPed)

    if not exports.clipboard:SettingClipboard() then
        exports.clipboard:SetClipboard(json.encode({
            x = coords.x,
            y = coords.y,
            z = coords.z,
            model = GetEntityModel(playerPed),
            heading = GetEntityHeading(playerPed)
        }), function (err)
            print('SET CLIPBOARD SUCCESS?', not err)
        end) 
    end
end)

– /uploads/default/original/3X/8/e/8e40ed9503f47702dd162d46966c43c51564deb3.zip

Edit: Download moved to github

3 Likes

I’m confused, what does this actually do? Screenshots?

1 Like

This snippet looks to add some details about your character (coordinates, model, heading/rotation) and adds it to your clipboard at spawn so you can paste it outside of FiveM? Maybe? If you can set your clipboard from FiveM that could be really helpful for setting locations and debugging. Definitely intrigued.

1 Like

Ah, copies to clipboard. My dumb brain was thinking this was for putting text on a clipboard in-game :stuck_out_tongue:

You’re not the only one lmao

1 Like