Feeding Horse + Syringe
Client Side
You can enable/disable event or command.
You can edit command name and event name.
TriggerEvent("Botiv:giveFoodToHorse", [ID])
or
TriggerEvent("Botiv:giveFoodToHorse", [ITEM])
/feedhorse [ID] or /feedhorse [ITEM]
Server Side
For VORP and REDEM, you can use the lines from config_server.lua file.
OR you can do this :
Server Event
botiv-FeedHorse:itemUsed(String item, Boolean used)
Example VORP :
vorpInventory = exports.vorp_inventory:vorp_inventoryApi()
vorpInventory.RegisterUsableItem("syringe", function(data)
TriggerClientEvent("Botiv:giveFoodToHorse", data.source, "syringe")
end)
RegisterServerEvent("botiv-FeedHorse:itemUsed")
AddEventHandler("botiv-FeedHorse:itemUsed", function(item, used)
if used then
vorpInventory.subItem(source, item, 1)
end
end)
Example RedEM :
RegisterServerEvent("RegisterUsableItem:syringe")
AddEventHandler("RegisterUsableItem:syringe", function(source)
TriggerClientEvent("Botiv:giveFoodToHorse", source, "syringe")
end)
data = {}
TriggerEvent("redemrp_inventory:getData",function(call)
data = call
end)
RegisterServerEvent("botiv-FeedHorse:itemUsed")
AddEventHandler("botiv-FeedHorse:itemUsed", function(item, used)
if used then
local ItemData = data.getItem(source, item)
ItemData.RemoveItem(1)
end
end)
Here is an excerpt from the config.lua file : (parts of the excerpt are hidden)
-- You can change anything but don't change "p_cs_syringe01x" located in HorseFood table, line [41]
-- 'timeEffect' defines the duration of the effect. The effect is progressive.
-- 'Heal' and 'Stamina' can be set to positive or negative value.
-- 'healOverpower' and 'staminaOverpower' can be set to 0 or positive value.
-- When the horse's health and energy are at their maximum, then the script activates overpower.
-- The duration of the overpower depends on the values ββof 'healOverpower' and 'staminaOverpower'.
-- To use syringe animation just use object = "p_cs_syringe01x" in your line.
-- Item Objects : https://rdr2.mooshe.tv/
-- Support him/her on https://ko-fi.com/Mooshe
Config = {
enable_command = true,
botiv_feed_cmd = "feedhorse", -- Command /feedhorse [ID] or /feedhorse [item] | for Oleander Sage you can use /feedhorse 2 or /feedhorse oleandersage
enable_client_side = true, -- Enable Client Call function bt_c_function
bt_c_function = 'Botiv:giveFoodToHorse', -- Function call : Client Side for food [2] "Oleander Sage" TriggerEvent("Botiv:giveFoodToHorse", 2) or ServerSide TriggerClientEvent("Botiv:giveFoodToHorse", source, 2)
need_ride_horse = "You must be on or near a horse to use this item.",
no_aliment = "This food does not exist",
item_used = "You gave %s to the horse.", -- %s for item name
HorseFood = {
-- this content is hidden in the excerpt
[42] = { name = "Horse Poison", object = "s_inv_bulrush01cx", Heal = -200, Stamina = -200, healOverpower = 0, staminaOverpower = 0, timeEffect = 30, item = "horsepoison"},
}
}
-- this content is hidden in the excerpt
Last updated