[FREE] [ESX] vms_subway

hey, it is a simple script for the subway, UI with stations. We choose the station we want to be at, buy a ticket and the countdown to the end appears on the screen.

now everything is unlocked, you can download the latest version.

ESX it is ONLY for a buying ticket via callback but if it is open source I think that anyone can convert the script into their own server even if they do not use ESX but eg QB or delete it because they want free tickets.

1 Like

Thanks.

sick :fire: :fire: :fire: :fire:

Looks like this

ok this is paid and it costs $10 for normal teleports with ui and mine is free.

But the design is very similar :thinking:

visually? You are talking about a map that is available on the sc1_23_tram.ytd object?
just explain to me why there is a script on sale that was already public in 2018 - GitHub - qalle-git/esx_teleports: Script that can teleport between places, you can specify a job

We are talking about design and not about code you could have played this card differently but you made it look like something that is already on sale

1 Like

Can you help me i downloaded this resource and put it in resource i started it and it is correctly started but when i am in game i cant see map blips and dont work ? any help… ESX server

1 Like

For anyone wanting this to work fully with QB here ya go…

Client
currentStation, opened = nil, false

local QBCore = exports['qb-core']:GetCoreObject()

Citizen.CreateThread(function()

    while true do

        local playerPed = PlayerPedId()

        local currentStation = nil

        for k, v in pairs(Config.Stations) do

            local playerCoords = GetEntityCoords(playerPed)

            local distance = #(playerCoords - v.ticketBuy)

            if distance < 12.0 and not IsPedInAnyVehicle(playerPed, false) then

                DrawMarker(1, v.ticketBuy, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.MarkerSize, Config.RGB[1], Config.RGB[2], Config.RGB[3], 100, false, true, 2, false, false, false, false)

                currentStation = v.stationNumber

            end

            if distance < 1.5 and not opened then

                SetTextComponentFormat('STRING')

                AddTextComponentString("Press ~INPUT_CONTEXT~ to buy a ~y~Metro Ticket~s~")

                DisplayHelpTextFromStringLabel(0, 0, 1, -1)

                if IsControlJustPressed(0, 38) then

                    -- TriggerEvent('codem-blackhudv2:SetForceHide', true)

                    TriggerScreenblurFadeIn(1000)

                    OpenStationsMenu(currentStation)

                    currentStation = nil

                end

            end

        end

        if currentStation == nil then

            Citizen.Wait(1000)

        end

        Citizen.Wait(1)

    end

end)

RegisterNUICallback("action", function(data, cb)

    if data.action == "close" then

        CloseStationsMenu()

    elseif data.action == "transport" then

        if data.station ~= currentStation then

            for k, v in pairs(Config.Stations) do

                if v.stationNumber == data.station then

                    QBCore.Functions.TriggerCallback("vms_subway:getMoney", function(get)

                        if get then

                            Teleport(v.exitMetro)

                        else

                             QBCore.Functions.Notify("You dont have money.")

                        end

                    end, v.price)

                end

                CloseStationsMenu()

            end

        end

    end

end)

OpenStationsMenu = function(crntStation)

    opened = true

    SetNuiFocus(true, true)

    SendNUIMessage({action = "open", station = Config.Stations, currentNumber = crntStation})

end

CloseStationsMenu = function()

    opened = false

    SetNuiFocus(false, false)

    SendNUIMessage({action = "close"})

    -- TriggerEvent('codem-blackhudv2:SetForceHide', false)

    TriggerScreenblurFadeOut(1000)

end

Teleport = function(spawnCoords)

    -- TriggerEvent('codem-blackhudv2:SetForceHide', true)

    DoScreenFadeOut(1000)

    Citizen.Wait(575)

    SendNUIMessage({action = "enter"})

    local finished = nil

    CreateThread(function()

        local start = GetGameTimer()/1000

        while GetGameTimer()/1000 - start < Config.SubwayTimer do

            Wait(1000)

        end

        finished = true

        SetEntityCoords(PlayerPedId(), spawnCoords)

        DoScreenFadeIn(1000)

        Citizen.Wait(575)

        SendNUIMessage({action = "exit"})

        -- TriggerEvent('codem-blackhudv2:SetForceHide', false)

    end)

    while finished == nil or not finished do

        Wait(0)

    end

    return

end
Server
local QBCore = exports['qb-core']:GetCoreObject()

QBCore.Functions.CreateCallback('vms_subway:getMoney', function(source, cb, price)

    local xPlayer = QBCore.Functions.GetPlayer(source)

    local price = math.abs(price) -- simple protection against cheaters

    if xPlayer.PlayerData.money.cash >= price then

    -- if Player.getMoney() >= price then

        xPlayer.Functions.RemoveMoney('cash', price)

        cb(true)

    else

        cb(false)

    end

end)

If you happen to use Codem BlvckhudV2, you can uncomment TriggerEvent('codem-blackhudv2:SetForceHide', false) and TriggerEvent('codem-blackhudv2:SetForceHide', true).
I also added a blur effect to background while in the menu.

If anyone wants a version that supports both frameworks, I believe I edited it to work for both although I don’t have an ESX server to test. Find it here: vms_subway_edit

If you want just a QB version, disregard my github link and do the edits I mentioned above. :slight_smile:

2 Likes

And? As he said the map is available and even if he made it look like something that’s on sale, there’s no issue with that as long as the code is not the same.

That’s right he copied the design and uses it. I marked the topic and I don’t see the point of having a conversation anymore. :slightly_smiling_face:

1 Like

Okay mr “I marked the topic” At least this guy contributing and made it for free. There’s absolutely nothing wrong with this release nor every other release that you had a negative comment on. There’s forum mods for a reason so there’s no need for you to jump to every release, have negative comments and arguments when you can just report it.

If you don’t say that a person copied someone else’s design and passes it off as his own, then everyone will do so and see nothing wrong with stealing. There is no need to hide behind a contribution to the community when the idea is not yours, as well as the design.

Capture

Unable to use under QBCore

Just remove the dependency ‘/assetpacks’ from the fxmanifest.lua or just get it from his tebex and then use the code above for qb

You’re really brainded if you dont understand that those ui map is PUBLIC on “sc1_23_tram.ytd”. As we can see you’re like…

local dev = stupid

if stupid == true then
saySomethingStupid()
end

1 Like