Sleepless-Development / sleepless_interact

https://sleeplessdevelopment.dev/interact
GNU General Public License v3.0
42 stars 14 forks source link

Interact Not Showing #13

Open LynxarA-Coding opened 3 days ago

LynxarA-Coding commented 3 days ago

Installation process: Standalone Server (cfx default)

  1. Installed both ox_lib and interact
  2. They are both ran on startup
  3. My code (client-side):
    
    local hash = "prop_vend_snak_01"

-- Requesting Model so it can be spawned RequestModel(hash) while not HasModelLoaded(hash) do Wait(500) end -- get nearest vehicle to player local entityId = CreateObject(hash, coordsx, coordsy, coordsz - 1.0, true, true, true) local networkId = NetworkGetNetworkIdFromEntity(entityId)

-- Test command to add interact to the entity RegisterCommand("lynspawn", function() exports.sleepless_interact:removeEntity("uniqueNetworkedEntityId") interact.addEntity({ id = "uniqueNetworkedEntityId", netId = networkId, -- Example network ID options = { { label = "Networked Interact Option", icon = "hand", -- Example simple FA icon name onSelect =function(data) print("Networked entity action triggered") end, canInteract = function(entity, distance, coords, id) return true end }, }, renderDistance = 10.0, activeDistance = 2.0, cooldown = 1500 }) end)



As you can see, I removed item and group requirement just in case (testing on fully standalone server)
Interact doesn't show up on the object after using this command. There are no errors in client/server consoles
![image](https://github.com/user-attachments/assets/30e3fa25-1c9c-4a72-919e-4bc6c82cfec3)
LynxarA-Coding commented 3 days ago

The issue was that this script doesn't work in cfx-default, but only in esx, qb, ox. There was no mention of it anywhere, I checked.

Demigod916 commented 3 days ago

Yes, you will need to make your own bridge tor any non supported framework