It's already set in the config.lua, remove lines 14-28 if you want to change it with your system.
TriggerEvent("Botiv:cleanWeapon") or /cleanwp
Server Side
Server Event
botiv-wpClean:itemUsed(Boolean used)
Example VORP :
-- Server Side
VorpInv = exports.vorp_inventory:vorp_inventoryApi()
VorpInv.RegisterUsableItem("gunoil", function(data)
TriggerClientEvent("Botiv:cleanWeapon", data.source)
end)
RegisterServerEvent("botiv-wpClean:itemUsed")
AddEventHandler("botiv-wpClean:itemUsed", function(used)
if used then
VorpInv.subItem(source, "gunoil", 1)
end
end)
Example RedEM :
-- Server Side
RegisterServerEvent("RegisterUsableItem:gunoil")
AddEventHandler("RegisterUsableItem:gunoil", function(source)
TriggerClientEvent("Botiv:cleanWeapon", source)
end)
data = {}
TriggerEvent("redemrp_inventory:getData",function(call)
data = call
end)
RegisterServerEvent("botiv-wpClean:itemUsed")
AddEventHandler("botiv-wpClean:itemUsed", function(used)
if used then
local ItemData = data.getItem(source, 'gunoil')
ItemData.RemoveItem(1)
end
end)
Here is an excerpt from the config.lua file : (parts of the excerpt are hidden)
Config = {
-- advanced : Server and Client call Side --
enable_command = true,
botiv_clean_cmd = "cleanwp", -- Command /cleanwp
enable_client_side = true, -- Enable Client Call function bt_c_function
bt_c_function = 'Botiv:cleanWeapon', -- Function call : Client Side TriggerEvent("Botiv:cleanWeapon") or ServerSide TriggerClientEvent("Botiv:cleanWeapon", source)
}
-- this content is hidden in the excerpt