RedM
  • πŸ‡«πŸ‡·Home
  • πŸ§‘β€πŸŒΎAmbient NPC
  • β›ΊCampement
  • πŸƒCard Collection
  • β™ŸοΈChess & Checkers Game
  • πŸ’£Dynamite
  • πŸ™‹Environment animations
  • πŸ”₯Fire sync
  • 🐎Feeding Horse + Syringe
  • 🚭Illicit Sales
  • βš–οΈInstances
  • πŸ“₯Market Stall
  • 🩺Medical Records
  • 🍲Metabolism
  • πŸ—£οΈMumble Block UI
  • ⏸️Pause Menu
  • ⌨️Quick Keys Menu
  • πŸ’΅Reward Loyalty and Total playtime
  • πŸ–‹οΈTattoo
  • πŸ₯‡Top Serveurs
  • ⚰️Undertaker
  • πŸ’€Wanted
  • πŸ”«Weapon Cleaning Animation
  • 🏹Weapon Rack
Powered by GitBook
On this page

Weapon Cleaning Animation

Client Side

Start the script

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

Last updated 11 months ago

πŸ”«