[Bug] Crash when using GetGamePool(‘CObject’) JS #197
Closed
MosIbOad
started this conversation in
[BUG] FiveM for GTAV Enhanced
Replies: 2 comments
|
Sounds similar to #133, below is a workaround that seems to work for us local objects = {}
local handle, object = FindFirstObject()
if handle == -1 then return objects end
local success = true
while success do
if object and object ~= 0 and DoesEntityExist(object) then
objects[#objects + 1] = object
end
success, object = FindNextObject(handle)
end
EndFindObject(handle)
return objects |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
When GetGamePool(‘CObject’) is used, the game freezes for a moment and returns to the main menu
Issue type
Client
Repro rate
Always
Server build version
b96
OS
No response
CPU
No response
GPU
No response
RAM
No response
Storage type
None
Connection type
None
ISP and bandwidth
No response
DxDiag
No response
Network graph
No response
Platform
None
OS version / distribution
No response
CPU
No response
RAM
No response
Using txAdmin?
None
Hosting provider
None
Machine type
None
/perf endpoint output
No response
DDoS protection
No response
ulimit -n value (Linux only)
No response
Docker Compose file (Docker only)
No response
Steps to Reproduce
Just add this command and type “cobject” into the console; the game will freeze for a moment and then kick us out of the game.
I was able to test it in the JS module.
RegisterCommand('cobject', () => { const objectsArray = GetGamePool('CObject'); console.log('objects length: ' + objectsArray.length); }, false);Expected Behavior
There is no such issue in the Legacy version of FiveM; GetGamePool(‘CObject’) works without any problems.
Actual Behavior
The game should not freeze and the CObject data must be returned as a number[] array
Evidence
No response
Additional Context
No response
All reactions