Legacy Crash hash: pip-edward-vermont

I’ve been using the Envi-Trap phone, and I’ve noticed that many others, including myself, are experiencing crashes. After extensive testing (over 40 hours of work), I went through the process of elimination:

  • Tested with and without MLOs, clothing, and custom cars.
  • Removed one script at a time to narrow it down.

The conclusion? The crashes only stop when the Envi-Trap phone script is removed.

It’s an excellent script, but even the developer isn’t sure what’s causing the issue. From what we’ve observed, it seems to be related to some kind of speech bug. The crashes often occur while carjacking peds, especially gang members.

Anyone else encountering this or have insights on how to fix it? MANY server owners are having this issue. Envi is saying its something with the update

HERE IS A LINK TO SOME OF THE PROBLEMS A LOT OF PLAYERS/OWNERS ARE HAVING.

Does anyone know what is going on??

CfxCrashDump_2025_01_28_04_33_22.zip (1.7 MB)

1 Like

Hey, We have been experiencing the same issues, For now we have reverted to Envi Trap Phone 1.5 Until a new Update or Fix is pushed, This has stopped the crashing for us, hope this helps you as well

1 Like

Yep its a widespread issue.

Did envi fix this yet ?

There wasn’t anything for me to fix, if you check the github issue it seems that cfx devs confirmed it was due to an update they pushed. I think too many people are seeing this post and considering this information as the sole reason that they may have a crash with this code. One user in particular had almost 150 maps in their server and found the crashes no longer occured when they removed them. This is much more of an internal CFX thing so if there are still issues I would suggest commenting on the Github issue or raising a new one. I have not heard widespread reports of this from new customers of the script in a long time. My best advice around this issue can be found here:

Happy to discuss this further with anyone having the issue and of course happy to work with the CFX team to help try work out the root cause if any issue does still persist that isnt being widely reported to me

1 Like

so is it fixed?

We are still crashing when we have trap phone in, take it out its perfect.

can confirm this issue is still present to this day.

1 Like

We dont get the error, when gang settings disabled

1 Like

funny thing is, we dont use envi trap phone, dont even own it either :rofl:
that is what makes this even more confusing.

Hello, this is a huge issue in my city. Has anyone found the solution or narrowed anything down?Thanks.

I am currently pushing an update to trap phone that I am 99% sure will fix any crashes related to my script. After doing extensive testing with @Senlar and some other customers who were experiencing this I have found the root cause that causes hang-ups.

To give some insight to anyone who may be experiencing this issue; I believe it is related to the Native populationPedCreating event handler.

Specifically when replacing a model and requesting the model within the event handler such as:

    AddEventHandler('populationPedCreating', function(x, y, z, model, setters)
        local zoneData = CurrentZoneData()
        if not zoneData then
            return
        end
        local zoneKey = zoneData.zone
        if not zoneKey or not zoneData.gangControl then
            return
        end
        if zoneData.gangControl and zoneData.gangSpawnRate then
            local spawnRate = zoneData.gangSpawnRate
            if math.random(1, 100) <= spawnRate then
                local gang = zoneData.gangControl
                local randomGangPed = Config.Gangs[gang].models[math.random(1, #Config.Gangs[gang].models)].model
                RequestModel(randomGangPed)
                while not HasModelLoaded(randomGangPed) do
                    Wait(0)
                end
                setters.setModel(randomGangPed)
            end
        end
    end)

I found the fix to be preloading the model into memory:

    CreateThread(function()
        for gang, gangData in pairs(Config.Gangs) do
            if gangData.models then
                for _, modelData in pairs(gangData.models) do
                    if modelData.model then
                        Framework.LoadModel(modelData.model)
                    end
                end
            end
        end
    end)

    AddEventHandler('populationPedCreating', function(x, y, z, model, setters)
        local zoneData = CurrentZoneData()
        if not zoneData then
            return
        end
        local zoneKey = zoneData.zone
        if not zoneKey or not zoneData.gangControl then
            return
        end
        if zoneData.gangControl and zoneData.gangSpawnRate then
            local spawnRate = zoneData.gangSpawnRate
            if math.random(1, 100) <= spawnRate then
                local gang = zoneData.gangControl
                local randomGangPed = Config.Gangs[gang].models[math.random(1, #Config.Gangs[gang].models)].model
                if not HasModelLoaded(randomGangPed) then
                    return
                end
                setters.setModel(randomGangPed)
            end
        end
    end)

Hope this helps put an end to the mystery, if you are experiencing this crash, investigate your server and find which resource may be replacing ped models :smile:

1 Like