InZidiuZ / LegacyFuel

A simple, lightweight fuel script for FiveM
GNU General Public License v3.0
78 stars 217 forks source link

Jerry can as item? #66

Closed donnayy closed 2 years ago

donnayy commented 3 years ago

Hello could you please tell me how i add the jerry can as item?

phiomet commented 3 years ago

Change server lua to ` ESX = nil

if Config.UseESX then TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)

RegisterServerEvent('fuel:pay')
AddEventHandler('fuel:pay', function(price)
    local xPlayer = ESX.GetPlayerFromId(source)
    local amount = ESX.Math.Round(price)

    if price > 0 then
        xPlayer.removeMoney(amount)
        xPlayer.addWeapon("weapon_petrolcan")
    end
end)

end `

InZidiuZ commented 2 years ago

I think you'd do that in whatever framework you're using. Closing this.