You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created an ambient pickup on the client. I listened to the entityCreating event on the server.
The creation triggered the event, but when I run GetEntityModel(entity) it returns 0.
Expected result
GetEntityModel(entity) should return the pickup hash
Reproduction steps
Create this client command and run it:
RegisterCommand('test_pickup', function()
local pickupCoords = GetEntityCoords(PlayerPedId())
local weaponModel = GetHashKey("weapon_pistol")
local pickupHash = GetHashKey("PICKUP_WEAPON_PISTOL")
Citizen.CreateThread(function()
local pickup = CreateAmbientPickup(pickupHash, pickupCoords.x, pickupCoords.y, pickupCoords.z + 2.0, 0, 100, weaponModel, true, true)
end)
end)
Listen to the entityCreating event on the server and fetch the entity model:
While this still wouldn't return the correct model hash on the server-side weaponModel needs to be an actual model and not a weapon type (in your case w_pi_pistol).
What happened?
I created an ambient pickup on the client. I listened to the entityCreating event on the server.
The creation triggered the event, but when I run GetEntityModel(entity) it returns 0.
Expected result
GetEntityModel(entity) should return the pickup hash
Reproduction steps
Importancy
Unknown
Area(s)
FiveM, FXServer, Natives
Specific version(s)
Client 10939 / FXServer 10367 Windows
Additional information
No response
The text was updated successfully, but these errors were encountered: