Make /me stick

Hi ! My Community wants to have like /me stick on the character and remove it with another command like /removeMe.
It’s like scenes but on the character its self
is ther anyone that want to help me ?

Are you referring to animations? If so, you’ll be interested in the following native:

No. Draw text like this

but it sticks on the charahter and can easly be change or deleted with a command

I’m not quite sure if you want to modify aforementioned script (3dme) or if you are in the progress of creating your own.

It seems like you want to extend the aforementioned script “3dme”. This is fairly simple just add a new command and a event to remove me message again. Here is some quick code to get you started:

Client:

RegisterNetEvent('3dme:removeDisplay', function(target)
    local player = GetPlayerFromServerId(target)
    
    if player ~= -1 or target == GetPlayerServerId(PlayerId()) then
        local ped = GetPlayerPed(player)

        if peds[ped] ~= nil then
            -- Setting the time to zero will ensure it getting removed next tick by this line:
            -- https://github.com/eblio/3dme/blob/e02813ffb33e9a2937df445a63902fef379b1ef8/client.lua#L64
            peds[ped].time = 0
        end
    end
end)

Server:

RegisterCommand('removeme', function(source)
  TriggerClientEvent('3dme:removeDisplay', -1, source)
end)

While the above code should work, there are some issues with the 3dme script:

  • It doesn’t seem to handle players getting out/in of scope when using onesync (the radius where clients see other)
  • Players leaving the server while having a me attached will never get removed and will be displayed at 0, 0, 0 indefinitely.

These issues will be a (huge) problem if you want these text to stick around until removed by the command. Also keep in mind “3dme” was not created with your usage case in mind (displaying the text until removed)

You could use (or create) an alternative which takes these issues into account (maybe using state bags). If you are in the already in process of creating your own script please share your code so we can see how it works and therefor better help you.

1 Like