diff --git a/consumable.lua b/consumable.lua new file mode 100644 index 0000000..4e5bf7f --- /dev/null +++ b/consumable.lua @@ -0,0 +1,308 @@ +Config.ConsumablesEat = { + ["sandwich"] = { + label = "Eating Sandwich", + progress = 5000, + emote = "sandwich", + fill = math.random(35, 54), + }, + ["tosti"] = { + label = "Eating Tosti", + progress = 5000, + emote = "croissant", + fill = math.random(40, 50), + }, + ["twerks_candy"] = { + label = "Eating Twerks Candy", + progress = 5000, + emote = "candyapple", + fill = math.random(35, 54), + }, + ["snikkel_candy"] = { + label = "Eating Snikkel Candy", + progress = 5000, + emote = "candyapple", + fill = math.random(40, 50), + } +} + +-- Drinking +Config.ConsumablesDrink = { + ["water_bottle"] = { + label = "Drinking Water", + progress = 5000, + emote = "water", + fill = math.random(35, 54), + }, + ["kurkakola"] = { + label = "Drinking Kurkakola", + progress = 5000, + emote = "soda", + fill = math.random(35, 54), + }, + ["coffee"] = { + label = "Drinking Coffee", + progress = 5000, + emote = "coffee", + fill = math.random(40, 50), + }, +} + +Config.ConsumablesAddiction = { + + -- Alcohol + + ["whiskey"] = { + label = "Drinking Whiskey", + progress = 5000, + emote = "whiskeyb2", + relieveStress = 10, + filltype = 'thirst', + fill = math.random(10, 20), + action = function(item) + AlcoholLoop() + end + }, + ["beer"] = { + label = "Drinking Beer", + progress = 5000, + emote = "beer3", + relieveStress = 10, + filltype = 'thirst', + fill = math.random(10, 20), + action = function(item) + AlcoholLoop() + end + }, + ["vodka"] = { + label = "Drinking Vodka", + progress = 5000, + prop = { + model = 'prop_vodka_bottle', + bone = 60309, + coords = vector3(-0.005, 0.00, -0.09), + rot = vector3(0.0, 0.0, 0.0), + }, + anim = { + lib = "mp_player_intdrink", + name = "loop_bottle", + flag = 49, + }, + relieveStress = 10, + filltype = 'thirst', + fill = math.random(10, 20), + action = function(item) + AlcoholLoop() + end + }, + + --drugs + + ["cokebaggy"] = { + label = "Snorting Coke", + progress = 5000, + anim = { + lib = "switch@trevor@trev_smoking_meth", + name = "trev_smoking_meth_loop", + flag = 49, + }, + relieveStress = 10, + action = function() + local function AlienEffect() + StartScreenEffect("DrugsMichaelAliensFightIn", 3.0, false) + Wait(math.random(5000, 8000)) + StartScreenEffect("DrugsMichaelAliensFight", 3.0, false) + Wait(math.random(5000, 8000)) + StartScreenEffect("DrugsMichaelAliensFightOut", 3.0, false) + StopScreenEffect("DrugsMichaelAliensFightIn") + StopScreenEffect("DrugsMichaelAliensFight") + StopScreenEffect("DrugsMichaelAliensFightOut") + end + + local startStamina = 20 + local ped = cache.ped + AlienEffect() + SetRunSprintMultiplierForPlayer(cache.playerId, 1.1) + while startStamina > 0 do + Wait(1000) + if math.random(1, 100) < 20 then + RestorePlayerStamina(cache.playerId, 1.0) + end + startStamina -= 1 + if math.random(1, 100) < 10 and IsPedRunning(ped) then + SetPedToRagdoll(ped, math.random(1000, 3000), math.random(1000, 3000), 3, false, false, false) + end + if math.random(1, 300) < 10 then + AlienEffect() + Wait(math.random(3000, 6000)) + end + end + if IsPedRunning(ped) then + SetPedToRagdoll(ped, math.random(1000, 3000), math.random(1000, 3000), 3, false, false, false) + end + SetRunSprintMultiplierForPlayer(cache.playerId, 1.0) + end + }, + ["crack_baggy"] = { + label = "Snorting Crack", + progress = 5000, + anim = { + lib = "switch@trevor@trev_smoking_meth", + name = "trev_smoking_meth_loop", + flag = 49, + }, + relieveStress = 10, + }, + ["meth"] = { + label = "Snorting Meth", + progress = 5000, + anim = { + lib = "switch@trevor@trev_smoking_meth", + name = "trev_smoking_meth_loop", + flag = 49, + }, + relieveStress = 10, + action = function (item) + local function TrevorEffect() + StartScreenEffect("DrugsTrevorClownsFightIn", 3.0, false) + Wait(3000) + StartScreenEffect("DrugsTrevorClownsFight", 3.0, false) + Wait(3000) + StartScreenEffect("DrugsTrevorClownsFightOut", 3.0, false) + StopScreenEffect("DrugsTrevorClownsFight") + StopScreenEffect("DrugsTrevorClownsFightIn") + StopScreenEffect("DrugsTrevorClownsFightOut") + end + + local startStamina = 8 + TrevorEffect() + SetRunSprintMultiplierForPlayer(cache.playerId, 1.49) + while startStamina > 0 do + Wait(1000) + if math.random(5, 100) < 10 then + RestorePlayerStamina(cache.playerId, 1.0) + end + startStamina = startStamina - 1 + if math.random(5, 100) < 51 then + TrevorEffect() + end + end + SetRunSprintMultiplierForPlayer(cache.playerId, 1.0) + end + }, + ["xtcbaggy"] = { + label = "Taking XTC", + progress = 5000, + anim = { + lib = "mp_suicide", + name = "pill", + flag = 49, + }, + relieveStress = 10, + action = function(item) + local startStamina = 30 + SetFlash(0, 0, 500, 7000, 500) + while startStamina > 0 do + Wait(1000) + startStamina -= 1 + RestorePlayerStamina(cache.playerId, 1.0) + if math.random(1, 100) < 51 then + SetFlash(0, 0, 500, 7000, 500) + ShakeGameplayCam('SMALL_EXPLOSION_SHAKE', 0.08) + end + end + if IsPedRunning(cache.ped) then + SetPedToRagdoll(cache.ped, math.random(1000, 3000), math.random(1000, 3000), 3, false, false, false) + end + end + }, + ["oxy"] = { + label = "Taking OXY", + progress = 5000, + anim = { + lib = "mp_suicide", + name = "pill", + flag = 49, + }, + relieveStress = 10, + }, + + --smoke + + ["joint"] = { + label = "Smoking Joint", + progress = 5000, + emote = "smokeweed", + relieveStress = 20, + }, +} + + +Config.ConsumablesItems = { + ['armor'] = { + label = 'Using Armor', + progress = 5000, --ms + anim = { + lib = 'clothingshirt', + name = 'try_shirt_positive_d', + flag = 49, + }, + removeItem = true, + action = function(itemName) + TriggerServerEvent('hospital:server:SetArmor', 50) + SetPedArmour(cache.ped, 50) + end + }, + ['heavyarmor'] = { + label = 'Using Armor', + progress = 5000, --ms + anim = { + lib = 'clothingshirt', + name = 'try_shirt_positive_d', + flag = 49, + }, + removeItem = true, + action = function(itemName) + TriggerServerEvent('hospital:server:SetArmor', 100) + SetPedArmour(cache.ped, 100) + end + }, + ['parachute'] = { + label = 'Preparing Parachute', + progress = 15000, --ms + anim = { + lib = 'clothingshirt', + name = 'try_shirt_positive_d', + flag = 49, + }, + removeItem = true, + action = function(itemName) + if not GetterParachute() then + local ped = cache.ped + GiveWeaponToPed(ped, `GADGET_PARACHUTE`, 1, false, false) + local ParachuteData = { + outfitData = { + ["bag"] = { item = 8, texture = 0}, -- Adding Parachute Clothing + } + } + TriggerEvent('qb-clothing:client:loadOutfit', ParachuteData) + SetterParachute(true) + end + end + }, +} + +Config.Fuckage = 2000 -- in MS + +-- Adjust the time to change how long the driver is forced into the random event. IN MS +-- There are more random events you can add on the fivem native wiki + +Config.RandomVehicleInteraction = { + {interaction = 27, time = 1500}, + {interaction = 6, time = 1000}, + {interaction = 7, time = 800}, --turn left and accel + {interaction = 8, time = 800}, --turn right and accel + {interaction = 10, time = 800}, --turn left and restore wheel pos + {interaction = 11, time = 800}, --turn right and restore wheel pos + {interaction = 23, time = 2000}, -- accel fast + {interaction = 31, time = 2000} -- accel fast and then handbrake +} \ No newline at end of file diff --git a/consumable.md b/consumable.md new file mode 100644 index 0000000..1ea3e0e --- /dev/null +++ b/consumable.md @@ -0,0 +1,111 @@ +** Add Eat AS Item ** +```lua +Config.ConsumablesEat = { + [itemName: string] = { + label? = `string`, -- text showing on progressbar + progress? = `number`, --ms + prop? = { + bone = `number`, + coords? = `vec(x, y, z)`, + rot? = `vec(x, y, z)`, + }, + anim? = { -- TaskPllayAnim + lib = `string`, + name = `string`, + flag = `number`, + }, + scenario? = string, -- TaskStartScenarioInPlace + emote? = string, -- emote on animation script name + relieveStress? = `number`, -- will relieve stress + fill = `number`, --- filling of hunger/thrist + action? = function(itemName: string) --- do some crazy stuff + print('Function Running') + end + } +} +``` + +** Add Drink AS Item ** +```lua +Config.ConsumablesDrink = { + [itemName: string] = { + label? = `string`, + progress? = `number`, --ms + prop? = { + bone = `number`, + coords? = `vec(x, y, z)`, + rot? = `vec(x, y, z)`, + }, + anim? = { + lib = `string`, + name = `string`, + flag = `number`, + }, + scenario? = `string`, + emote? = `string`, + relieveStress? = `number`, + fill = `number`, + action? = function(itemName: string) + print('Function Running') + end + } +} +``` + +** Add Addiction AS Item ** +```lua +Config.ConsumablesAddiction = { + [itemName: string] = { + label? = `string`, + progress? = `number`, --ms + prop? = { + bone = `number`, + coords? = `vec(x, y, z)`, + rot? = `vec(x, y, z)`, + }, + anim? = { + lib = `string`, + name = `string`, + flag = `number`, + }, + scenario? = `string`, + emote? = `string`, + relieveStress? = `number`, + filltype? = string (hunger|thirst), + fill = `number`, + action? = function(itemName: string) + print('Function Running') + end + } +} +``` + + +** Add Use Item ** +```lua +Config.ConsumablesAddiction = { + [itemName: string] = { + event? = `string`, -- any one of them (event/serverEvent) , if declared below lines will override + serverEvent? = `string`, -- any one of them (event/serverEvent) , if declared below lines will override + args? = `any`, + label? = `string`, + progress? = `number`, --ms + prop? = { + bone = `number`, + coords? = `vec(x, y, z)`, + rot? = `vec(x, y, z)`, + }, + anim? = { + lib = `string`, + name = `string`, + flag = `number`, + }, + scenario? = `string`, + emote? = `string`, + action? = function(itemName: string) + print('Function Running') + end + + } +} +``` \ No newline at end of file