altv-issues
altv-issues copied to clipboard
Extending object api
Description of the problem
Atm there is not exists some methods which people use with createObject natives So, there is not enough functionality to switch to object api
- [ ] slideObject
- [x] setEntityCollision(object, false, false); // to toggle collision
- [x] detach with dynamic parameter
- [x] freezeEntityPosition
- [x] placeObjectOnGroundProperly
- [ ] getCoordsAndRotationOfClosestObjectOfType
- [ ] And also there is opened question how to correctly provide alt.Object to webview renderer
Desired solution for the problem
add
- obj.slideObject(vector3,speed:vector3, collision)
- obj.collision:boolean
- obj.detach(makeDynamic)
- obj.freeze:boolean
- obj.placeObjectOnGround(vector3)
- alt.Object.all.closest(pos:vector3,radius:float, hash)
Alternatives you considered
No response
Additional context
No response
Version
No response
As written in the scripting info post you can use natives together with the object api.
const localPlayer = alt.Player.local;
const object = new alt.Object("sm_prop_smug_crate_s_jewellery", localPlayer.pos, new alt.Vector3(0, 0, 0));
await alt.Utils.waitFor(() => object.isSpawned));
native.setEntityCollision(object.scriptID, false, false);
in the future more apis might be added.
Ok, but I we are talking about future server side object api, I think this is must have things
This has low prio for now, because you can do all of these things with natives.