[Release] /me but the text is 3D printed

Hi, I’m a little bit stuck here and i wanted to know if someone knows how i can resolve this problem, so i used this resource to force an automatic message (The person pulls his phone out) when the player uses his phone (by clicking on ~/²) AND by using the animation used when you pull out the phone. This works perfectly but when i try to put the phone away (by clicking on ~/²) , the same message from earlier appears

here is the script i’m using :

Citizen.CreateThread(function()
	while true do
        Citizen.Wait(0)
		local playerPed = PlayerPedId()
			if IsEntityPlayingAnim(playerPed, 'cellphone_text_out', 'idle', 3) ~= 1 and IsControlJustPressed(0,243) then
                    TriggerServerEvent('3dme:shareDisplay3', text)
        end
	    end
    end)

what i want to do is use a specific message when the person pulls her phone out and another message when she “ranges” it.

any ideas on how i can do that ?

A better idea would be to add the trigger where you handle the keypress to pull up the phone.

Hi! I messed with the script a bit and tried to display the 3d text like seen in the gif, but the rectangle is moving around with the player. Do you know what I can do, that the rectangle doesn’t move around like that?

gif: https://gyazo.com/da37e2e06142b31abe90d3f0c5e3907f

Did you add the rectangle yourself or are you using an older version ? If you added it yourself, please share your code.

Anyone knows what could be the issue that no 3d printed output appears when I use

TriggerServerEvent('3dme:shareDisplay', 'Test ')

in another ressource client.lua?

EDIT: 3dme script is working fine with /me command

The trigger needs to be on the server side. For example :

RegisterServerEvent('trunkOpened')
AddEventHandler('trunkOpened', function()
	local Source = source
	local text = "* the person opened the trunk of the car *"
	TriggerClientEvent('3dme:shareDisplay', -1, text, Source)
end)

I have an error on the version 2.2 in the server.lua at the line 5.

-- ## 3dme : server side

-- Command
RegisterCommand('me', function(source, args)
    local text = "* " .. Languages[Config.language].prefix .. table.concat(args, " ") .. " *"
    TriggerClientEvent('3dme:shareDisplay', -1, text, source)
end)

The line 5 is
local text = "* " .. Languages[Config.language].prefix .. table.concat(args, " ") .. " *"

i don’t find the error… Somoene can help me please ?

Tank’s for your help

What’s the error ? Have you made any modifications to the files ?

This is the two errors i have, The fist when i start the script, the second when i write /me test

This is the line 88 and 89 of the client.lua

local LANGUAGE = Config.language

TriggerEvent(‘chat:addSuggestion’, ‘/’ … Languages[LANGUAGE].commandName, Languages[LANGUAGE].commandDescription, Languages[LANGUAGE].commandSuggestion)

And i didn’t modify anything, i just download and install it

Looks like the config file has an error or its doesn’t get loaded. Full logs would help.

It’s solved, i don’t know how…

But thank’s for help !

How would one go about adding a background color to this?

Check the previous versions, it used to have a background.

Hey Elio, sorry for the late response. This is the code I used:

local function DrawText3D(coords, text, color)

    local camCoords = GetGameplayCamCoord()

    local dist = #(coords - camCoords)

    local onScreen, _x, _y = World3dToScreen2d(coords.x, coords.y, coords.z)

    

    -- Experimental math to scale the text down

    local scale = 185 / (GetGameplayCamFov() * dist)

      if onScreen then

        -- Format the text

        SetTextProportional(1)

        SetTextColour(255, 255, 255, 250)

        SetTextEntry("STRING")

        SetTextScale(0.0, defaultScale * scale)

        SetTextDropshadow(0, 0, 0, 0, 0)

        SetTextDropShadow()

        SetTextCentre(1)

        SetTextFont(6)

        AddTextComponentString(text)

        

        -- Diplay the text

        BeginTextCommandDisplayText("STRING")

        AddTextComponentSubstringPlayerName(text)

        SetDrawOrigin(coords, 0)

        EndTextCommandDisplayText(0.0, 0.0)

        ClearDrawOrigin()

        local factor = (string.len(text)) / 280

        DrawRect(_x, _y + 0.0125, (0.035 + factor * scale), 0.025 * scale, 55, 55, 55, 150)

      end

end

Any way to do that when you pick up gun and it says:
Picks out gun.
And how to add it on esx_policjob
that when you arrest it says:
Arrest’s uncuff’s civilian.
Any help?