New Admin Commands & Register Usable Item Feature#87
New Admin Commands & Register Usable Item Feature#87Alphazinn wants to merge 2 commits intoND-Framework:mainfrom
Conversation
|
Thank you, I'll review and test this soon. |
|
I like the commands for teleportation but I think the weather and time should be separate for weather & time scripts. And the item thing is nice but seems to be a little unnecessary since ox_inventory already does all that. Let me know if there's a specific reason you want it. |
While working on a script that's compatible with all frameworks, it becomes a bit of a limitation that nd_core doesn't provide a registerUsableItem export. When everything is centralized under one library, not having this means users have to manually configure items, which can be inconvenient. Other frameworks do provide this export, so having it in nd_core would improve consistency and usability. That’s why I wanted to include it. |
Client-side Changes:
ND:teleportToMarkerevent, allowing players to teleport to their marked waypoint.ND:changeWeatherandND:changeTimeevents to allow dynamic updates to weather and time in the game world.Server-side Changes:
/tpm: Teleports the player to their marked waypoint./tp: Teleports the player to specified coordinates./weather: Changes the weather based on a weather type./time: Updates the in-game time with hours, minutes, and optional seconds./coords: Displays the player's current coordinates and heading in the chat.Item Usability System:
NDCoreto register, check, and use usable items (registerUsableItem,isItemUsable,useItem)ox_inventoryto hook into itsusedItemevent, ensuring compatibility with the new usable item systemitems.luafile to manage item callbacks and provide exports for registering and using itemsExample Usage: