@Lex_The_Great I hope you can add this so it can help players. This iswhat I changed in the client.lua. Basically I added the function drawTxt above the incircle=false. This will allow text to form under the current circle to state for the playe to Press the G key to spawn the train. I hope this helps. Also I added a photo to show how the end result works.
function drawTxt(text, font, centre, x, y, scale, r, g, b, a)
SetTextFont(font)
SetTextProportional(0)
SetTextScale(scale, scale)
SetTextColour(r, g, b, a)
SetTextDropShadow(0, 0, 0, 0, 255)
SetTextEdge(1, 0, 0, 0, 255)
SetTextDropShadow()
SetTextOutline()
SetTextCentre(centre)
SetTextEntry("STRING")
AddTextComponentString(text)
DrawText(x, y)
end
incircle = false
Citizen.CreateThread(function()
Log("Train Markers Init.")
while true do
Wait(0)
if Config.ModelsLoaded then
for i=1, #Config.TrainLocations, 1 do
local coords = GetEntityCoords(GetPlayerPed(-1))
local trainLocation = Config.TrainLocations[i]
if(GetDistanceBetweenCoords(coords, trainLocation.x, trainLocation.y, trainLocation.z, true) < Config.DrawDistance) then
DrawMarker(Config.MarkerType, trainLocation.x, trainLocation.y, trainLocation.z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize.x, Config.MarkerSize.y, Config.MarkerSize.z-2.0, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false)
drawTxt('Press ~g~G~s~ to Spawn~b~ Train', 2, 1, 0.5, 0.8, 0.6, 255, 255, 255, 255)
end
if(GetDistanceBetweenCoords(coords, trainLocation.x, trainLocation.y, trainLocation.z, true) < Config.MarkerSize.x / 2) then
if(IsControlPressed(0,58) and(GetGameTimer() - Config.EnterExitDelay) > Config.EnterExitDelayMax) then -- G
Config.EnterExitDelay = 0
Wait(60)
createTrain(trainLocation.trainID, trainLocation.trainX, trainLocation.trainY, trainLocation.trainZ)
end
end
end
end
end
end)
This is the file in its entirety. I hope this helps with your script.
client.lua (6.1 KB)