eblio / 3dme Goto Github PK
View Code? Open in Web Editor NEWA FiveM script written in LUA that implements the /me command with 3D printing.
A FiveM script written in LUA that implements the /me command with 3D printing.
Hey, man I don’t know how to get in touch with you? Your last update for 3D me won’t work in my server anymore. Is their anyway I could get the 2 to lasted version?
How can I add a chat message to this script? Of course, it's best to display only for people nearby
Will it have /do and maybe even custom trigger?
Custom, I mean like, triggered by an event or export, with preset text, like "/me drawing an weapon", so it could be set everytime ped draws a gun or any other automatic commands who has them. :)
Today my server started experiencing whenever someone does /me then it will display the text on EVERY person in the server. This is new and I have had 3dme installed for at least 6 months and never experienced it before. Restarted the server stopped it for a bit, but it came back after a while
Sometimes /me goes global.
EG : 1 player does '/me test'
it appears on everyone.
Would be awesome if you added an option to print in the chat like this:
PlayerName: Message
i can see /me from 400 meters away is there a fix for it?
we love this script but we seem to not be able to remove the resource temporarily. once deleted it still is in there server
Hi, how can I change the coords of the text, for example it looks like this,
And I want to have the Blue text more UP than the red text I´ve got like this.
-- @desc Client-side /me handling
-- @author Elio
-- @Version 3.0
local c = Config -- Pre-load the config
local lang = Languages[Config.language] -- Pre-load the language
local peds = {}
-- Localization
local GetGameTimer = GetGameTimer
-- @desc Draw text in 3d
-- @param coords world coordinates to where you want to draw the text
-- @param text the text to display
local function draw3dText(coords, text)
local camCoords = GetGameplayCamCoord()
local dist = #(coords - camCoords)
-- Experimental math to scale the text down
local scale = 200 / (GetGameplayCamFov() * dist)
-- Format the text
SetTextColour(c.color.r, c.color.g, c.color.b, c.color.a)
SetTextScale(0.0, c.scale * scale)
SetTextFont(c.font)
SetTextDropshadow(0, 0, 0, 0, 55)
SetTextDropShadow()
SetTextCentre(true)
-- Diplay the text
BeginTextCommandDisplayText("STRING")
AddTextComponentSubstringPlayerName(text)
SetDrawOrigin(coords, 0)
EndTextCommandDisplayText(0.0, 0.0)
ClearDrawOrigin()
end
-- @desc Display the text above the head of a ped
-- @param ped the target ped
-- @param text the text to display
local function displayText(ped, text)
local playerPed = PlayerPedId()
local playerPos = GetEntityCoords(playerPed)
local targetPos = GetEntityCoords(ped)
local dist = #(playerPos - targetPos)
local los = HasEntityClearLosToEntity(playerPed, ped, 17)
if dist <= c.dist and los then
local exists = peds[ped] ~= nil
peds[ped] = {
time = GetGameTimer() + c.time,
text = text
}
if not exists then
local display = true
while display do
Wait(0)
local pos = GetOffsetFromEntityInWorldCoords(ped, 0.0, 0.0, 1.0)
draw3dText(pos, peds[ped].text)
display = GetGameTimer() <= peds[ped].time
end
peds[ped] = nil
end
end
end
-- @desc Trigger the display of teh text for a player
-- @param text text to display
-- @param target the target server id
local function onShareDisplay(text, target)
local player = GetPlayerFromServerId(target)
if player ~= -1 or target == GetPlayerServerId(PlayerId()) then
local ped = GetPlayerPed(player)
displayText(ped, text)
end
end
-- Register the event
RegisterNetEvent('3ddo:shareDisplay', onShareDisplay)
-- Add the chat suggestion
TriggerEvent('chat:addSuggestion', '/' .. lang.commandName, lang.commandDescription, lang.commandSuggestion)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.