Exports & Events
All exports and events available to integrate this resource into others.
Suggestions?
If you wish to have any exports and or events added, please head over to our Discord and create a suggestion post. We are happy to allow for easier integration within other resources.
Client Sided Exports
Get Item Data
Returns all of the active item data in the cache. This will be empty if you don't have an item out at the time. Example:
---@return CigaretteData | CigaretteData | BongData | VapeData | nil exports["zyke_smoking"]:GetItemData()
Transfer Item
This export will find the closest player, and transfer the smokeable you currently have equipped to that player if it is within range. Example:
exports["zyke_smoking"]:TransferItem()
Switch Placement
Switches placement of your smokeable, if possible. Toggles between your hand and mouth. Example:
exports["zyke_smoking"]:SwitchItemPlacement()
Is High
Returns if you currently have any effect running from our resource. Example:
---@return boolean exports["zyke_smoking"]:IsHigh()
Has Walk Effect
Returns if you currently have any walking effect because of your high. Example:
---@return boolean exports["zyke_smoking"]:HasWalkEffect()
Has Screen Effect
Returns if you currently have any screen effect because of your high. Example:
---@return boolean exports["zyke_smoking"]:HasScreenEffect()
Get Amount In Smokeable
Returns the amount you have left for your smokeable. Example:
---@return number | 0 exports["zyke_smoking"]:GetAmount()
Get Battery In Vape
Returns the battery level for your vape. Example:
---@return number | 0 exports["zyke_smoking"]:GetAmount()
Get Water In Bong
Returns the water level for your bong. Example:
---@return number | 0 exports["zyke_smoking"]:GetWater()
Is Occupied
Check if a player is currently occupied with any smokeable. Example:
---@return boolean exports["zyke_smoking"]:IsOccupied()
Server Sided Exports
Is Occupied
Check if a player is currently occupied with any smokeable. Example:
---@param playerId integer ---@return boolean exports["zyke_smoking"]:IsOccupied(playerId)
Client Sided Events
Sync Item Data (Catch)
Gives you a table of the latest item data for your current item. Example:
---@param itemData CigaretteData | CigaretteData | BongData | VapeData | nil RegisterNetEvent("zyke_smoking:SyncItemData", function(itemData) -- Do something end)
Stop Using Item (Catch)
Triggered when you stop using an item. Example:
RegisterNetEvent("zyke_smoking:StopUsingItem", function() -- Do something end)
Start Inhaling (Catch)
Triggered when you start inhaling. Example:
RegisterNetEvent("zyke_smoking:StartInhaling", function() -- Do something end)
Stop Inhaling (Catch)
Triggered when you stop inhaling. Example:
RegisterNetEvent("zyke_smoking:StopInhaling", function() -- Do something end)
Server Sided Events
Transfer Item (Send)
Additional to the client sided export, you can trigger the transfer item event directly and transfer your smokeable. Example:
---@param targetId integer @Server id TriggerServerEvent("zyke_smoking:TransferItem", targetId)
Last updated
Was this helpful?