fivem icon indicating copy to clipboard operation
fivem copied to clipboard

Crash on entity wipe

Open ScrachStack opened this issue 5 months ago • 5 comments

What happened?

RegisterCommand("entitywipe", function()
    local playerPed = cache.ped
    local playerCoords = GetEntityCoords(playerPed)

    local radius = 20.0 

    local entityPool = GetGamePool('CPed')
    for i = 1, #entityPool do
        local distance = #(GetEntityCoords(entityPool[i]) - playerCoords)

        if distance < radius then
                DeleteEntity(entityPool[i])
            
        end
    end

    RedTrainer.Notify("Entity Wipe", "20.0 Radius Wiped.", 'info')
end, true)
``` this code causes a crash

### Expected result

entity should have wiped

### Reproduction steps

run command above

### Importancy

Crash

### Area(s)

RedM

### Specific version(s)

REDM GAME BUILD 1491 LATEST artifacts AS OF 1/16/2024

### Additional information

![image](https://github.com/citizenfx/fivem/assets/122732007/ebeacfa9-881f-4c3b-ae12-9832e043dee7)
[CfxCrashDump_2024_01_16_18_06_23.zip](https://github.com/citizenfx/fivem/files/13954192/CfxCrashDump_2024_01_16_18_06_23.zip)

ScrachStack avatar Jan 16 '24 18:01 ScrachStack