I have tried to research for some possible solutions but got myself stuck. I am trying to make it so a player can go the Surgeon on the map that will prompt them with something like:
Press E to use surgeon
If the user hits E I want it to come up with the same thing it does when a player first joins the server (the skinchanger menu) and allow them to change what they look like obviously it saving to the database as it usually does. I have only got as far as creating the blip and setting up the function to detect when the player is around the blip.
esx_skin/client/main.lua
local blips = {
-- Example {title="", colour=, id=, x=, y=, z=},
--{title="Example 1", colour=5, id=446, x = -347.291, y = -133.370, z = 38.009},
{title="Surgeon Ronny ", colour=16, id=280, x = 1551.598, y = 3799.983, z = 34.41115}
}
Citizen.CreateThread(function()
for _, info in pairs(blips) do
info.blip = AddBlipForCoord(info.x, info.y, info.z)
SetBlipSprite(info.blip, info.id)
SetBlipDisplay(info.blip, 4)
SetBlipScale(info.blip, 1.0)
SetBlipColour(info.blip, info.colour)
SetBlipAsShortRange(info.blip, true)
BeginTextCommandSetBlipName("STRING")
AddTextComponentString(info.title)
EndTextCommandSetBlipName(info.blip)
end
end)
-- Enter / Exit marker events
Citizen.CreateThread(function()
while true do
Wait(0)
local coords = GetEntityCoords(GetPlayerPed(-1))
-- if player is within 5m? then...
if(GetDistanceBetweenCoords(coords, info.x, info.y, info.z, true) < 5) then
-- show prompt to user - "Hit E to enter the surgeon"
end
end
end)