API
Integrate Camping with your system
All events are SERVER SIDE!
Server Events
Extinguish fire
If fireplace object exists on provided coords, player is in allowed distance and fireplace is lighted, the object is deleted and replaced with object
specified in config
TriggerEvent('rcore_camping:extinguish', objCoords)
Light fireplace
If fireplace object exists on provided coords, player is in allowed distance and fireplace is not lighted, player needs any item specified in Config.LightItems
(flint by default) and after successful usage of light item the item is removed and the object is deleted and replaced with inFireObject
specified in config
TriggerEvent('rcore_camping:fire', objCoords)
Add fuel to fireplace
If fireplace object exists on provided coords, player is in allowed distance and fireplace is lighted, player needs 'wood' item, the item is removed and fireplace duration is increased on success
TriggerEvent('rcore_camping:addFuel', objCoords)
Cook on fireplace
If fireplace object exists on provided coords, player is in allowed distance and fireplace is lighted, player needs item specified in Config.FireCraftable
and after some time the item is replaced with result item
TriggerEvent('rcore_camping:canCook', objCoords, cookData)
Clear campign object
If any camping object exists on provided coords while player is in allowed distance, the object is removed and added into player's inventory (this does not apply for fireplace)
TriggerEvent('rcore_camping:clear', objCoords)
Enter a tent
If tent object exists on provided coords, player is in allowed distance and not already in any tent, player enters the tent.
TriggerEvent('rcore_camping:enterTent', objCoords)
Take a beer from beerkeg
If beerkeg object exists on provided coords, player is in allowed distance and beerkeg is not empty, player takes beer from beerkeg
TriggerEvent('rcore_camping:takeBeer', objCoords, BeerType['0_5'])
TriggerEvent('rcore_camping:takeBeer', objCoords, BeerType['0_3'])
Sit on chair
If chair object exists on provided coords, player's state of sitting is updated with provided true/false
value
TriggerEvent('rcore_camping:sit', objCoords, true) -- is sitting
TriggerEvent('rcore_camping:sit', objCoords, false) -- is not sitting
Place a camping object
places a camping object on coords
TriggerEvent('rcore_camping:place', objName, objCoords, objHeading)
Place a camping object
server event which places a camping object on coords
TriggerEvent('rcore_camping:serverPlace', objName, objCoords, objHeading)
Cancel placement
cancels current placement of camping object and returns last camping item used to player's inventory
TriggerEvent('rcore_camping:cancel')
Leave a tent
If player is in any tent, player leaves the tent
TriggerEvent('rcore_camping:leaveTent')
Camping object placed
server event called when camping object is placed on coords
AddEventHandler('rcore_camping:objectPlaced', function(objName, objCoords, objHeading)
end)
Camping object cleared
server event called when camping object is cleared on coords
AddEventHandler('rcore_camping:objectCleared', function(objName, objCoords)
end)
Last updated
Was this helpful?