chefrz / rz-gym

GNU General Public License v3.0
26 stars 7 forks source link

image

rz-gym

Video Showcase

Update

Features

Dependencies

Installation

Items

["chocolate"] = math.random(10, 15),

Consumables.Drink

["redbull"] = math.random(10, 15),

Buffs Setup (Eat)

RegisterNetEvent('consumables:client:Eat', function(itemName)
    QBCore.Functions.Progressbar('eat_something', Lang:t('consumables.eat_progress'), 5000, false, true, {
        disableMovement = false,
        disableCarMovement = false,
        disableMouse = false,
        disableCombat = true
    }, {
        animDict = 'mp_player_inteat@burger',
        anim = 'mp_player_int_eat_burger',
        flags = 49
    }, {
        model = 'prop_cs_burger_01',
        bone = 60309,
        coords = vec3(0.0, 0.0, -0.02),
        rotation = vec3(30, 0.0, 0.0),
    }, {}, function() -- Done

        if itemName == "chocolate" then
            exports['ps-buffs']:AddBuff("gym-stamina", 300000)
        end

        TriggerEvent('inventory:client:ItemBox', QBCore.Shared.Items[itemName], 'remove')
        TriggerServerEvent('consumables:server:addHunger', QBCore.Functions.GetPlayerData().metadata.hunger + Config.Consumables.eat[itemName])
        TriggerServerEvent('hud:server:RelieveStress', math.random(2, 4))
    end)
end)

Buffs Setup (Drink)

RegisterNetEvent('consumables:client:Drink', function(itemName)
    QBCore.Functions.Progressbar('drink_something', Lang:t('consumables.drink_progress'), 5000, false, true, {
        disableMovement = false,
        disableCarMovement = false,
        disableMouse = false,
        disableCombat = true
    }, {
        animDict = 'mp_player_intdrink',
        anim = 'loop_bottle',
        flags = 49
    }, {
        model = 'vw_prop_casino_water_bottle_01a',
        bone = 60309,
        coords = vec3(0.0, 0.0, -0.05),
        rotation = vec3(0.0, 0.0, -40),
    }, {}, function() -- Done

        if itemName == "redbull" then
            exports['ps-buffs']:AddBuff("gym-strength", 300000)
        end

        TriggerEvent('inventory:client:ItemBox', QBCore.Shared.Items[itemName], 'remove')
        TriggerServerEvent('consumables:server:addThirst', QBCore.Functions.GetPlayerData().metadata.thirst + Config.Consumables.drink[itemName])
    end)
end)

Items


### Skill System Setup
- Find the `qb-core/server/player` and open, find the `function QBCore.Player.CheckPlayerData(source, PlayerData)` line and do as follows 
PlayerData.metadata["skill"]  = PlayerData.metadata["skill"]  ~= nil and PlayerData.metadata["skill"] or {
    ["Stamina"] = {["Current"] = 10.0, ["Stat"] = "MP0_STAMINA", ["RemoveAmount"] = 0}, 
    ["Strength"] = {["Current"] = 5.0, ["Stat"] = "MP0_STRENGTH", ["RemoveAmount"] = 0 },
    ["Lung Capacity"] = {["Current"] = 5.0, ["Stat"] = "MP0_LUNG_CAPACITY", ["RemoveAmount"] = 0 },
    ["Driving"] = {["Current"] = 0.0, ["Stat"] = "MP0_DRIVING_ABILITY", ["RemoveAmount"] = 0 },
    ["Wheelie"] = {["Current"] = 0.0, ["Stat"] = "MP0_WHEELIE_ABILITY", ["RemoveAmount"] = 0 }
}

### Item Images
- Download the script and open images folder, put it in the `qb-inventory or lj-inventory/html/images` directory.

### Script
- Download the script and put it in the `[qb]` directory.
- Add the following code to your server.cfg/resouces.cfg

ensure rz-gym ensure gamz-skillsystem ensure ps-buffs



## Image Showcase
![image](https://cdn.discordapp.com/attachments/1076880322903416873/1076889513219063848/1.png)
![image](https://cdn.discordapp.com/attachments/1076880322903416873/1076889560803455066/3.png)
![image](https://cdn.discordapp.com/attachments/1076880322903416873/1076889565807263844/2.png)
![image](https://cdn.discordapp.com/attachments/1076880322903416873/1076889585612763187/5.png)
![image](https://cdn.discordapp.com/attachments/1076880322903416873/1076889589593153596/6.png)
![image](https://cdn.discordapp.com/attachments/1076880322903416873/1076889592688558080/4.png)
![image](https://cdn.discordapp.com/attachments/1076880322903416873/1076889596522139689/7.png)
![image](https://cdn.discordapp.com/attachments/1076880322903416873/1076889626196840559/8.png)