Probleme Smoke and the water

Hello i think i have a problem.

The smoke and the water is bugged because if you don"t have money on you, you can consume the drogs.
Or normaly you can’t. Anyone know why ? Or how to debug it ?

this is the script basic, if you want to link it to the es mod money system, you need to adjust the server

Thank you, but how i can adjust for the server ?

        -- Start mission
        if(IsControlPressed(1, 38)) then
          TriggerServerEvent("es_freeroam:pay", tonumber(50))
          Toxicated()
          MISSION.start = true

you needd to have the paay event created in your server

What i don"t understand how to …
Sorry im a beginner

Can you provide a link to this shop code ? I’d be curious to have a look.

Its not a shop, its an events in the es_freeroam

local thisPed
local pedCoords = {}
local storedPeds = {}
local blips = {
  -- Smoke on the water
  {x=-1171.42, y=-1572.72, z=3.6636},
}

local MISSION = {}
MISSION.start = false
MISSION.wanted = false
local playerCoords
local playerPed

showStartText   = false

--blips
local BLIP = {}
Citizen.CreateThread(function()
    while true do
       Wait(0)

       RequestAnimSet("[email protected]@SLIGHTLYDRUNK")
           while not HasAnimSetLoaded("[email protected]@SLIGHTLYDRUNK") do
            Citizen.Wait(0)
           end

       playerPed = GetPlayerPed(-1)
       playerCoords = GetEntityCoords(playerPed, 0)
      smoketick()
    end
end)

function smoketick()
    --Show notification, when player is near the weedshop
    if(MISSION.start == false) then
    for _, item in pairs(blips) do
    if(GetDistanceBetweenCoords(playerCoords, item.x, item.y, item.z) < 10) then
            if(showStartText == false) then
                DealText()
            end
            -- Start mission
            if(IsControlPressed(1, 38)) then
              TriggerServerEvent("es_freeroam:pay", tonumber(50))
              Toxicated()
              MISSION.start = true
            end
          else
            showStartText = false
          end --if GetDistanceBetweenCoords ...
        end -- end for
      end--if MISSION.start == false

          if(MISSION.start == true) then
            Citizen.CreateThread(function()
              while true do
                Wait(0)
                playerPed = GetPlayerPed(-1)
                playerCoords = GetEntityCoords(playerPed, 0)
                vehCheck = IsPedInAnyVehicle(GetPlayerPed(-1), true)
                -- Check if the player is inside a vehicle
                if vehCheck and MISSION.start == true  then
                  -- Set the player wanted
                  SetPlayerWantedLevel(GetPlayerPed(playerPed),1,false)
                  SetPlayerWantedLevelNow(GetPlayerPed(playerPed),false)
                end
              end
            end)
            Citizen.Wait(120000)
            reality()
            MISSION.start = false
          end -- end mission.start
        end -- end tick

        function Toxicated()
          TaskStartScenarioInPlace(GetPlayerPed(-1), "WORLD_HUMAN_DRUG_DEALER", 0, 1)
          Citizen.Wait(5000)
          DoScreenFadeOut(1000)
          Citizen.Wait(1000)
          ClearPedTasksImmediately(GetPlayerPed(-1))
          SetTimecycleModifier("spectator5")
          SetPedMotionBlur(GetPlayerPed(-1), true)
          SetPedMovementClipset(GetPlayerPed(-1), "[email protected]@SLIGHTLYDRUNK", true)
          SetPedIsDrunk(GetPlayerPed(-1), true)
          DoScreenFadeIn(1000)
        end

        function reality()
          Citizen.Wait(50000)
          DoScreenFadeOut(1000)
          Citizen.Wait(1000)
          DoScreenFadeIn(1000)
          ClearTimecycleModifier()
          ResetScenarioTypesEnabled()
          ResetPedMovementClipset(GetPlayerPed(-1), 0)
          SetPedIsDrunk(GetPlayerPed(-1), false)
          SetPedMotionBlur(GetPlayerPed(-1), false)
          -- Stop the mini mission
          Citizen.Trace("Going back to reality\n")
        end

        function DealText()
          DrawMarker(1, -1171.42, -1572.72, 3.6636, 0, 0, 0, 0, 0, 0, 4.0, 4.0, 2.0, 178, 236, 93, 155, 0, 0, 2, 0, 0, 0, 0)
          ShowInfo("Appuie sur ~INPUT_CONTEXT~ pour acheter de la drogue.", 0)
        end

        function DrawMissionText(m_text, showtime)
          ClearPrints()
          SetTextEntry_2("STRING")
          AddTextComponentString(m_text)
          DrawSubtitleTimed(showtime, 1)
        end

        function ShowNotification(text)
          SetNotificationTextEntry("STRING")
          AddTextComponentString(text)
          DrawNotification(true, false)
        end

        function ShowInfo(text, state)
          SetTextComponentFormat("STRING")
          AddTextComponentString(text)DisplayHelpTextFromStringLabel(0, state, 0, -1)
        end

Not FiveM’s problem, post this in the topic for ‘es freeroam’.

1 Like