mirror of
https://github.com/jimathy/jim-consumables.git
synced 2026-08-17 14:36:03 +01:00
Compare commits
118 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce137d9089 | ||
|
|
d7a8a20491 | ||
|
|
38d0b04e71 | ||
|
|
762240b500 | ||
|
|
0a0f60468a | ||
|
|
9b189d89f5 | ||
|
|
62db9f6900 | ||
|
|
6317dee667 | ||
|
|
15bb54c206 | ||
|
|
94023857ff | ||
|
|
daa70a8844 | ||
|
|
25e8d99839 | ||
|
|
2c2a486a41 | ||
|
|
16e957116e | ||
|
|
b4d65ff043 | ||
|
|
9d866c88ee | ||
|
|
018dcca6cc | ||
|
|
e27b840a5e | ||
|
|
e794d9a446 | ||
|
|
541263b156 | ||
|
|
60c42b2506 | ||
|
|
2a4de6fdc1 | ||
|
|
4b015e5efa | ||
|
|
518c5204ae | ||
|
|
12642b7e7b | ||
|
|
c2843eaee2 | ||
|
|
b92e26129f | ||
|
|
129b65deda | ||
|
|
d83d0bbfc4 | ||
|
|
2b6d3f2825 | ||
|
|
cab1ddbe52 | ||
|
|
868f322c8c | ||
|
|
5bbd8a70e8 | ||
|
|
9f5bde25ae | ||
|
|
445ddc82ac | ||
|
|
d9b97dc14c | ||
|
|
c96d1ec277 | ||
|
|
cf3d3c4147 | ||
|
|
4e565268cd | ||
|
|
9e8dcc39f9 | ||
|
|
c2d902c813 | ||
|
|
4d83c8c612 | ||
|
|
f23d2bbdd0 | ||
|
|
9323c46406 | ||
|
|
57ed8b2ae0 | ||
|
|
7492531621 | ||
|
|
531c93377a | ||
|
|
11f479d8f8 | ||
|
|
d60a93448d | ||
|
|
0b45087596 | ||
|
|
5b1c949903 | ||
|
|
61ca273b5f | ||
|
|
7feaa12f7e | ||
|
|
7f5383f90e | ||
|
|
e988fb216a | ||
|
|
6a17162638 | ||
|
|
cec84d4ba9 | ||
|
|
9558f71ce8 | ||
|
|
3565c9850f | ||
|
|
8f57772427 | ||
|
|
d7ec8dd90c | ||
|
|
429bf50b3a | ||
|
|
0b42cbc362 | ||
|
|
e7d9946532 | ||
|
|
c10860f788 | ||
|
|
7e10b7835f | ||
|
|
80ffb27ac2 | ||
|
|
d263b1d156 | ||
|
|
7d8aa1bbc6 | ||
|
|
3330724d4e | ||
|
|
3e2eef8a38 | ||
|
|
b1730d24f1 | ||
|
|
632fd1de5b | ||
|
|
d0fa6b750b | ||
|
|
52816242fa | ||
|
|
4e38c81645 | ||
|
|
7a6762ee08 | ||
|
|
6ba9febb0a | ||
|
|
7996100dad | ||
|
|
c25cb643bc | ||
|
|
a4901972b9 | ||
|
|
b56cce8951 | ||
|
|
4648083127 | ||
|
|
e263aa3255 | ||
|
|
6654b9a3f5 | ||
|
|
ad185183f7 | ||
|
|
dbed114e05 | ||
|
|
3ffa295ca1 | ||
|
|
18c6401581 | ||
|
|
118219c9aa | ||
|
|
b2c7c34e15 | ||
|
|
cba9a574bf | ||
|
|
41136ce949 | ||
|
|
18d903abcc | ||
|
|
909dd3ad19 | ||
|
|
cec8165556 | ||
|
|
4bdcc11d51 | ||
|
|
68b17642a6 | ||
|
|
5d084c3046 | ||
|
|
bc585cd9a5 | ||
|
|
1f9e16acf1 | ||
|
|
9fcc91e2bc | ||
|
|
00332d0ca3 | ||
|
|
a2d2355757 | ||
|
|
de68263240 | ||
|
|
931ba14933 | ||
|
|
50f5dab7cb | ||
|
|
f1cf454687 | ||
|
|
da27eb3f89 | ||
|
|
35bf894213 | ||
|
|
a0c83c0e1f | ||
|
|
a6f6492d5b | ||
|
|
7da98b53e1 | ||
|
|
1036f1dc21 | ||
|
|
59540d95b6 | ||
|
|
b15836d42e | ||
|
|
d17334e6fe | ||
|
|
61de2ece5a |
12
.gitattributes
vendored
Normal file
12
.gitattributes
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# VCS / CI noise
|
||||||
|
.gitattributes export-ignore
|
||||||
|
.gitignore export-ignore
|
||||||
|
.github/** export-ignore
|
||||||
|
.gitmodules export-ignore
|
||||||
|
|
||||||
|
# Dev tooling/config
|
||||||
|
.vscode/** export-ignore
|
||||||
|
*.code-workspace export-ignore
|
||||||
|
.editorconfig export-ignore
|
||||||
|
.eslintrc* export-ignore
|
||||||
|
.prettier* export-ignore
|
||||||
12
.github/FUNDING.yml
vendored
Normal file
12
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||||
|
patreon: # Replace with a single Patreon username
|
||||||
|
open_collective: # Replace with a single Open Collective username
|
||||||
|
ko_fi: jixelpatterns
|
||||||
|
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||||
|
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||||
|
liberapay: # Replace with a single Liberapay username
|
||||||
|
issuehunt: # Replace with a single IssueHunt username
|
||||||
|
otechie: # Replace with a single Otechie username
|
||||||
|
custom: ['https://jimathy666.tebex.io/']
|
||||||
18
.github/workflows/notify-discord.yml
vendored
Normal file
18
.github/workflows/notify-discord.yml
vendored
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
name: Discord Commit Notifier
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
notify:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Send commit payload to Discord Bot
|
||||||
|
env:
|
||||||
|
URL: http://${{ secrets.DISCORDBOT }}:3000/github-commits
|
||||||
|
run: |
|
||||||
|
curl -sS -X POST "$URL" \
|
||||||
|
-H 'Content-Type: application/json' \
|
||||||
|
--data-binary "@$GITHUB_EVENT_PATH"
|
||||||
71
.github/workflows/notify-release.yml
vendored
Normal file
71
.github/workflows/notify-release.yml
vendored
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
name: Discord Release Notifier
|
||||||
|
|
||||||
|
on:
|
||||||
|
# Manual or UI-published releases
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
# Releases created by your tag-driven workflow
|
||||||
|
workflow_run:
|
||||||
|
workflows: ["Package & Release"] # must match the 'name:' in release.yml
|
||||||
|
types: [completed]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
# 1) Handle manual / UI / non-workflow-created releases
|
||||||
|
notify-from-release:
|
||||||
|
if: github.event_name == 'release' && github.event.action == 'published'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Send release payload to Discord Bot
|
||||||
|
env:
|
||||||
|
URL: http://${{ secrets.DISCORDBOT }}:3000/github-releases
|
||||||
|
run: |
|
||||||
|
curl -sS -X POST "$URL" \
|
||||||
|
-H 'Content-Type: application/json' \
|
||||||
|
--data-binary "@$GITHUB_EVENT_PATH"
|
||||||
|
|
||||||
|
# 2) Handle releases created by your 'Package & Release' workflow
|
||||||
|
# (which won’t trigger `on: release` when using GITHUB_TOKEN)
|
||||||
|
notify-from-workflow-run:
|
||||||
|
if: >
|
||||||
|
github.event_name == 'workflow_run' &&
|
||||||
|
github.event.workflow_run.conclusion == 'success'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Install jq
|
||||||
|
run: sudo apt-get update && sudo apt-get install -y jq
|
||||||
|
|
||||||
|
- name: Fetch release JSON by tag
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
OWNER="${GITHUB_REPOSITORY%/*}"
|
||||||
|
REPO="${GITHUB_REPOSITORY#*/}"
|
||||||
|
TAG="${{ github.event.workflow_run.head_branch }}"
|
||||||
|
# head_branch is the tag name for a tag push workflow_run
|
||||||
|
curl -fsSL -H "Authorization: Bearer $GH_TOKEN" \
|
||||||
|
-H "Accept: application/vnd.github+json" \
|
||||||
|
"https://api.github.com/repos/$OWNER/$REPO/releases/tags/$TAG" \
|
||||||
|
> release.json
|
||||||
|
|
||||||
|
- name: Wrap as 'release' event payload & notify bot
|
||||||
|
env:
|
||||||
|
URL: http://${{ secrets.DISCORDBOT }}:3000/github-releases
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
jq -n --slurpfile rel release.json \
|
||||||
|
--arg repo "$GITHUB_REPOSITORY" \
|
||||||
|
--arg repo_url "https://github.com/$GITHUB_REPOSITORY" \
|
||||||
|
--arg action "published" '
|
||||||
|
{ action: $action,
|
||||||
|
repository: { full_name: $repo, html_url: $repo_url },
|
||||||
|
release: $rel[0],
|
||||||
|
sender: { login: "github-actions[bot]" } }' > payload.json
|
||||||
|
|
||||||
|
curl -sS -X POST "$URL" \
|
||||||
|
-H 'Content-Type: application/json' \
|
||||||
|
--data-binary "@payload.json"
|
||||||
88
.github/workflows/release.yml
vendored
Normal file
88
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
name: Package & Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v*"
|
||||||
|
- "*.*.*"
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout (full history)
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Derive vars
|
||||||
|
id: vars
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "name=${GITHUB_REPOSITORY##*/}" >> $GITHUB_OUTPUT # e.g. jim_bridge
|
||||||
|
echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT # strip leading v
|
||||||
|
|
||||||
|
- name: Build zip with folder prefix
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
NAME='${{ steps.vars.outputs.name }}'
|
||||||
|
VER='${{ steps.vars.outputs.version }}'
|
||||||
|
git archive --format=zip --prefix="${NAME}/" -o "${NAME}-${VER}.zip" "$GITHUB_REF_NAME"
|
||||||
|
ls -lh "${NAME}-${VER}.zip"
|
||||||
|
|
||||||
|
# --- Patch notes generation (commit titles + links) -------------------
|
||||||
|
- name: Find previous tag (SemVer aware)
|
||||||
|
id: prev
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
CUR="${GITHUB_REF_NAME}"
|
||||||
|
# Sort tags by version desc, drop the current, take the next newest
|
||||||
|
PREV=$(git tag --sort=-v:refname | grep -v -x "$CUR" | head -n 1 || true)
|
||||||
|
echo "prev=$PREV" >> $GITHUB_OUTPUT
|
||||||
|
echo "Previous tag: ${PREV:-<none>}"
|
||||||
|
|
||||||
|
- name: Generate RELEASE_NOTES.md from commits
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
REPO="${{ github.repository }}"
|
||||||
|
CUR="${GITHUB_REF_NAME}"
|
||||||
|
PREV='${{ steps.prev.outputs.prev }}'
|
||||||
|
|
||||||
|
if [ -n "$PREV" ]; then
|
||||||
|
RANGE="$PREV..$CUR"
|
||||||
|
HEADER="## Changes in $CUR"
|
||||||
|
else
|
||||||
|
# First release: include all commits
|
||||||
|
ROOT=$(git rev-list --max-parents=0 HEAD | tail -n 1)
|
||||||
|
RANGE="$ROOT..$CUR"
|
||||||
|
HEADER="## Changes"
|
||||||
|
fi
|
||||||
|
|
||||||
|
{
|
||||||
|
echo "$HEADER"
|
||||||
|
echo
|
||||||
|
# Oldest → newest, subject only, skip merge commits
|
||||||
|
# Escape '[' and ']' so markdown doesn't break on rare titles
|
||||||
|
git log --reverse --no-merges --pretty=format:'- ['%h'] - %s' "$RANGE" \
|
||||||
|
| perl -pe 's/([\[\]])/\\$1/g'
|
||||||
|
} > RELEASE_NOTES.md
|
||||||
|
|
||||||
|
echo "--- RELEASE_NOTES.md ---"
|
||||||
|
cat RELEASE_NOTES.md
|
||||||
|
echo "------------------------"
|
||||||
|
|
||||||
|
- name: Create / Update GitHub Release
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
tag_name: ${{ github.ref_name }}
|
||||||
|
name: ${{ github.ref_name }}
|
||||||
|
files: |
|
||||||
|
*.zip
|
||||||
|
body_path: RELEASE_NOTES.md # attach our generated notes
|
||||||
|
# If you wanted GitHub's auto notes instead, set:
|
||||||
|
# generate_release_notes: true
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
52
README.md
52
README.md
@@ -1,27 +1,25 @@
|
|||||||
# jim-consumables
|
# Jim-Consumables
|
||||||
Consumables script for QBCore
|
|
||||||
|
## FiveM MultiFrameork Consumables script
|
||||||
# What is this?
|
|
||||||
This script is designed as a replacement/override for food and drink consumables in qb-smallresources
|
# What is this?
|
||||||
|
This script WAS designed as a replacement/override for food and drink consumables in `qb-smallresources`
|
||||||
It's main purpose was to make it possible to not stand up while sitting due to lazy events such as ClearPedTasks in most scripts, this one is designed to cancel the animation you have chosen, not all animations. This includes progressbar.
|
|
||||||
|
It's main purpose was to make it so players did not stand up while sitting with my scripts due to lazy events such as ClearPedTasks in progressbar and dpemotes, this one is designed to cancel the animation you have chosen, not ALL animations.
|
||||||
# Installation
|
|
||||||
This script is recommended to be ran last/at the bottom of your server.cfg because this is intended to take control of items, if ran too early the original script may override this one.
|
Users requested I readd the progressbar but it ended up being a config option to enable it
|
||||||
|
|
||||||
It already takes control of default qbcore food and drink, but you would probably want to add more.
|
Though if your players are cancelling all animations when consuming, it's recommended to set `Config.UseProgBar` to `false` to get this effect.
|
||||||
|
|
||||||
To add an item, you only need to add a new item table in the Config.Consumables like this:
|
# THIS DOESN'T USE DPEMOTES OR RPEMOTES OR SCULLYS EMOTEMENU
|
||||||
```lua
|
|
||||||
["heartstopper"] = {
|
---
|
||||||
emote = "burger", -- Select an emote from below, it has to be in here
|
|
||||||
stress = math.random(1,2), -- Amount of stress relief, can be 0
|
# Installation and Previews:
|
||||||
heal = 0, -- Set amount to heal by after consuming
|
## [JixelPatterns GitBook Documentation](https://jixelpatterns.gitbook.io/docs)
|
||||||
armor = 5, -- Amount of armor to add
|
|
||||||
type = "food", -- Type: "alcohol" / "drink" / "food"
|
### If you need support I have a discord server available, it helps me keep track of issues and give better support.
|
||||||
effect = { effect = "healdouble", }, -- The status effect given by the item, "heal" / "healdouble" / "stamina"
|
## [JixelPatterns Discord](https://discord.gg/9pCDHmjYwd)
|
||||||
stats = { hunger = math.random(10,20), }, -- The stats of the item, if not found in the items.lua
|
|
||||||
},
|
### If you think I did a good job here, consider donating as it keeps by lights on and my cat round:
|
||||||
```
|
## [JixelPatterns Kofi](https://ko-fi.com/jixelpatterns)
|
||||||
|
|
||||||
This script supports dpemotes style emotes, so if you have some that you want to be triggered when eating or drinking drop it in the Config.Emotes
|
|
||||||
@@ -1,331 +1,444 @@
|
|||||||
local QBCore = exports['qb-core']:GetCoreObject()
|
local alcoholCount, drugCount, consuming, cancelled = 0, 0, false, false
|
||||||
|
Consumables, Emotes = {}, {}
|
||||||
|
|
||||||
PlayerJob = {}
|
onPlayerLoaded(function()
|
||||||
local onDuty = false
|
-- Wait until statebag exists, then trigger local handler
|
||||||
local alcoholCount = 0
|
CreateThread(function()
|
||||||
local drugCount = 0
|
while not GlobalState.jimConsumableItems do Wait(100) end
|
||||||
|
local newConsumables = GlobalState.jimConsumableItems
|
||||||
|
for k in pairsByKeys(newConsumables) do
|
||||||
|
if not Consumables[k] then
|
||||||
|
debugPrint("^5Statebag^7: ^2New ^3Consumable ^2Info synced^7: ^6"..k.."^7")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
while not GlobalState.jimConsumableEmotes do Wait(100) end
|
||||||
|
local newEmotes = GlobalState.jimConsumableEmotes
|
||||||
|
for k in pairsByKeys(newEmotes) do
|
||||||
|
if not Emotes[k] then
|
||||||
|
debugPrint("^5Statebag^7: ^2New ^3Emote ^2Info synced^7: ^6"..k.."^7")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
Consumables = newConsumables
|
||||||
|
Emotes = newEmotes
|
||||||
|
debugPrint("^5Statebag^7: ^2Synced ^6"..countTable(Consumables).." ^2Items and ^6"..countTable(Emotes).." ^2Emotes^7")
|
||||||
|
end)
|
||||||
|
end, true)
|
||||||
|
|
||||||
local function loadAnimDict(dict) while (not HasAnimDictLoaded(dict)) do RequestAnimDict(dict) Wait(5) end end
|
-- Handlers to recieve global statebag data from the server
|
||||||
|
AddStateBagChangeHandler("jimConsumableItems", nil, function(bagName, key, value, _unused)
|
||||||
--Alcohol Effects
|
if type(value) == "table" then
|
||||||
function AlienEffect()
|
local newItemCount = 0
|
||||||
StartScreenEffect("DrugsMichaelAliensFightIn", 3.0, 0)
|
for k in pairsByKeys(value) do
|
||||||
Wait(math.random(5000, 8000))
|
if not Consumables[k] then
|
||||||
local ped = PlayerPedId()
|
newItemCount += 1
|
||||||
RequestAnimSet("MOVE_M@DRUNK@VERYDRUNK")
|
debugPrint("^5Statebag^7: ^2New ^3Consumable ^2Info synced^7: ^6"..k.."^7")
|
||||||
while not HasAnimSetLoaded("MOVE_M@DRUNK@VERYDRUNK") do
|
end
|
||||||
Citizen.Wait(0)
|
end
|
||||||
|
Consumables = value
|
||||||
|
debugPrint("^5Statebag^7: ^2Synced ^6"..newItemCount.." ^2new Consumables^7")
|
||||||
end
|
end
|
||||||
SetPedCanRagdoll( ped, true )
|
end)
|
||||||
ShakeGameplayCam('DRUNK_SHAKE', 2.80)
|
|
||||||
SetTimecycleModifier("Drunk")
|
|
||||||
SetPedMovementClipset(ped, "MOVE_M@DRUNK@VERYDRUNK", true)
|
|
||||||
SetPedMotionBlur(ped, true)
|
|
||||||
SetPedIsDrunk(ped, true)
|
|
||||||
Wait(1500)
|
|
||||||
SetPedToRagdoll(ped, 5000, 1000, 1, false, false, false )
|
|
||||||
Wait(13500)
|
|
||||||
SetPedToRagdoll(ped, 5000, 1000, 1, false, false, false )
|
|
||||||
Wait(120500)
|
|
||||||
ClearTimecycleModifier()
|
|
||||||
ResetScenarioTypesEnabled()
|
|
||||||
ResetPedMovementClipset(ped, 0)
|
|
||||||
SetPedIsDrunk(ped, false)
|
|
||||||
SetPedMotionBlur(ped, false)
|
|
||||||
AnimpostfxStopAll()
|
|
||||||
ShakeGameplayCam('DRUNK_SHAKE', 0.0)
|
|
||||||
StartScreenEffect("DrugsMichaelAliensFight", 3.0, 0)
|
|
||||||
Wait(math.random(45000, 60000))
|
|
||||||
StartScreenEffect("DrugsMichaelAliensFightOut", 3.0, 0)
|
|
||||||
StopScreenEffect("DrugsMichaelAliensFightIn")
|
|
||||||
StopScreenEffect("DrugsMichaelAliensFight")
|
|
||||||
StopScreenEffect("DrugsMichaelAliensFightOut")
|
|
||||||
end
|
|
||||||
--Weed Effects
|
|
||||||
function WeedEffect()
|
|
||||||
StartScreenEffect("DrugsMichaelAliensFightIn", 3.0, 0)
|
|
||||||
Wait(math.random(3000, 20000))
|
|
||||||
StartScreenEffect("DrugsMichaelAliensFight", 3.0, 0)
|
|
||||||
Wait(math.random(15000, 20000))
|
|
||||||
StartScreenEffect("DrugsMichaelAliensFightOut", 3.0, 0)
|
|
||||||
StopScreenEffect("DrugsMichaelAliensFightIn")
|
|
||||||
StopScreenEffect("DrugsMichaelAliensFight")
|
|
||||||
StopScreenEffect("DrugsMichaelAliensFightOut")
|
|
||||||
end
|
|
||||||
--Other Effects
|
|
||||||
function TrevorEffect()
|
|
||||||
StartScreenEffect("DrugsTrevorClownsFightIn", 3.0, 0)
|
|
||||||
Wait(3000)
|
|
||||||
StartScreenEffect("DrugsTrevorClownsFight", 3.0, 0)
|
|
||||||
Wait(30000)
|
|
||||||
StartScreenEffect("DrugsTrevorClownsFightOut", 3.0, 0)
|
|
||||||
StopScreenEffect("DrugsTrevorClownsFight")
|
|
||||||
StopScreenEffect("DrugsTrevorClownsFightIn")
|
|
||||||
StopScreenEffect("DrugsTrevorClownsFightOut")
|
|
||||||
end
|
|
||||||
|
|
||||||
function HealEffectDouble()
|
AddStateBagChangeHandler("jimConsumableEmotes", nil, function(bagName, key, value, _unused)
|
||||||
if not healing then healing = true else return end
|
if type(value) == "table" then
|
||||||
local count = 9
|
local newEmoteCount = 0
|
||||||
while count > 0 do
|
for k in pairsByKeys(value) do
|
||||||
Wait(1000)
|
if not Emotes[k] then
|
||||||
count = count - 1
|
newEmoteCount += 1
|
||||||
SetEntityHealth(PlayerPedId(), GetEntityHealth(PlayerPedId()) + 6)
|
debugPrint("^5Statebag^7: ^2New ^3Emote ^2Info synced^7: ^6"..k.."^7")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
Emotes = value
|
||||||
|
debugPrint("^5Statebag^7: ^2Synced ^6"..newEmoteCount.." ^2new Emotes^7")
|
||||||
end
|
end
|
||||||
healing = false
|
end)
|
||||||
end
|
|
||||||
function HealEffect()
|
|
||||||
if not healing then healing = true else return end
|
|
||||||
local count = 4
|
|
||||||
while count > 0 do
|
|
||||||
Wait(1000)
|
|
||||||
count = count - 1
|
|
||||||
SetEntityHealth(PlayerPedId(), GetEntityHealth(PlayerPedId()) + 6)
|
|
||||||
end
|
|
||||||
healing = false
|
|
||||||
end
|
|
||||||
|
|
||||||
function StaminaEffect()
|
RegisterNetEvent(getScript()..':Consume', function(itemName)
|
||||||
local startStamina = 8
|
if not Consumables[itemName] then return end
|
||||||
SetRunSprintMultiplierForPlayer(PlayerId(), 1.49)
|
local consumable = Consumables[itemName]
|
||||||
while startStamina > 0 do
|
if not hasItem(itemName, 1) then
|
||||||
Wait(1000)
|
print("^5Debug^7: ^1Error^7: ^2Item not found in inventory^7, ^2stopping^7..")
|
||||||
if math.random(5, 100) < 10 then RestorePlayerStamina(PlayerId(), 1.0) end
|
|
||||||
startStamina = startStamina - 1
|
|
||||||
if math.random(5, 100) < 51 then end
|
|
||||||
end
|
end
|
||||||
startStamina = 0
|
local requiredItem = consumable and consumable.requiredItem or nil
|
||||||
SetRunSprintMultiplierForPlayer(PlayerId(), 1.0)
|
|
||||||
end
|
|
||||||
|
|
||||||
--[[function EcstasyEffect()
|
if requiredItem then
|
||||||
local startStamina = 30
|
if not hasItem(requiredItem, 1) then
|
||||||
SetFlash(0, 0, 500, 7000, 500)
|
triggerNotify(nil, "You need a "..getItemLabel(requiredItem), "error")
|
||||||
while startStamina > 0 do
|
return
|
||||||
Wait(1000)
|
else
|
||||||
startStamina = startStamina - 1
|
-- if requiredItem == "lighter" then breakTool({ item = "lighter", damage = math.random(0, 1) }) end
|
||||||
RestorePlayerStamina(PlayerId(), 1.0)
|
|
||||||
if math.random(1, 100) < 51 then
|
|
||||||
SetFlash(0, 0, 500, 7000, 500)
|
|
||||||
ShakeGameplayCam('SMALL_EXPLOSION_SHAKE', 0.08)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if IsPedRunning(PlayerPedId()) then
|
|
||||||
SetPedToRagdoll(PlayerPedId(), math.random(1000, 3000), math.random(1000, 3000), 3, 0, 0, 0)
|
debugPrint("^5Debug^7: ^3Consume^7: ^2Starting event, locking inventory and grabbing data^7..")
|
||||||
|
tempLockInv(true)
|
||||||
|
local Player = PlayerPedId()
|
||||||
|
local pedCoords = GetEntityCoords(Player)
|
||||||
|
local emote = Emotes[consumable.emote] or Emotes["crisps"]
|
||||||
|
if isAnimal then --- Animal ped adjustments
|
||||||
|
local presets = {
|
||||||
|
["default"] = {
|
||||||
|
propPlacement = { 0.0, 0.25, -0.04, 0.0, 0.0, 0.0, },
|
||||||
|
propPlacement2 = { 0.0, 0.25, -0.02, 0.0, 0.0, 0.0, }
|
||||||
|
},
|
||||||
|
[`a_c_rabbit_01`] = {
|
||||||
|
propPlacement = { 0.0, 0.37, -0.15, 0.0, 0.0, 0.0, },
|
||||||
|
propPlacement2 = { 0.0, 0.37, -0.13, 0.0, 0.0, 0.0, }
|
||||||
|
},
|
||||||
|
[`a_c_rat`] = {
|
||||||
|
propPlacement = { 0.0, 0.25, -0.04, 0.0, 0.0, 0.0, },
|
||||||
|
propPlacement2 = { 0.0, 0.25, -0.02, 0.0, 0.0, 0.0, }
|
||||||
|
},
|
||||||
|
[`a_c_crow`] = {
|
||||||
|
propPlacement = { 0.0, 0.25, 0.02, 0.0, 0.0, 0.0, },
|
||||||
|
propPlacement2 = { 0.0, 0.25, 0.04, 0.0, 0.0, 0.0, }
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
local model = GetEntityModel(Player)
|
||||||
|
local isCat = (isCat() or model == `ft-raccoon`) and (model ~= `ft-sphynx`)
|
||||||
|
local isDog, bigDog = isDog()
|
||||||
|
if isDog and model == `a_c_coyote` then isDog = false end
|
||||||
|
local isCoyote = (model == `ft-sphynx` or model == `a_c_coyote`)
|
||||||
|
if model == `ft-capmonkey2` then isDog = true end
|
||||||
|
|
||||||
|
local propPlacement, propPlacement2 = { 0.0, 0.37, -0.19, 0.0, 0.0, 0.0, }, { 0.0, 0.37, -0.17, 0.0, 0.0, 0.0, }
|
||||||
|
if isDog then
|
||||||
|
if bigDog or isCoyote then
|
||||||
|
propPlacement = { 0.0, 0.53, -0.39, 0.0, 0.0, 0.0, } propPlacement2 = { 0.0, 0.53, -0.37, 0.0, 0.0, 0.0, }
|
||||||
|
else
|
||||||
|
propPlacement = { 0.0, 0.33, -0.28, 0.0, 0.0, 0.0, } propPlacement2 = { 0.0, 0.33, -0.26, 0.0, 0.0, 0.0, }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if not isCat and not isDog then
|
||||||
|
propPlacement = presets[model] and presets[model].propPlacement or presets["default"].propPlacement
|
||||||
|
propPlacement2 = presets[model] and presets[model].propPlacement2 or presets["default"].propPlacement
|
||||||
|
end
|
||||||
|
|
||||||
|
emote = {
|
||||||
|
"creatures@pug@move", "nill", "",
|
||||||
|
AnimationOptions = {
|
||||||
|
EmoteLoop = true,
|
||||||
|
Prop = "v_res_tt_bowl",
|
||||||
|
PropBone = 64081,
|
||||||
|
PropPlacement = propPlacement,
|
||||||
|
SecondProp = Emotes[consumable.emote].AnimationOptions.Prop or nil,
|
||||||
|
SecondPropBone = Emotes[consumable.emote].AnimationOptions.Prop and 64081 or nil,
|
||||||
|
SecondPropPlacement = Emotes[consumable.emote].AnimationOptions.Prop and propPlacement2 or nil,
|
||||||
|
},
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
startStamina = 0
|
local animDict, anim = tostring(emote[1]), tostring(emote[2])
|
||||||
end
|
local model, model2, bone, bone2, drugeffect, stress
|
||||||
|
local P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12 = table.unpack({0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}) -- Default placement coord cariable
|
||||||
|
local type = consumable.type or ""
|
||||||
|
local string = "Using "
|
||||||
|
local canRun = consumable.canRun
|
||||||
|
local stats = consumable.stats
|
||||||
|
|
||||||
function CrackBaggyEffect()
|
local time, heal, armor, needStats = GenerateRandomValues({
|
||||||
local startStamina = 8
|
time = consumable.time or { 5000, 6000 },
|
||||||
local ped = PlayerPedId()
|
heal = consumable.heal or 0,
|
||||||
--AlienEffect()
|
armor = consumable.armor or 0,
|
||||||
SetRunSprintMultiplierForPlayer(PlayerId(), 1.3)
|
hunger = consumable.stats and consumable.stats.hunger or 0,
|
||||||
while startStamina > 0 do
|
thirst = consumable.stats and consumable.stats.thirst or 0,
|
||||||
Wait(1000)
|
stress = consumable.stress or 0,
|
||||||
if math.random(1, 100) < 10 then
|
})
|
||||||
RestorePlayerStamina(PlayerId(), 1.0)
|
|
||||||
end
|
|
||||||
startStamina = startStamina - 1
|
|
||||||
if math.random(1, 100) < 60 and IsPedRunning(ped) then
|
|
||||||
SetPedToRagdoll(ped, math.random(1000, 2000), math.random(1000, 2000), 3, 0, 0, 0)
|
|
||||||
end
|
|
||||||
if math.random(1, 100) < 51 then
|
|
||||||
--AlienEffect()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if IsPedRunning(ped) then
|
|
||||||
SetPedToRagdoll(ped, math.random(1000, 3000), math.random(1000, 3000), 3, 0, 0, 0)
|
|
||||||
end
|
|
||||||
|
|
||||||
startStamina = 0
|
if emote.AnimationOptions.Prop then
|
||||||
SetRunSprintMultiplierForPlayer(PlayerId(), 1.0)
|
model = emote.AnimationOptions.Prop
|
||||||
end
|
bone = GetPedBoneIndex(Player, emote.AnimationOptions.PropBone)
|
||||||
|
|
||||||
function CokeBaggyEffect()
|
|
||||||
local startStamina = 20
|
|
||||||
local ped = PlayerPedId()
|
|
||||||
--AlienEffect()
|
|
||||||
SetRunSprintMultiplierForPlayer(PlayerId(), 1.1)
|
|
||||||
while startStamina > 0 do
|
|
||||||
Wait(1000)
|
|
||||||
if math.random(1, 100) < 20 then
|
|
||||||
RestorePlayerStamina(PlayerId(), 1.0)
|
|
||||||
end
|
|
||||||
startStamina = startStamina - 1
|
|
||||||
if math.random(1, 100) < 10 and IsPedRunning(ped) then
|
|
||||||
SetPedToRagdoll(ped, math.random(1000, 3000), math.random(1000, 3000), 3, 0, 0, 0)
|
|
||||||
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, 0, 0, 0)
|
|
||||||
end
|
|
||||||
|
|
||||||
startStamina = 0
|
|
||||||
SetRunSprintMultiplierForPlayer(PlayerId(), 1.0)
|
|
||||||
end]]
|
|
||||||
|
|
||||||
local consuming = false
|
|
||||||
local cancelled = false
|
|
||||||
|
|
||||||
RegisterNetEvent('jim-consumables:Consume', function(itemName)
|
|
||||||
local time = math.random(5000, 6000) -- How long it takes to consume something
|
|
||||||
local Player = PlayerPedId()
|
|
||||||
local emote = Config.Emotes[Config.Consumables[itemName].emote]
|
|
||||||
local animDict = tostring(emote[1])
|
|
||||||
local anim = tostring(emote[2])
|
|
||||||
local model, bone, drugeffect, stress = nil
|
|
||||||
local P1, P2, P3, P4, P5, P6 = table.unpack({0.0, 0.0, 0.0, 0.0, 0.0, 0.0})
|
|
||||||
if emote.AnimationOptions.Prop then
|
|
||||||
model = tostring(emote.AnimationOptions.Prop)
|
|
||||||
bone = GetPedBoneIndex(PlayerPedId(), emote.AnimationOptions.PropBone)
|
|
||||||
P1, P2, P3, P4, P5, P6 = table.unpack(emote.AnimationOptions.PropPlacement)
|
P1, P2, P3, P4, P5, P6 = table.unpack(emote.AnimationOptions.PropPlacement)
|
||||||
end
|
if emote.AnimationOptions.SecondProp then
|
||||||
local type = Config.Consumables[itemName].type
|
model2 = emote.AnimationOptions.SecondProp
|
||||||
local stress = Config.Consumables[itemName].stress
|
bone2 = GetPedBoneIndex(Player, emote.AnimationOptions.SecondPropBone)
|
||||||
local heal = Config.Consumables[itemName].heal
|
P7, P8, P9, P10, P11, P12 = table.unpack(emote.AnimationOptions.SecondPropPlacement)
|
||||||
local armor = Config.Consumables[itemName].armor
|
end
|
||||||
if type == "drink" or type == "alcohol" then string = "Drinking " end
|
end
|
||||||
if type == "food" then string = "Eating " end
|
|
||||||
if type == "drug" then string = "Using " end
|
|
||||||
|
|
||||||
if consuming then
|
if type == "drink" or type == "alcohol" then
|
||||||
cancelled = true
|
string = "Drinking "
|
||||||
TriggerEvent("QBCore:Notify", "Stopped "..string, "error")
|
elseif type == "food" then
|
||||||
|
string = "Eating "
|
||||||
|
elseif type == "smoke" then
|
||||||
|
string = "Smoking "
|
||||||
|
elseif type == "pack" then
|
||||||
|
string = "Opening "
|
||||||
|
end
|
||||||
|
|
||||||
|
if consuming then
|
||||||
|
cancelled = true
|
||||||
|
debugPrint("^5Debug^7: ^3Consume^7: ^2Event already started^7, ^1Cancelling^7.")
|
||||||
|
tempLockInv(false)
|
||||||
|
if Config.UseProgbar then
|
||||||
|
stopProgressBar()
|
||||||
|
else
|
||||||
|
triggerNotify(nil, "Stopped "..string, "error")
|
||||||
|
end
|
||||||
consuming = not consuming
|
consuming = not consuming
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
--Emote Stuff
|
--Emote Stuff
|
||||||
if emote.AnimationOptions then
|
debugPrint("^5Debug^7: ^3Consume^7: ^2Grabbing Emote Animation Options^7...")
|
||||||
if emote.AnimationOptions.EmoteLoop then MovementType = 1
|
local InVehicle = IsPedInAnyVehicle(Player, true)
|
||||||
if emote.AnimationOptions.EmoteMoving then MovementType = 51
|
debugPrint("^5Debug^7: ^3Consume^7: ^2Checking if player is in a vehicle^7 - ^6"..tostring(InVehicle).."^7")
|
||||||
end
|
|
||||||
elseif emote.AnimationOptions.EmoteMoving then MovementType = 51
|
|
||||||
elseif emote.AnimationOptions.EmoteMoving == false then MovementType = 0
|
|
||||||
elseif emote.AnimationOptions.EmoteStuck then MovementType = 50
|
|
||||||
end
|
|
||||||
|
|
||||||
else MovementType = 0 end
|
MovementType = 0 -- Default movement type
|
||||||
InVehicle = IsPedInAnyVehicle(PlayerPedId(), true)
|
|
||||||
if InVehicle == 1 then MovementType = 51 end
|
|
||||||
|
|
||||||
--Load and Start animation
|
if InVehicle == 1 then
|
||||||
loadAnimDict(animDict)
|
MovementType = 51
|
||||||
TaskPlayAnim(Player, animDict, anim, 1.0, 1.0, -1, MovementType, 0, 0, 0, 0)
|
elseif emote.AnimationOptions then
|
||||||
|
if emote.AnimationOptions.EmoteMoving then
|
||||||
--Prop Spawning
|
MovementType = 51
|
||||||
if model then
|
elseif emote.AnimationOptions.EmoteLoop then
|
||||||
RequestModel(GetHashKey(model))
|
MovementType = 1
|
||||||
while not HasModelLoaded(GetHashKey(model)) do Citizen.Wait(1) end
|
elseif emote.AnimationOptions.EmoteStuck then
|
||||||
local attachProp = CreateObject(GetHashKey(model), 1.0, 1.0, 1.0, 1, 1, 0)
|
MovementType = emote.AnimationOptions.EmoteMoving and 50 or 2
|
||||||
AttachEntityToEntity(attachProp, PlayerPedId(), bone, P1, P2, P3, P4, P5, P6, true, true, false, true, 1, true)
|
elseif emote.AnimationOptions.EmoteMoving == false then
|
||||||
end
|
MovementType = 0
|
||||||
|
|
||||||
|
|
||||||
TriggerEvent("QBCore:Notify", string..QBCore.Shared.Items[itemName].label.."..", "success", (time + 1000))
|
|
||||||
consuming = true
|
|
||||||
while consuming do
|
|
||||||
if time <= 0 then consuming = false end
|
|
||||||
if IsControlJustPressed(0, 21) then
|
|
||||||
consuming = false
|
|
||||||
cancelled = true
|
|
||||||
end
|
|
||||||
Wait(10)
|
|
||||||
time = time - 10
|
|
||||||
end
|
|
||||||
|
|
||||||
StopEntityAnim(Player, anim, animDict, 1.0)
|
|
||||||
DeleteEntity(attachProp)
|
|
||||||
|
|
||||||
if not cancelled then
|
|
||||||
TriggerEvent("inventory:client:ItemBox", QBCore.Shared.Items[itemName], "remove", 1)
|
|
||||||
TriggerServerEvent("QBCore:Server:RemoveItem", itemName, 1)
|
|
||||||
|
|
||||||
if QBCore.Shared.Items[itemName].thirst then
|
|
||||||
TriggerServerEvent("QBCore:Server:SetMetaData", "thirst", QBCore.Functions.GetPlayerData().metadata["thirst"] + QBCore.Shared.Items[itemName].thirst) end
|
|
||||||
if QBCore.Shared.Items[itemName].hunger then
|
|
||||||
TriggerServerEvent("QBCore:Server:SetMetaData", "hunger", QBCore.Functions.GetPlayerData().metadata["hunger"] + QBCore.Shared.Items[itemName].hunger) end
|
|
||||||
|
|
||||||
if not QBCore.Shared.Items[itemName].thirst and not QBCore.Shared.Items[itemName].hunger then
|
|
||||||
local hunger = 0
|
|
||||||
local thirst = 0
|
|
||||||
if Config.Consumables[itemName].stats then
|
|
||||||
if Config.Consumables[itemName].stats.hunger then hunger = Config.Consumables[itemName].stats.hunger end
|
|
||||||
TriggerServerEvent("QBCore:Server:SetMetaData", "hunger", QBCore.Functions.GetPlayerData().metadata["hunger"] + hunger)
|
|
||||||
if Config.Consumables[itemName].stats.thirst then thirst = Config.Consumables[itemName].stats.thirst end
|
|
||||||
TriggerServerEvent("QBCore:Server:SetMetaData", "thirst", QBCore.Functions.GetPlayerData().metadata["thirst"] + thirst)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if stress then TriggerServerEvent('hud:server:RelieveStress', stress) end
|
|
||||||
|
|
||||||
if heal then SetEntityHealth(Player, GetEntityHealth(Player) + heal) end
|
|
||||||
|
|
||||||
if armor then TriggerServerEvent('hospital:server:SetArmor', (GetPedArmour(Player) + armor)) SetPedArmour(Player, (GetPedArmour(Player) + armor)) end
|
|
||||||
|
|
||||||
if type == "alcohol" then
|
|
||||||
alcoholCount = alcoholCount + 1
|
|
||||||
if alcoholCount > 1 and alcoholCount < 4 then
|
|
||||||
TriggerEvent("evidence:client:SetStatus", "alcohol", 200)
|
|
||||||
elseif alcoholCount >= 4 then
|
|
||||||
TriggerEvent("evidence:client:SetStatus", "heavyalcohol", 200)
|
|
||||||
AlienEffect()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
effect = Config.Consumables[itemName].effect
|
end
|
||||||
|
--Load and Start animation
|
||||||
|
debugPrint("^5Debug^7: ^3Consume^7: ^2Playing Animation^7...")
|
||||||
|
if not (GetPedType(Player) == 28)then
|
||||||
|
playAnim(animDict, anim, -1, MovementType)
|
||||||
|
end
|
||||||
|
debugPrint("^5Debug^7: ^3Consume^7: ^2Player Movement Flag^7 - ^6"..json.encode(MovementType).." ^7")
|
||||||
|
if Config.Main.UseProgbar then
|
||||||
|
CreateThread(function()
|
||||||
|
if progressBar({
|
||||||
|
time = time,
|
||||||
|
label = string..getItemLabel(itemName).."..",
|
||||||
|
dead = false,
|
||||||
|
disableMovement = false,
|
||||||
|
disableCombat = true,
|
||||||
|
cancel = false
|
||||||
|
}) then
|
||||||
|
consuming = false
|
||||||
|
else
|
||||||
|
consuming = false
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
else
|
||||||
|
triggerNotify(nil, string..getItemLabel(itemName).."..", "success")
|
||||||
|
end
|
||||||
|
|
||||||
if effect ~= nil then
|
consuming = true
|
||||||
if effect.canOD then
|
|
||||||
drugCount = drugCount + 1
|
CreateThread(function()
|
||||||
if drugCount >= 4 then
|
--Prop Spawning
|
||||||
SetEntityHealth(PlayerPedId(), GetEntityHealth(PlayerPedId()) - math.random(10,15))
|
if model then
|
||||||
if drugCount >= 6 then
|
if IsModelValid(model) == 1 then
|
||||||
AlienEffect()
|
debugPrint("^5Debug^7: ^3PropSpawn^7: ^2Spawning consumable prop^7...")
|
||||||
end
|
attachProp = makeProp({ prop = model, coords = vec4(pedCoords.x, pedCoords.y, pedCoords.z, 0.0)}, 1, 1, true)
|
||||||
|
AttachEntityToEntity(attachProp, Player, bone, P1, P2, P3, P4, P5, P6, true, true, false, true, 1, true)
|
||||||
|
if model2 then
|
||||||
|
if IsModelValid(model2) == 1 then
|
||||||
|
attachProp2 = makeProp({ prop = model2, coords = vec4(pedCoords.x, pedCoords.y, pedCoords.z, 0.0)}, 1, 1)
|
||||||
|
AttachEntityToEntity(attachProp2, Player, bone2, P7, P8, P9, P10, P11, P12, true, true, false, true, 1, true)
|
||||||
|
else
|
||||||
|
print("^5Debug^7: ^3PropSpawn^7: ^2Second prop model isn't valid/found^7.")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
while consuming do Wait(50) end
|
||||||
|
if DoesEntityExist(attachProp) then
|
||||||
|
destroyProp(attachProp)
|
||||||
|
attachProp = nil
|
||||||
|
end
|
||||||
|
if DoesEntityExist(attachProp2) then
|
||||||
|
destroyProp(attachProp2)
|
||||||
|
attachProp2 = nil
|
||||||
|
end
|
||||||
|
else
|
||||||
|
print("^5Debug^7: ^3PropSpawn^7: ^2Prop model isn't valid/found^7.")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
while consuming do
|
||||||
|
if debugMode then
|
||||||
|
drawText(nil, {
|
||||||
|
"Time: "..tostring(time),
|
||||||
|
"Type: "..(type or ""),
|
||||||
|
"Hunger: "..(needStats.hunger or 0).."%",
|
||||||
|
"Thirst: "..(needStats.thirst or 0).."%",
|
||||||
|
"Stress: "..(needStats.stress or 0).."%",
|
||||||
|
"Heal: "..(heal or 0).."%",
|
||||||
|
"Armour: "..(armor or 0).."%",
|
||||||
|
}, nil, nil)
|
||||||
|
end
|
||||||
|
makeInstructionalButtons({
|
||||||
|
{ keys = { 194 }, text = "Stop Consuming" },
|
||||||
|
})
|
||||||
|
if time <= 0 then
|
||||||
|
consuming = false
|
||||||
|
end
|
||||||
|
if (IsControlJustPressed(0, 21) and not canRun) or IsPedRagdoll(Player) or IsControlJustPressed(0, 177) then
|
||||||
|
consuming = false
|
||||||
|
cancelled = true
|
||||||
|
tempLockInv(false)
|
||||||
|
hideText()
|
||||||
|
if Config.Main.UseProgbar then
|
||||||
|
stopProgressBar()
|
||||||
|
else
|
||||||
|
triggerNotify(nil, "Cancelled "..string, "error")
|
||||||
|
end
|
||||||
|
TriggerServerEvent(getScript()..":server:stopConsume")
|
||||||
|
end
|
||||||
|
Wait(0)
|
||||||
|
time -= 12
|
||||||
|
end
|
||||||
|
StopEntityAnim(Player, anim, animDict, 1.0)
|
||||||
|
unloadAnimDict(animDict)
|
||||||
|
|
||||||
|
if not cancelled then
|
||||||
|
hideText()
|
||||||
|
|
||||||
|
TriggerServerEvent(getScript()..":server:finishConsume", needStats)
|
||||||
|
|
||||||
|
if heal and heal ~= 0 then
|
||||||
|
debugPrint("^5Debug^7: ^3Consume^7: ^2Healing player by^7: ^6"..heal)
|
||||||
|
SetEntityHealth(Player, GetEntityHealth(Player) + heal)
|
||||||
|
end
|
||||||
|
if armor and armor ~= 0 then
|
||||||
|
debugPrint("^5Debug^7: ^3Consume^7: ^2Adding ^6"..armor.." ^2armour^7.")
|
||||||
|
TriggerServerEvent('hospital:server:SetArmor', (GetPedArmour(Player) + armor)) SetPedArmour(Player, (GetPedArmour(Player) + armor))
|
||||||
|
end
|
||||||
|
if type == "alcohol" then
|
||||||
|
if checkExportExists("jim_bridge", "addAlcoholCount") then
|
||||||
|
exports.jim_bridge:addAlcoholCount(1, stats.canOD)
|
||||||
|
else
|
||||||
|
alcoholCount = alcoholCount + 1
|
||||||
|
debugPrint("^5Debug^7: ^3Consume^7: ^2Current ^4alcoholCount^7: ^6"..alcoholCount)
|
||||||
|
if alcoholCount > 1 and alcoholCount <= 4 then
|
||||||
|
TriggerEvent("evidence:client:SetStatus", "alcohol", 200)
|
||||||
|
elseif alcoholCount >= 4 then
|
||||||
|
TriggerEvent("evidence:client:SetStatus", "heavyalcohol", 200)
|
||||||
|
CreateThread(function()
|
||||||
|
AlienEffect()
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
if stats.canOD and alcoholCount >= 5 then
|
||||||
|
SetEntityHealth(Player, GetEntityHealth(Player) - math.random(5, 10))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if type == "drug" then
|
||||||
|
if checkExportExists("jim_bridge", "addDrugCount") then
|
||||||
|
exports.jim_bridge:addDrugCount(1, stats.canOD or false)
|
||||||
|
else
|
||||||
|
drugCount = drugCount + 1
|
||||||
|
debugPrint("^5Debug^7: ^3Consume^7: ^2Current ^4drugCount^7: ^6"..drugCount)
|
||||||
|
if drugCount > 3 and drugCount < 7 then
|
||||||
|
|
||||||
|
elseif drugCount >= 7 then
|
||||||
|
CreateThread(function()
|
||||||
|
AlienEffect()
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
if stats.canOD and drugCount >= 4 then
|
||||||
|
SetEntityHealth(Player, GetEntityHealth(Player) - math.random(5, 10))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if stats then
|
||||||
|
if stats.screen then -- Screen effect activation
|
||||||
|
debugPrint(stats.screen)
|
||||||
|
local statFunctions = {
|
||||||
|
["turbo"] = TurboEffect,
|
||||||
|
["focus"] = FocusEffect,
|
||||||
|
["rampage"] = RampageEffect,
|
||||||
|
["weed"] = WeedEffect,
|
||||||
|
["trevor"] = TrevorEffect,
|
||||||
|
["nightvision"] = NightVisionEffect,
|
||||||
|
["thermal"] = ThermalEffect,
|
||||||
|
}
|
||||||
|
if statFunctions[stats.screen] then
|
||||||
|
CreateThread(function()
|
||||||
|
statFunctions[stats.screen]()
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if stats.canOD then
|
||||||
|
if drugCount >= 4 or alcoholCount >= 5 then
|
||||||
|
SetEntityHealth(Player, GetEntityHealth(Player) - math.random(5, 10))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if effect.effect == "weed" then
|
if stats.effect then
|
||||||
if drugCount >= 2 then
|
local effectTable = {
|
||||||
TrevorEffect()
|
["heal"] = function(stats)
|
||||||
end
|
if isStarted("ps-buffs") then
|
||||||
end
|
debugPrint("^5Debug^7: ^3Consume^7: ^4PS^7-^4Buffs ^2found^7, ^2hooking in to get buffs and applying ^6Health Buff ^2for ^6"..stats.time.."^7ms")
|
||||||
if effect.effect == "heal" then
|
exports["ps-buffs"]:AddHealthBuff((tonumber(stats.time) or 10000), (stats.amount or 6))
|
||||||
HealEffect()
|
else
|
||||||
end
|
CreateThread(function()
|
||||||
if effect.effect == "healdouble" then
|
HealEffect({(tonumber(stats.time) or 10000), (stats.amount or 6)})
|
||||||
HealEffect()
|
end)
|
||||||
end
|
end
|
||||||
if effect.effect == "stamina" then
|
end,
|
||||||
StaminaEffect()
|
["stamina"] = function(stats)
|
||||||
if drugCount >= 4 then
|
if isStarted("ps-buffs") then
|
||||||
TrevorEffect()
|
debugPrint("^5Debug^7: ^3Consume^7: ^4PS^7-^4Buffs ^2found^7, ^2hooking in to get buffs and applying ^6Stamina Buff ^2for ^6"..stats.time.."^7ms")
|
||||||
end
|
exports["ps-buffs"]:StaminaBuffEffect((tonumber(stats.time) or 10000), (stats.amount or 6))
|
||||||
end
|
else
|
||||||
if effect.widepupils then
|
CreateThread(function()
|
||||||
TriggerEvent("evidence:client:SetStatus", "widepupils", 200)
|
StaminaEffect({(tonumber(stats.time) or 10000), (stats.amount or 6)})
|
||||||
--EcstasyEffect()
|
end)
|
||||||
end
|
end
|
||||||
|
end,
|
||||||
|
["armor"] = function(stats)
|
||||||
|
if isStarted("ps-buffs") then --PS-BUFFS ONLY
|
||||||
|
exports["ps-buffs"]:AddArmorBuff((tonumber(stats.time) or 10000), (stats.amount or 6))
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
["stress"] = function(stats)
|
||||||
|
if isStarted("ps-buffs") then --PS-BUFFS ONLY
|
||||||
|
exports["ps-buffs"]:AddStressBuff((tonumber(stats.time) or 10000), (stats.amount or 6))
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
["swimming"] = function(stats)
|
||||||
|
if isStarted("ps-buffs") then --PS-BUFFS ONLY
|
||||||
|
exports["ps-buffs"]:SwimmingBuffEffect((tonumber(stats.time) or 10000), (stats.amount or 6))
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
["hacking"] = function(stats)
|
||||||
|
if isStarted("ps-buffs") then --PS-BUFFS ONLY
|
||||||
|
exports["ps-buffs"]:AddBuff("hacking", (tonumber(stats.time) or 10000))
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
["intelligence"] = function(stats)
|
||||||
|
if isStarted("ps-buffs") then --PS-BUFFS ONLY
|
||||||
|
exports["ps-buffs"]:AddBuff("intelligence", (tonumber(stats.time) or 10000))
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
["luck"] = function(stats)
|
||||||
|
if isStarted("ps-buffs") then --PS-BUFFS ONLY
|
||||||
|
exports["ps-buffs"]:AddBuff("luck", (tonumber(stats.time) or 10000))
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
["strength"] = function(stats)
|
||||||
|
if isStarted("ps-buffs") then --PS-BUFFS ONLY
|
||||||
|
exports["ps-buffs"]:AddBuff("strength", (tonumber(stats.time) or 10000))
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
if effectTable[stats.effect] then
|
||||||
|
effectTable[stats.effect](stats)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if stats.widepupils then
|
||||||
|
TriggerEvent("evidence:client:SetStatus", "widepupils", 200)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
cancelled = false
|
cancelled = false
|
||||||
consuming = false
|
consuming = false
|
||||||
for k, v in pairs(GetGamePool('CObject')) do
|
debugPrint("^5Debug^7: ^3Consume^7: ^2Finished, unlocking inventory^7...")
|
||||||
if IsEntityAttachedToEntity(PlayerPedId(), v) then
|
tempLockInv(false)
|
||||||
DeleteObject(v)
|
|
||||||
DetachEntity(v, 0, 0)
|
|
||||||
SetEntityAsMissionEntity(v, true, true)
|
|
||||||
Wait(100)
|
|
||||||
DeleteEntity(v)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
@@ -333,20 +446,23 @@ CreateThread(function()
|
|||||||
Wait(10)
|
Wait(10)
|
||||||
if alcoholCount > 0 then
|
if alcoholCount > 0 then
|
||||||
Wait(1000 * 60 * 15)
|
Wait(1000 * 60 * 15)
|
||||||
alcoholCount = alcoholCount - 1
|
alcoholCount -= 1
|
||||||
else
|
else
|
||||||
Wait(2000)
|
Wait(1000)
|
||||||
|
end
|
||||||
|
if drugCount > 0 then
|
||||||
|
Wait(1000 * 60 * 15)
|
||||||
|
drugCount -= 1
|
||||||
|
else
|
||||||
|
Wait(1000)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
CreateThread(function()
|
|
||||||
while true do
|
onResourceStop(function()
|
||||||
Wait(10)
|
|
||||||
if drugCount > 0 then
|
lockInv(false)
|
||||||
Wait(1000 * 60 * 15)
|
|
||||||
drugCount = drugCount - 1
|
StopEffects()
|
||||||
else
|
|
||||||
Wait(2000)
|
end, true)
|
||||||
end
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
249
client/consumableCreator.lua
Normal file
249
client/consumableCreator.lua
Normal file
@@ -0,0 +1,249 @@
|
|||||||
|
RegisterNetEvent("jim-consumables:client:consumableCreator", function()
|
||||||
|
local itemTable, emoteTable = {}, {}
|
||||||
|
for k, v in pairsByKeys(Items) do itemTable[#itemTable+1] = { value = tostring(k), label = tostring((v.label or k)) } end
|
||||||
|
table.sort(itemTable, function(a, b) return a.label < b.label end)
|
||||||
|
for k in pairsByKeys(Emotes) do emoteTable[#emoteTable+1] = { value = k, label = k } end
|
||||||
|
local input = lib.inputDialog("Consumable Creator", {
|
||||||
|
{ type = "select",
|
||||||
|
label = "Item List",
|
||||||
|
options = itemTable,
|
||||||
|
required = true,
|
||||||
|
icon = "fas fa-burger",
|
||||||
|
clearable = true,
|
||||||
|
searchable = true -- Doesnt work as i think only ox_lib lua was updated, the web stuff doesn't support this
|
||||||
|
},
|
||||||
|
{ type = "select",
|
||||||
|
label = "Emote",
|
||||||
|
options = emoteTable,
|
||||||
|
required = true,
|
||||||
|
icon = "fas fa-user",
|
||||||
|
clearable = true,
|
||||||
|
searchable = true, -- Doesnt work as i think only ox_lib lua was updated, the web stuff doesn't support this
|
||||||
|
default = "burger",
|
||||||
|
},
|
||||||
|
{ type = "select",
|
||||||
|
label = "Item Required for consuming",
|
||||||
|
options = itemTable,
|
||||||
|
required = false,
|
||||||
|
icon = "fas fa-utensils",
|
||||||
|
clearable = true,
|
||||||
|
searchable = true -- Doesnt work as i think only ox_lib lua was updated, the web stuff doesn't support this
|
||||||
|
},
|
||||||
|
{ type = 'number', label = 'Time', description = "How long it takes in ms to consume item", default = 5000, icon = "fas fa-clock", },
|
||||||
|
{ type = 'number', label = 'Stress Relief', description = "How much stress to relieve", default = 0, icon = "fas fa-mug-hot", },
|
||||||
|
{ type = 'number', label = 'Healing Amount', description = "How much to heal after consuming", default = 0, icon = "fas fa-notes-medical", },
|
||||||
|
{ type = 'number', label = 'Armour', description = "How much armour to give after consuming", default = 0, icon = "fas fa-shield-halved", },
|
||||||
|
{ type = "select", label = "Type", default = "food", icon = "fas fa-box", options = {
|
||||||
|
{ value = "food", label = "Food" },
|
||||||
|
{ value = "drink", label = "Drink" },
|
||||||
|
{ value = "alcohol", label = "Alcohol" },
|
||||||
|
{ value = "drug", label = "Drugs" },
|
||||||
|
{ value = "smoke", label = "Cigar/Cigarette" },
|
||||||
|
{ value = "pack", label = "Pack (Container Item)" },
|
||||||
|
}},
|
||||||
|
})
|
||||||
|
if not input or not input[1] then return end
|
||||||
|
local resultTable = {
|
||||||
|
item = input[1],
|
||||||
|
emote = input[2],
|
||||||
|
requireItem = input[3] or nil,
|
||||||
|
time = { input[4], input[4] + 1000 },
|
||||||
|
stress = input[5],
|
||||||
|
heal = input[6],
|
||||||
|
armor = input[7],
|
||||||
|
type = input[8],
|
||||||
|
}
|
||||||
|
if resultTable.type == "food" or resultTable.type == "drink" then foodInput(resultTable)
|
||||||
|
elseif resultTable.type == "pack" then packInput(resultTable, itemTable)
|
||||||
|
else
|
||||||
|
ExtraStatsInput(resultTable)
|
||||||
|
end
|
||||||
|
end, false)
|
||||||
|
|
||||||
|
function foodInput(prevInput)
|
||||||
|
local resultTable = prevInput
|
||||||
|
local input = lib.inputDialog((Items[prevInput.item].label or prevInput.item).." - Food or Drink",{
|
||||||
|
{ type = 'number', label = 'Hunger %', default = 0, icon = "fas fa-burger", },
|
||||||
|
{ type = 'number', label = 'Thirst %', default = 0, icon = "fas fa-mug-hot", },
|
||||||
|
})
|
||||||
|
if not input or not input[1] then return end
|
||||||
|
resultTable["stats"] = {
|
||||||
|
hunger = input[1] ~= 0 and { input[1], input[1] + 10 } or 0,
|
||||||
|
thirst = input[2] ~= 0 and { input[2], input[2] + 10 } or 0,
|
||||||
|
}
|
||||||
|
ExtraStatsInput(resultTable)
|
||||||
|
end
|
||||||
|
|
||||||
|
function packInput(prevInput, itemTable)
|
||||||
|
local resultTable = prevInput
|
||||||
|
local input = lib.inputDialog((Items[prevInput.item].label or prevInput.item).." - Pack", {
|
||||||
|
{ type = "select",
|
||||||
|
label = "Item List",
|
||||||
|
options = itemTable,
|
||||||
|
required = true,
|
||||||
|
icon = "fas fa-burger",
|
||||||
|
},
|
||||||
|
{ type = 'number', label = 'Amount to give of item', default = 1, icon = "fas fa-box", },
|
||||||
|
})
|
||||||
|
resultTable["pack"] = { item = input[1], amount = input[2], }
|
||||||
|
getConsumableResult(resultTable)
|
||||||
|
end
|
||||||
|
|
||||||
|
function ExtraStatsInput(prevInput)
|
||||||
|
local resultTable = prevInput
|
||||||
|
local input = lib.inputDialog((Items[prevInput.item].label or prevInput.item).." - Extra Stats", {
|
||||||
|
{ type = "select", label = "Buff Type", description = "These are 'gradual' buff effects", default = "none", options = {
|
||||||
|
{ value = "none", label = "None" },
|
||||||
|
{ value = "heal", label = "Healing" },
|
||||||
|
{ value = "stamina", label = "Stamina" },
|
||||||
|
{ value = "armor", label = "Armour" },
|
||||||
|
{ value = "stress", label = "Stress" },
|
||||||
|
{ value = "swimming", label = "Swimming" },
|
||||||
|
{ value = "hacking", label = "Hacking" },
|
||||||
|
{ value = "intelligence", label = "Intelligence" },
|
||||||
|
{ value = "luck", label = "Luck" },
|
||||||
|
{ value = "strength", label = "Strength" },
|
||||||
|
}},
|
||||||
|
{ type = "select", label = "Screen Effect", default = "none", options = {
|
||||||
|
{ value = "none", label = "None" },
|
||||||
|
{ value = "rampage", label = "Rampage" },
|
||||||
|
{ value = "turbo", label = "Turbo" },
|
||||||
|
{ value = "focus", label = "Focus" },
|
||||||
|
{ value = "weed", label = "Weed" },
|
||||||
|
{ value = "trevor", label = "Trevor" },
|
||||||
|
{ value = "nightvision", label = "Night Vision" },
|
||||||
|
{ value = "thermal", label = "Thermal Vision" },
|
||||||
|
}},
|
||||||
|
{ type = "number", label = "Total Time of 'Buff'", default = 10000, },
|
||||||
|
{ type = "number", label = "Amount to give per second", default = 6, },
|
||||||
|
((prevInput.type ~= "food" and prevInput.type ~= "drink") and { type = "select", label = "Wide Pupils", default = "false", options = {
|
||||||
|
{ value = "true", label = "True" },
|
||||||
|
{ value = "false", label = "False" },
|
||||||
|
}} or nil),
|
||||||
|
((prevInput.type ~= "food" and prevInput.type ~= "drink") and { type = "select", label = "Can Over Dose", default = "false", options = {
|
||||||
|
{ value = "true", label = "True" },
|
||||||
|
{ value = "false", label = "False" },
|
||||||
|
}} or nil),
|
||||||
|
})
|
||||||
|
if not input or not input[1] then return end
|
||||||
|
resultTable["stats"] = {
|
||||||
|
hunger = resultTable["stats"] and resultTable["stats"].hunger or 0,
|
||||||
|
thirst = resultTable["stats"] and resultTable["stats"].thirst or 0,
|
||||||
|
screen = input[2] or nil,
|
||||||
|
effect = input[1] or nil,
|
||||||
|
time = input[1] ~= "none" and input[3] or nil,
|
||||||
|
amount = input[1] ~= "none" and input[4] or nil,
|
||||||
|
widepupils = input[5],
|
||||||
|
canOD = input[6],
|
||||||
|
}
|
||||||
|
getConsumableResult(resultTable)
|
||||||
|
end
|
||||||
|
|
||||||
|
function getConsumableResult(data)
|
||||||
|
local resultString = '["'..data.item..'"] = { '
|
||||||
|
resultString = resultString..'emote = "'..data.emote..'", '
|
||||||
|
resultString = resultString.."canRun = true, "
|
||||||
|
resultString = resultString.."time = {"..data.time[1]..", "..data.time[2].."}, "
|
||||||
|
resultString = (data.stress > 0 and resultString.."stress = "..data.stress..", ") or resultString..""
|
||||||
|
resultString = (data.heal > 0 and resultString.."heal = "..data.heal..", ") or resultString..""
|
||||||
|
resultString = (data.armor > 0 and resultString.."armor = "..data.armor..", ") or resultString..""
|
||||||
|
resultString = resultString..'type = "'..data.type..'", '
|
||||||
|
if data.type == "pack" then
|
||||||
|
resultString = resultString..'pack = { item = "'..data.pack.item..'", amount = "'..data.pack.amount..'", }, '
|
||||||
|
end
|
||||||
|
if data.stats then
|
||||||
|
resultString = resultString.."stats = { "
|
||||||
|
if data.stats.hunger and type(data.stats.hunger) == "table" then
|
||||||
|
resultString = resultString..'hunger = { '..data.stats.hunger[1]..', '..data.stats.hunger[2]..' }, '
|
||||||
|
end
|
||||||
|
if data.stats.thirst and type(data.stats.thirst) == "table" then
|
||||||
|
resultString = resultString..'thirst = { '..data.stats.thirst[1]..', '..data.stats.thirst[2]..' }, '
|
||||||
|
end
|
||||||
|
if data.stats.screen and data.stats.screen ~= "none" then
|
||||||
|
resultString = resultString..'screen = "'..data.stats.screen..'", '
|
||||||
|
end
|
||||||
|
if data.stats.effect and data.stats.effect ~= "none" then
|
||||||
|
resultString = resultString..'effect = "'..data.stats.effect..'", '
|
||||||
|
resultString = resultString..'time = "'..data.stats.time..'", '
|
||||||
|
resultString = resultString..'amount = "'..data.stats.amount..'", '
|
||||||
|
end
|
||||||
|
if data.stats.widepupils == "true" then
|
||||||
|
resultString = resultString..'widepupils = "'..data.stats.widepupils..'", '
|
||||||
|
end
|
||||||
|
if data.stats.canOD == "true" then
|
||||||
|
resultString = resultString..'canOD = "'..data.stats.canOD..'", '
|
||||||
|
end
|
||||||
|
end
|
||||||
|
triggerNotify(nil, "Copied new consumable info to clipboard", "success")
|
||||||
|
lib.setClipboard(resultString .. " },")
|
||||||
|
end
|
||||||
|
|
||||||
|
RegisterNetEvent("jim-consumables:client:testEmotes", function()
|
||||||
|
local Menu = {}
|
||||||
|
for k, v in pairsByKeys(Emotes) do
|
||||||
|
Menu[#Menu+1] = {
|
||||||
|
header = k,
|
||||||
|
onSelect = function()
|
||||||
|
testEmote(v, k)
|
||||||
|
end
|
||||||
|
}
|
||||||
|
end
|
||||||
|
openMenu(Menu, { header = "Test Consumable Emotes" })
|
||||||
|
end)
|
||||||
|
|
||||||
|
function testEmote(emote, name)
|
||||||
|
triggerNotify(nil, "Testing "..name, "warning")
|
||||||
|
triggerNotify(nil, "Anim will loop twice then return to menu", "warning")
|
||||||
|
local MovementType = nil
|
||||||
|
local Player = PlayerPedId()
|
||||||
|
local InVehicle = IsPedInAnyVehicle(Player, true)
|
||||||
|
|
||||||
|
local animDict, anim = tostring(emote[1]), tostring(emote[2])
|
||||||
|
local model, model2, bone, bone2
|
||||||
|
local P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12 = table.unpack({0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}) -- Default placement coord cariable
|
||||||
|
if emote.AnimationOptions.Prop then
|
||||||
|
model = emote.AnimationOptions.Prop
|
||||||
|
bone = GetPedBoneIndex(Player, emote.AnimationOptions.PropBone)
|
||||||
|
P1, P2, P3, P4, P5, P6 = table.unpack(emote.AnimationOptions.PropPlacement)
|
||||||
|
if emote.AnimationOptions.SecondProp then
|
||||||
|
model2 = emote.AnimationOptions.SecondProp
|
||||||
|
bone2 = GetPedBoneIndex(Player, emote.AnimationOptions.SecondPropBone)
|
||||||
|
P7, P8, P9, P10, P11, P12 = table.unpack(emote.AnimationOptions.SecondPropPlacement)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if InVehicle == 1 then
|
||||||
|
MovementType = 51
|
||||||
|
elseif emote.AnimationOptions then
|
||||||
|
if emote.AnimationOptions.EmoteMoving then MovementType = 51
|
||||||
|
elseif emote.AnimationOptions.EmoteLoop then MovementType = 1
|
||||||
|
elseif emote.AnimationOptions.EmoteStuck then MovementType = emote.AnimationOptions.EmoteMoving and 50 or 2
|
||||||
|
elseif emote.AnimationOptions.EmoteMoving == false then MovementType = 0 end
|
||||||
|
end
|
||||||
|
|
||||||
|
playAnim(animDict, anim, (GetAnimDuration(animDict, anim) * 1000 )*2, MovementType)
|
||||||
|
local consuming = true
|
||||||
|
--Prop Spawning
|
||||||
|
CreateThread(function()
|
||||||
|
if model then
|
||||||
|
if IsModelValid(model) == 1 then
|
||||||
|
triggerNotify(nil, "Debug: Spawning consumable prop")
|
||||||
|
attachProp = makeProp({ prop = model, coords = vector4(0.0,0.0,0.0,0.0)}, 1, 1)
|
||||||
|
AttachEntityToEntity(attachProp, Player, bone, P1, P2, P3, P4, P5, P6, true, true, false, true, 1, true)
|
||||||
|
if model2 then
|
||||||
|
triggerNotify(nil, "Debug: Spawning consumable prop 2")
|
||||||
|
if IsModelValid(model2) == 1 then
|
||||||
|
attachProp2 = makeProp({ prop = model2, coords = vector4(0.0,0.0,0.0,0.0)}, 1, 1)
|
||||||
|
AttachEntityToEntity(attachProp2, Player, bone2, P7, P8, P9, P10, P11, P12, true, true, false, true, 1, true)
|
||||||
|
else triggerNotify(nil, "Debug: Second prop model isn't valid", "error") end
|
||||||
|
end
|
||||||
|
while consuming do Wait(50) end
|
||||||
|
if DoesEntityExist(attachProp) then destroyProp(attachProp) attachProp = nil end
|
||||||
|
if DoesEntityExist(attachProp2) then destroyProp(attachProp2) attachProp2 = nil end
|
||||||
|
else triggerNotify(nil, "Debug: Prop model isn't valid", "error") end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
Wait((GetAnimDuration(animDict, anim) * 1000)*2)
|
||||||
|
consuming = false
|
||||||
|
stopAnim(animDict, anim)
|
||||||
|
TriggerEvent("jim-consumables:client:testEmotes")
|
||||||
|
end
|
||||||
281
config.lua
281
config.lua
@@ -1,264 +1,19 @@
|
|||||||
print("Jim-Consumables v1.0 - Consumables Script by Jimathy")
|
Config = {
|
||||||
|
System = {
|
||||||
-- If you need support I now have a discord available, it helps me keep track of issues and give better support.
|
Debug = false,
|
||||||
|
EventDebug = false,
|
||||||
-- https://discord.gg/xKgQZ6wZvS
|
|
||||||
|
Menu = "qb", -- "qb", "ox"
|
||||||
Config = {
|
Notify = "gta", -- "qb", "ox", "gta"
|
||||||
Debug = false,
|
ProgressBar = "gta", -- "qb", "ox", "gta"
|
||||||
Consumables = {
|
drawText = "gta", -- "qb", "ox", "gta"
|
||||||
-- Default QB food and drink item override
|
|
||||||
["vodka"] = { emote = "vodkab", stress = math.random(2, 4), heal = 0, armor = 0, type = "alcohol", stats = { thirst = math.random(10,20), }},
|
},
|
||||||
["beer"] = { emote = "beer", stress = math.random(2, 4), heal = 0, armor = 0, type = "alcohol", stats = { thirst = math.random(10,20), }},
|
Main = {
|
||||||
["whiskey"] = { emote = "whiskey", stress = math.random(2, 4), heal = 0, armor = 0, type = "alcohol", stats = { thirst = math.random(10,20), }},
|
UseProgbar = false, -- Recommended to disable this, progress bars stop ALL anims when complete.
|
||||||
|
-- This is intended to create a progressbar to show consuming but it was usually forces animations to end weirdly
|
||||||
["sandwich"] = { emote = "sandwich", stress = math.random(2, 4), heal = 0, armor = 0, type = "food", stats = { hunger = math.random(10,20), }},
|
},
|
||||||
["twerks_candy"] = { emote = "egobar", stress = math.random(2, 4), heal = 0, armor = 0, type = "food", stats = { hunger = math.random(10,20), }},
|
Crafting = {
|
||||||
["snikkel_candy"] = { emote = "egobar", stress = math.random(2, 4), heal = 0, armor = 0, type = "food", stats = { hunger = math.random(10,20), }},
|
showItemBox = true -- Display "use" item boxes on some inventories that need to be told to
|
||||||
["tosti"] = { emote = "sandwich", stress = math.random(2, 4), heal = 0, armor = 0, type = "food", stats = { hunger = math.random(10,20), }},
|
}
|
||||||
|
|
||||||
["coffee"] = { emote = "coffee", stress = math.random(2, 4), heal = 0, armor = 0, type = "drink", stats = { thirst = math.random(10,20), }},
|
|
||||||
["water_bottle"] = { emote = "drink", stress = math.random(2, 4), heal = 0, armor = 0, type = "drink", stats = { thirst = math.random(10,20), }},
|
|
||||||
["kurkakola"] = { emote = "ecola", stress = math.random(2, 4), heal = 0, armor = 0, type = "drink", stats = { thirst = math.random(10,20), }},
|
|
||||||
|
|
||||||
|
|
||||||
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
-- Items that effect status changes, like bleeding can cause problems as they are all handled in their own scripts
|
|
||||||
--[[--Testing these but they may be best left handled by default scripts
|
|
||||||
["ifaks"] = { emote = "oxy", stress = math.random(12, 24), heal = 10, armor = 0, type = "drug", },
|
|
||||||
["bandage"] = { emote = "oxy", stress = 0, heal = 10, armor = 0, type = "drug", },
|
|
||||||
|
|
||||||
--Testing effects & armor with small functionality to drugs - This may be another one left to default scripts
|
|
||||||
["joint"] = { emote = "smoke3", stress = math.random(12, 24), heal = 0, armor = 10, type = "drug", effect = { effect = "weed", widepupils = false, canOD = false } },
|
|
||||||
|
|
||||||
["cokebaggy"] = { emote = "coke", stress = math.random(12, 24), heal = 0, armor = 10, type = "drug", effect = { effect = "stamina", widepupils = false, canOD = true } },
|
|
||||||
--["crackbaggy"] = { emote = "coke", stress = math.random(12, 24), heal = 0, armor = 10, type = "drug", effect = { effect = "heal", widepupils = false, canOD = true } },
|
|
||||||
["xtcbaggy"] = { emote = "oxy", stress = math.random(12, 24), heal = 0, armor = 10, type = "drug", effect = { effect = "stamina", widepupils = true, canOD = true } },
|
|
||||||
["oxy"] = { emote = "oxy", stress = math.random(12, 24), heal = 0, armor = 10, type = "drug", effect = { effect = "heal", widepupils = false, canOD = false } },
|
|
||||||
["meth"] = { emote = "coke", stress = math.random(12, 24), heal = 0, armor = 10, type = "drug", effect = { effect = "stamina", widepupils = false, canOD = true } },]]
|
|
||||||
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
--[[
|
|
||||||
Example item
|
|
||||||
--["heartstopper"] = {
|
|
||||||
emote = "burger", -- Select an emote from below, it has to be in here
|
|
||||||
stress = math.random(1,2), -- Amount of stress relief, can be 0
|
|
||||||
heal = 0, -- Set amount to heal by after consuming
|
|
||||||
armor = 5, -- Amount of armor to add
|
|
||||||
type = "food", -- Type: "alcohol" / "drink" / "food"
|
|
||||||
effect = { effect = "healdouble", }, -- The status effect given by the item, "heal" / "healdouble" / "stamina"
|
|
||||||
stats = { hunger = math.random(10,20), }, -- The stats of the item, if not found in the items.lua
|
|
||||||
},
|
|
||||||
]]
|
|
||||||
},
|
|
||||||
Emotes = {
|
|
||||||
["drink"] = {"mp_player_intdrink", "loop_bottle", "Drink", AnimationOptions =
|
|
||||||
{ Prop = "prop_ld_flow_bottle", PropBone = 18905, PropPlacement = {0.12, 0.008, 0.03, 240.0, -60.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true, }},
|
|
||||||
["whiskeyb"] = {"mp_player_intdrink", "loop_bottle", "(Don't Use) Whiskey Bottle", AnimationOptions =
|
|
||||||
{ Prop = "prop_cs_whiskey_bottle", PropBone = 60309, PropPlacement = {0.0, 0.0, 0.0, 0.0, 0.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true }},
|
|
||||||
["rumb"] = {"mp_player_intdrink", "loop_bottle", "(Don't Use) Rum Bottle", AnimationOptions =
|
|
||||||
{ Prop = "prop_rum_bottle", PropBone = 18905, PropPlacement = {0.03, -0.18, 0.10, 240.0, -60.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true }},
|
|
||||||
["icream"] = {"mp_player_intdrink", "loop_bottle", "Irish Cream Bottle", AnimationOptions =
|
|
||||||
{ Prop = "prop_bottle_brandy", PropBone = 18905, PropPlacement = {0.00, -0.26, 0.10, 240.0, -60.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true }},
|
|
||||||
["ginb"] = {"mp_player_intdrink", "loop_bottle", "(Don't Use) Gin Bottle", AnimationOptions =
|
|
||||||
{ Prop = "prop_tequila_bottle", PropBone = 18905, PropPlacement = {0.00, -0.26, 0.10, 240.0, -60.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true }},
|
|
||||||
["vodkab"] = {"mp_player_intdrink", "loop_bottle", "(Don't Use) Vodka Bottle", AnimationOptions =
|
|
||||||
{ Prop = 'prop_vodka_bottle', PropBone = 18905, PropPlacement = {0.00, -0.26, 0.10, 240.0, -60.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true }},
|
|
||||||
["crisps"] = {"amb@world_human_drinking@coffee@male@idle_a", "idle_c", "Chrisps", AnimationOptions =
|
|
||||||
{ Prop = 'v_ret_ml_chips2', PropBone = 28422, PropPlacement = {0.01, -0.05, -0.1, 0.0, 0.0, 90.0},
|
|
||||||
EmoteLoop = true, EmoteMoving = true, }},
|
|
||||||
["beer1"] = {"mp_player_intdrink", "loop_bottle", "Dusche", AnimationOptions =
|
|
||||||
{ Prop = "prop_beerdusche", PropBone = 18905, PropPlacement = {0.04, -0.14, 0.10, 240.0, -60.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true, }},
|
|
||||||
["beer2"] = {"mp_player_intdrink", "loop_bottle", "Logger", AnimationOptions =
|
|
||||||
{ Prop = "prop_beer_logopen", PropBone = 18905, PropPlacement = {0.03, -0.18, 0.10, 240.0, -60.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true, }},
|
|
||||||
["beer3"] = {"mp_player_intdrink", "loop_bottle", "AM Beer", AnimationOptions =
|
|
||||||
{ Prop = "prop_beer_amopen", PropBone = 18905, PropPlacement = {0.03, -0.18, 0.10, 240.0, -60.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true, }},
|
|
||||||
["beer4"] = {"mp_player_intdrink", "loop_bottle", "Pisswasser1", AnimationOptions =
|
|
||||||
{ Prop = "prop_beer_pissh", PropBone = 18905, PropPlacement = {0.03, -0.18, 0.10, 240.0, -60.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true, }},
|
|
||||||
["beer5"] = {"mp_player_intdrink", "loop_bottle", "Pisswasser2", AnimationOptions =
|
|
||||||
{ Prop = "prop_amb_beer_bottle", PropBone = 18905, PropPlacement = {0.12, 0.008, 0.03, 240.0, -60.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true, }},
|
|
||||||
["beer6"] = {"mp_player_intdrink", "loop_bottle", "Pisswasser3", AnimationOptions =
|
|
||||||
{ Prop = "prop_cs_beer_bot_02", PropBone = 18905, PropPlacement = {0.12, 0.008, 0.03, 240.0, -60.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true, }},
|
|
||||||
["ecola"] = {"mp_player_intdrink", "loop_bottle", "E-cola", AnimationOptions =
|
|
||||||
{ Prop = "prop_ecola_can", PropBone = 18905, PropPlacement = {0.12, 0.008, 0.03, 240.0, -60.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true, }},
|
|
||||||
["sprunk"] = {"mp_player_intdrink", "loop_bottle", "Sprunk", AnimationOptions =
|
|
||||||
{ Prop = "v_res_tt_can03", PropBone = 18905, PropPlacement = {0.12, 0.008, 0.03, 240.0, -60.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true, }},
|
|
||||||
--Jim-BeanMachine
|
|
||||||
["bmcoffee1"] = {"amb@world_human_drinking@coffee@male@idle_a", "idle_c", "Coffee2", AnimationOptions =
|
|
||||||
{ Prop = 'prop_fib_coffee', PropBone = 28422, PropPlacement = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
|
|
||||||
EmoteLoop = true, EmoteMoving = true, }},
|
|
||||||
|
|
||||||
["bmcoffee2"] = {"amb@world_human_drinking@coffee@male@idle_a", "idle_c", "Coffee3", AnimationOptions =
|
|
||||||
{ Prop = 'ng_proc_coffee_01a', PropBone = 28422, PropPlacement = {0.0, 0.0, -0.06, 0.0, 0.0, 0.0},
|
|
||||||
EmoteLoop = true, EmoteMoving = true, }},
|
|
||||||
|
|
||||||
["bmcoffee3"] = {"amb@world_human_drinking@coffee@male@idle_a", "idle_c", "Coffee3", AnimationOptions =
|
|
||||||
{ Prop = 'v_club_vu_coffeecup', PropBone = 28422, PropPlacement = {0.0, 0.0, -0.06, 0.0, 0.0, 0.0},
|
|
||||||
EmoteLoop = true, EmoteMoving = true, }},
|
|
||||||
--Jim-PizzaThis
|
|
||||||
["redwine"] = {"mp_player_intdrink", "loop_bottle", "Red Wine Bottle", AnimationOptions =
|
|
||||||
{ Prop = "prop_wine_rose", PropBone = 18905, PropPlacement = {0.00, -0.26, 0.10, 240.0, -60.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true, }},
|
|
||||||
["whitewine"] = {"mp_player_intdrink", "loop_bottle", "White Wine Bottle", AnimationOptions =
|
|
||||||
{ Prop = "prop_wine_white", PropBone = 18905, PropPlacement = {0.00, -0.26, 0.10, 240.0, -60.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true, }},
|
|
||||||
["pizza"] = {"mp_player_inteat@burger", "mp_player_int_eat_burger_fp", "Pizza", AnimationOptions =
|
|
||||||
{ Prop = "v_res_tt_pizzaplate", PropBone = 18905, PropPlacement = {0.20, 0.038, 0.051, 15.0, 155.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true, }},
|
|
||||||
["bowl"] = {"amb@world_human_drinking@coffee@male@idle_a", "idle_c", "bowl", AnimationOptions =
|
|
||||||
{ Prop = "h4_prop_h4_coke_plasticbowl_01", PropBone = 28422, PropPlacement = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true, }},
|
|
||||||
["pineapple"] = {"mp_player_inteat@burger", "mp_player_int_eat_burger_fp", "Pizza", AnimationOptions =
|
|
||||||
{ Prop = "prop_pineapple", PropBone = 18905, PropPlacement = {0.10, 0.038, 0.03, 15.0, 50.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true, }},
|
|
||||||
["foodbowl"] = {"amb@world_human_drinking@coffee@male@idle_a", "idle_c", "bowl", AnimationOptions =
|
|
||||||
{ Prop = "prop_cs_bowl_01", PropBone = 28422, PropPlacement = {0.0, 0.0, 0.050, 0.0, 0.0, 0.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true, }},
|
|
||||||
--Jim-BurgerShot
|
|
||||||
["milk"] = {"mp_player_intdrink", "loop_bottle", "Milk", AnimationOptions =
|
|
||||||
{ Prop = "v_res_tt_milk", PropBone = 18905, PropPlacement = {0.10, 0.008, 0.07, 240.0, -60.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true, }},
|
|
||||||
["bscoke"] = {"mp_player_intdrink", "loop_bottle", "BS Coke", AnimationOptions =
|
|
||||||
{ Prop = "prop_food_bs_juice01", PropBone = 18905, PropPlacement = {0.04, -0.10, 0.10, 240.0, -60.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true, }},
|
|
||||||
["bscoffee"] = {"mp_player_intdrink", "loop_bottle", "BS Coffee", AnimationOptions =
|
|
||||||
{ Prop = "prop_food_bs_coffee", PropBone = 18905, PropPlacement = {0.08, -0.10, 0.10, 240.0, -60.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true, }},
|
|
||||||
["glass"] = {"amb@world_human_drinking@coffee@male@idle_a", "idle_c", "Tall Glass", AnimationOptions =
|
|
||||||
{ Prop = 'prop_wheat_grass_glass', PropBone = 28422, PropPlacement = {0.0, 0.0, -0.1, 0.0, 0.0, 0.0},
|
|
||||||
EmoteLoop = true, EmoteMoving = true, }},
|
|
||||||
|
|
||||||
["torpedo"] = {"mp_player_inteat@burger", "mp_player_int_eat_burger_fp", "Torpedo", AnimationOptions =
|
|
||||||
{ Prop = "prop_food_bs_burger2", PropBone = 18905, PropPlacement = {0.10, -0.07, 0.091, 15.0, 135.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true, }},
|
|
||||||
["bsfries"] = {"mp_player_inteat@burger", "mp_player_int_eat_burger_fp", "Fries", AnimationOptions =
|
|
||||||
{ Prop = "prop_food_bs_chips", PropBone = 18905, PropPlacement = {0.09, -0.06, 0.05, 300.0, 150.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true, }},
|
|
||||||
["donut2"] = {"mp_player_inteat@burger", "mp_player_int_eat_burger", "Donut2", AnimationOptions =
|
|
||||||
{ Prop = 'prop_donut_02', PropBone = 18905, PropPlacement = {0.13, 0.05, 0.02, -50.0, 100.0, 270.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true, }},
|
|
||||||
|
|
||||||
--Jim-CatCafe
|
|
||||||
["boba1"] = {"amb@world_human_drinking@coffee@male@idle_a", "idle_c", "Boba 1", AnimationOptions =
|
|
||||||
{ Prop = 'denis3d_catcafe_boobaA', PropBone = 28422, PropPlacement = {0.0, 0.0, -0.1, 0.0, 0.0, 0.0},
|
|
||||||
EmoteLoop = true, EmoteMoving = true, }},
|
|
||||||
["boba2"] = {"amb@world_human_drinking@coffee@male@idle_a", "idle_c", "Boba 2", AnimationOptions =
|
|
||||||
{ Prop = 'denis3d_catcafe_boobaB', PropBone = 28422, PropPlacement = {0.0, 0.0, -0.1, 0.0, 0.0, 0.0},
|
|
||||||
EmoteLoop = true, EmoteMoving = true, }},
|
|
||||||
["boba3"] = {"amb@world_human_drinking@coffee@male@idle_a", "idle_c", "Boba 3", AnimationOptions =
|
|
||||||
{ Prop = 'denis3d_catcafe_boobaC', PropBone = 28422, PropPlacement = {0.0, 0.0, -0.1, 0.0, 0.0, 0.0},
|
|
||||||
EmoteLoop = true, EmoteMoving = true, }},
|
|
||||||
["boba4"] = {"amb@world_human_drinking@coffee@male@idle_a", "idle_c", "Boba 4", AnimationOptions =
|
|
||||||
{ Prop = 'denis3d_catcafe_boobaD', PropBone = 28422, PropPlacement = {0.0, 0.0, -0.1, 0.0, 0.0, 0.0},
|
|
||||||
EmoteLoop = true, EmoteMoving = true, }},
|
|
||||||
["mochi"] = {"amb@world_human_drinking@coffee@male@idle_a", "idle_c", "Mochi", AnimationOptions =
|
|
||||||
{ Prop = 'denis3d_catcafe_plateD', PropBone = 28422, PropPlacement = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
|
|
||||||
EmoteLoop = true, EmoteMoving = true, }},
|
|
||||||
|
|
||||||
--Jim-Tequilala
|
|
||||||
["whiskeyb"] = {"anim@amb@nightclub@mini@drinking@drinking_shots@ped_b@normal@", "glass_hold", "Whiskey Bottle", AnimationOptions =
|
|
||||||
{ Prop = "prop_cs_whiskey_bottle", PropBone = 60309, PropPlacement = {0.08, 0.0, 0.05, 240.0, -60.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true }},
|
|
||||||
["rumb"] = {"anim@amb@nightclub@mini@drinking@drinking_shots@ped_b@normal@", "glass_hold", "Rum Bottle", AnimationOptions =
|
|
||||||
{ Prop = "prop_rum_bottle", PropBone = 60309, PropPlacement = {-0.04, -0.18, 0.12, 240.0, -60.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true }},
|
|
||||||
["icream"] = {"anim@amb@nightclub@mini@drinking@drinking_shots@ped_b@normal@", "glass_hold", "Irish Cream Bottle", AnimationOptions =
|
|
||||||
{ Prop = "prop_bottle_brandy", PropBone = 60309, PropPlacement = {-0.04, -0.18, 0.12, 240.0, -60.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true }},
|
|
||||||
["ginb"] = {"anim@amb@nightclub@mini@drinking@drinking_shots@ped_b@normal@", "glass_hold", "Gin Bottle", AnimationOptions =
|
|
||||||
{ Prop = "prop_tequila_bottle", PropBone = 60309, PropPlacement = {-0.04, -0.18, 0.12, 240.0, -60.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true }},
|
|
||||||
["vodkab"] = {"anim@amb@nightclub@mini@drinking@drinking_shots@ped_b@normal@", "glass_hold", "Vodka Bottle", AnimationOptions =
|
|
||||||
{ Prop = 'prop_vodka_bottle', PropBone = 60309, PropPlacement = {-0.04, -0.18, 0.12, 240.0, -60.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true }},
|
|
||||||
["browncup"] = {"amb@world_human_drinking@coffee@male@idle_a", "idle_c", "Brown Cup", AnimationOptions =
|
|
||||||
{ Prop = 'v_serv_bs_mug', PropBone = 28422, PropPlacement = {0.03, -0.02, 0.0, 0.0, 0.0, 0.0},
|
|
||||||
EmoteLoop = true, EmoteMoving = true, }},
|
|
||||||
["crisps"] = {"amb@world_human_drinking@coffee@male@idle_a", "idle_c", "Crisps", AnimationOptions =
|
|
||||||
{ Prop = 'v_ret_ml_chips2', PropBone = 28422, PropPlacement = {0.01, -0.05, -0.1, 0.0, 0.0, 90.0},
|
|
||||||
EmoteLoop = true, EmoteMoving = true, }},
|
|
||||||
["smoke2"] = {"amb@world_human_aa_smoke@male@idle_a", "idle_c", "Smoke 2", AnimationOptions =
|
|
||||||
{ Prop = 'prop_cs_ciggy_01', PropBone = 28422, PropPlacement = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
|
|
||||||
EmoteLoop = true, EmoteMoving = true, }},
|
|
||||||
["smoke3"] = {"amb@world_human_aa_smoke@male@idle_a", "idle_b", "Smoke 3", AnimationOptions =
|
|
||||||
{ Prop = 'prop_cs_ciggy_01', PropBone = 28422, PropPlacement = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
|
|
||||||
EmoteLoop = true, EmoteMoving = true, }},
|
|
||||||
["smoke4"] = {"amb@world_human_smoking@female@idle_a", "idle_b", "Smoke 4", AnimationOptions =
|
|
||||||
{ Prop = 'prop_cs_ciggy_01', PropBone = 28422, PropPlacement = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
|
|
||||||
EmoteLoop = true, EmoteMoving = true, }},
|
|
||||||
["bong"] = {"anim@safehouse@bong", "bong_stage3", "Bong", AnimationOptions =
|
|
||||||
{ Prop = 'hei_heist_sh_bong_01', PropBone = 18905, PropPlacement = {0.10,-0.25,0.0,95.0,190.0,180.0}, }},
|
|
||||||
["coffee"] = {"amb@world_human_drinking@coffee@male@idle_a", "idle_c", "Coffee", AnimationOptions =
|
|
||||||
{ Prop = 'p_amb_coffeecup_01', PropBone = 28422, PropPlacement = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
|
|
||||||
EmoteLoop = true, EmoteMoving = true, }},
|
|
||||||
["whiskey"] = {"amb@world_human_drinking@coffee@male@idle_a", "idle_c", "Whiskey", AnimationOptions =
|
|
||||||
{ Prop = 'prop_drink_whisky', PropBone = 28422, PropPlacement = {0.01, -0.01, -0.06, 0.0, 0.0, 0.0},
|
|
||||||
EmoteLoop = true, EmoteMoving = true, }},
|
|
||||||
["beer"] = {"amb@world_human_drinking@coffee@male@idle_a", "idle_c", "Beer", AnimationOptions =
|
|
||||||
{ Prop = 'prop_amb_beer_bottle', PropBone = 28422, PropPlacement = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
|
|
||||||
EmoteLoop = true, EmoteMoving = true, }},
|
|
||||||
["cup"] = {"amb@world_human_drinking@coffee@male@idle_a", "idle_c", "Cup", AnimationOptions =
|
|
||||||
{ Prop = 'prop_plastic_cup_02', PropBone = 28422, PropPlacement = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
|
|
||||||
EmoteLoop = true, EmoteMoving = true, }},
|
|
||||||
["donut"] = {"mp_player_inteat@burger", "mp_player_int_eat_burger", "Donut", AnimationOptions =
|
|
||||||
{ Prop = 'prop_amb_donut', PropBone = 18905, PropPlacement = {0.13, 0.05, 0.02, -50.0, 16.0, 60.0},
|
|
||||||
EmoteMoving = true, }},
|
|
||||||
["burger"] = {"mp_player_inteat@burger", "mp_player_int_eat_burger", "Burger", AnimationOptions =
|
|
||||||
{ Prop = 'prop_cs_burger_01', PropBone = 18905, PropPlacement = {0.13, 0.05, 0.02, -50.0, 16.0, 60.0},
|
|
||||||
EmoteMoving = true, }},
|
|
||||||
["sandwich"] = {"mp_player_inteat@burger", "mp_player_int_eat_burger", "Sandwich", AnimationOptions =
|
|
||||||
{ Prop = 'prop_sandwich_01', PropBone = 18905, PropPlacement = {0.13, 0.05, 0.02, -50.0, 16.0, 60.0},
|
|
||||||
EmoteMoving = true, }},
|
|
||||||
["soda"] = {"amb@world_human_drinking@coffee@male@idle_a", "idle_c", "Soda", AnimationOptions =
|
|
||||||
{ Prop = 'prop_ecola_can', PropBone = 28422, PropPlacement = {0.0, 0.0, 0.0, 0.0, 0.0, 130.0},
|
|
||||||
EmoteLoop = true, EmoteMoving = true, }},
|
|
||||||
["egobar"] = {"mp_player_inteat@burger", "mp_player_int_eat_burger", "Ego Bar", AnimationOptions =
|
|
||||||
{ Prop = 'prop_choc_ego', PropBone = 60309, PropPlacement = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
|
|
||||||
EmoteMoving = true, }},
|
|
||||||
["wine"] = {"anim@heists@humane_labs@finale@keycards", "ped_a_enter_loop", "Wine", AnimationOptions =
|
|
||||||
{ Prop = 'prop_drink_redwine', PropBone = 18905, PropPlacement = {0.10, -0.03, 0.03, -100.0, 0.0, -10.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true }},
|
|
||||||
["flute"] = {"anim@heists@humane_labs@finale@keycards", "ped_a_enter_loop", "Flute", AnimationOptions =
|
|
||||||
{ Prop = 'prop_champ_flute', PropBone = 18905, PropPlacement = {0.10, -0.03, 0.03, -100.0, 0.0, -10.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true }},
|
|
||||||
["champagne"] = {"anim@heists@humane_labs@finale@keycards", "ped_a_enter_loop", "Champagne", AnimationOptions =
|
|
||||||
{ Prop = 'prop_drink_champ', PropBone = 18905, PropPlacement = {0.10, -0.03, 0.03, -100.0, 0.0, -10.0},
|
|
||||||
EmoteMoving = true, EmoteLoop = true }},
|
|
||||||
["cigar"] = {"amb@world_human_smoking@male@male_a@enter", "enter", "Cigar", AnimationOptions =
|
|
||||||
{ Prop = 'prop_cigar_02', PropBone = 47419, PropPlacement = {0.010, 0.0, 0.0, 50.0, 0.0, -80.0},
|
|
||||||
EmoteMoving = true, EmoteDuration = 2600 }},
|
|
||||||
["cigar2"] = {"amb@world_human_smoking@male@male_a@enter", "enter", "Cigar 2", AnimationOptions =
|
|
||||||
{ Prop = 'prop_cigar_01', PropBone = 47419, PropPlacement = {0.010, 0.0, 0.0, 50.0, 0.0, -80.0},
|
|
||||||
EmoteMoving = true, EmoteDuration = 2600 }},
|
|
||||||
["joint"] = {"amb@world_human_smoking@male@male_a@enter", "enter", "Joint", AnimationOptions =
|
|
||||||
{ Prop = 'p_cs_joint_02', PropBone = 47419, PropPlacement = {0.015, -0.009, 0.003, 55.0, 0.0, 110.0},
|
|
||||||
EmoteMoving = true, EmoteDuration = 2600 }},
|
|
||||||
["cig"] = {"amb@world_human_smoking@male@male_a@enter", "enter", "Cig", AnimationOptions =
|
|
||||||
{ Prop = 'prop_amb_ciggy_01', PropBone = 47419, PropPlacement = {0.015, -0.009, 0.003, 55.0, 0.0, 110.0},
|
|
||||||
EmoteMoving = true, EmoteDuration = 2600 }},
|
|
||||||
["clean"] = {"timetable@floyd@clean_kitchen@base", "base", "Clean", AnimationOptions =
|
|
||||||
{ Prop = "prop_sponge_01", PropBone = 28422, PropPlacement = {0.0, 0.0, -0.01, 90.0, 0.0, 0.0},
|
|
||||||
EmoteLoop = true, EmoteMoving = true, }},
|
|
||||||
["clean2"] = {"amb@world_human_maid_clean@", "base", "Clean 2", AnimationOptions =
|
|
||||||
{ Prop = "prop_sponge_01", PropBone = 28422, PropPlacement = {0.0, 0.0, -0.01, 90.0, 0.0, 0.0},
|
|
||||||
EmoteLoop = true, EmoteMoving = true, }},
|
|
||||||
["coke"] = { "switch@trevor@trev_smoking_meth", "trev_smoking_meth_loop", "Coke", AnimationOptions =
|
|
||||||
{ EmoteLoop = true, EmoteMoving = true, }},
|
|
||||||
["oxy"] = { "mp_suicide", "pill", "Oxy", AnimationOptions =
|
|
||||||
{ EmoteLoop = true, EmoteMoving = true, }},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,27 @@
|
|||||||
name "Jim-Consumables"
|
name "Jim-Consumables"
|
||||||
author "Jimathy"
|
author "Jimathy"
|
||||||
version "v1.0"
|
version "2.0.09"
|
||||||
description "Consumable Script By Jimathy"
|
description "Consumables Script"
|
||||||
fx_version "cerulean"
|
fx_version "cerulean"
|
||||||
game "gta5"
|
game "gta5"
|
||||||
|
lua54 'yes'
|
||||||
|
|
||||||
client_scripts { 'client/*.lua', }
|
server_script '@oxmysql/lib/MySQL.lua'
|
||||||
server_scripts { 'server/*.lua' }
|
|
||||||
shared_scripts { 'config.lua', }
|
shared_scripts {
|
||||||
|
'config.lua',
|
||||||
|
'shared/emotes.lua',
|
||||||
|
'shared/consumables.lua',
|
||||||
|
'shared/shared.lua',
|
||||||
|
|
||||||
|
--Jim Bridge - https://github.com/jimathy/jim_bridge
|
||||||
|
'@jim_bridge/starter.lua',
|
||||||
|
}
|
||||||
|
|
||||||
|
client_scripts {
|
||||||
|
'client/*.lua',
|
||||||
|
}
|
||||||
|
|
||||||
|
server_script 'server/*.lua'
|
||||||
|
|
||||||
|
dependency 'jim_bridge'
|
||||||
@@ -1,15 +1,199 @@
|
|||||||
local QBCore = exports['qb-core']:GetCoreObject()
|
local Consumables = Config.Consumables
|
||||||
|
local Emotes = Config.Emotes
|
||||||
|
local isConsuming = {}
|
||||||
|
|
||||||
--Consumables
|
local function massMakeUseable()
|
||||||
CreateThread(function()
|
for k, v in pairs(Config.Consumables) do
|
||||||
for k,v in pairs(Config.Consumables) do
|
createUseableItem(k, function(source, item)
|
||||||
QBCore.Functions.CreateUseableItem(k, function(source, item)
|
local src = source
|
||||||
TriggerClientEvent('jim-consumables:Consume', source, item.name)
|
if not isConsuming[src] and hasItem(item.name, 1, src) then
|
||||||
end)
|
|
||||||
end
|
registerConsume(src, item.name)
|
||||||
for k,v in pairs(Config.Consumables) do
|
TriggerClientEvent(getScript()..':Consume', src, item.name)
|
||||||
QBCore.Functions.CreateUseableItem(k, function(source, item) TriggerClientEvent('jim-consumables:Consume', source, item.name) end)
|
|
||||||
if not QBCore.Shared.Items[k] then print("Item check - '"..k.."' not found in the shared lua") end
|
end
|
||||||
if not Config.Emotes[v.emote] then print("Emote check - '"..k.."' requested emote '"..v.emote.."' - not found in config.lua") end
|
end)
|
||||||
end
|
end
|
||||||
end)
|
end
|
||||||
|
|
||||||
|
function registerConsume(src, item)
|
||||||
|
-- Start building server sided item return table
|
||||||
|
local consumable = Consumables[item]
|
||||||
|
isConsuming[src] = {
|
||||||
|
item = item,
|
||||||
|
rewardItem = checkReward(consumable) or nil,
|
||||||
|
returnItem = checkReturnItem(consumable) or nil,
|
||||||
|
packItem = checkPackItem(consumable) or nil
|
||||||
|
}
|
||||||
|
debugPrint("^5Debug^7: ^2Player ^3"..src.." ^2started consuming ^7'^2"..item.."^7'")
|
||||||
|
end
|
||||||
|
|
||||||
|
RegisterNetEvent(getScript()..":RegisterConsuming", function(item)
|
||||||
|
local src = source
|
||||||
|
registerConsume(src, item)
|
||||||
|
end)
|
||||||
|
|
||||||
|
onResourceStart(function()
|
||||||
|
for k, v in pairs(Config.Consumables) do
|
||||||
|
if not Items[k] then
|
||||||
|
print("^1Debug^7: ^2Item check ^7- '^1"..k.."^7' ^2not found in the shared lua^7")
|
||||||
|
end
|
||||||
|
if not Config.Emotes[v.emote] then
|
||||||
|
print("^1Debug^7: ^2Emote check ^7- '^1"..k.."^7' ^2requested emote ^7'^6"..v.emote.."^7' - ^2not found in config^7.^2lua^7")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
massMakeUseable()
|
||||||
|
|
||||||
|
--Export Import System--
|
||||||
|
GlobalState.jimConsumableItems = Consumables
|
||||||
|
GlobalState.jimConsumableEmotes = Emotes
|
||||||
|
end, true)
|
||||||
|
|
||||||
|
onResourceStop(function()
|
||||||
|
GlobalState.jimConsumableItems = Consumables
|
||||||
|
GlobalState.jimConsumableEmotes = Emotes
|
||||||
|
end)
|
||||||
|
|
||||||
|
local syncScheduled = false
|
||||||
|
function syncConsumables()
|
||||||
|
debugPrint("^5Statebag^7: ^2Sending ^6"..countTable(Consumables).." ^3Consumables ^2to all clients^7")
|
||||||
|
massMakeUseable()
|
||||||
|
GlobalState.jimConsumableItems = Consumables
|
||||||
|
syncScheduled = false
|
||||||
|
end
|
||||||
|
|
||||||
|
local emoteSyncScheduled = false
|
||||||
|
function syncEmotes()
|
||||||
|
debugPrint("^5Statebag^7: ^2Sending ^6"..countTable(Emotes).." ^3Emotes to all clients^7")
|
||||||
|
GlobalState.jimConsumableEmotes = Emotes
|
||||||
|
emoteSyncScheduled = false
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Return item
|
||||||
|
function checkPackItem(consumable)
|
||||||
|
local result = nil
|
||||||
|
if consumable.pack then
|
||||||
|
result = { item = consumable.pack.item, amount = consumable.pack.amount }
|
||||||
|
end
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Return item
|
||||||
|
function checkReturnItem(consumable)
|
||||||
|
local result = nil
|
||||||
|
if consumable.returnItem then
|
||||||
|
result = { item = consumable.returnItem.item, amount = consumable.returnItem.amount }
|
||||||
|
end
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Reward items
|
||||||
|
function checkReward(consumable)
|
||||||
|
local result = nil
|
||||||
|
local rewardItem = consumable.rewards or nil
|
||||||
|
if rewardItem then
|
||||||
|
debugPrint("Reward Item detected")
|
||||||
|
for i = 1, consumable.amounttogive or 1 do
|
||||||
|
local rarity = math.random(1, 4) -- rarity calculation
|
||||||
|
while true do
|
||||||
|
local item = math.random(1, countTable(rewardItem)) -- random item in the list to pick
|
||||||
|
if rewardItem[item].rarity >= rarity then
|
||||||
|
result = result or {}
|
||||||
|
result[#result+1] = { item = rewardItem[item].item, amount = math.random(1, rewardItem[item].max or 1) }
|
||||||
|
debugPrint("^5Debug^7: ^2Cachced reward prize^7: '^6"..rewardItem[item].item.."^7'")
|
||||||
|
break
|
||||||
|
end
|
||||||
|
Wait(10)
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|
||||||
|
RegisterNetEvent(getScript()..":server:finishConsume", function(needTypes)
|
||||||
|
local src = source
|
||||||
|
|
||||||
|
if isConsuming[src] ~= nil then
|
||||||
|
|
||||||
|
removeItem(isConsuming[src].item, 1, src)
|
||||||
|
if isConsuming[src].rewardItem then
|
||||||
|
debugPrint("^5Debug^7: ^2Giving player ^3"..src.." ^2reward items^7")
|
||||||
|
local item = isConsuming[src].rewardItem
|
||||||
|
addItem(item.item, item.amount, nil, src)
|
||||||
|
end
|
||||||
|
if isConsuming[src].returnItem then
|
||||||
|
debugPrint("^5Debug^7: ^2Giving player ^3"..src.." ^2return item^7")
|
||||||
|
for i = 1, #isConsuming[src].returnItem do
|
||||||
|
local item = isConsuming[src].returnItem[i]
|
||||||
|
addItem(item.item, item.amount, nil, src)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if isConsuming[src].packItem then
|
||||||
|
debugPrint("^5Debug^7: ^2Giving player ^3"..src.." ^2Pack items^7")
|
||||||
|
local item = isConsuming[src].packItem
|
||||||
|
addItem(item.item, item.amount, nil, src)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Needs
|
||||||
|
if needTypes.thirst then
|
||||||
|
debugPrint("^5Debug^7: ^2Thrist^7: [^6"..(needTypes.thirst or 0).."^7]")
|
||||||
|
setThirst(src, needTypes.thirst)
|
||||||
|
end
|
||||||
|
if needTypes.hunger then
|
||||||
|
debugPrint("^5Debug^7: ^2Hunger^7: [^6"..(needTypes.hunger or 0).."^7]")
|
||||||
|
setHunger(src, needTypes.hunger)
|
||||||
|
end
|
||||||
|
if needTypes.stress then
|
||||||
|
debugPrint("^5Debug^7: ^2Stress^7: [^6"..(needTypes.stress or 0).."^7]")
|
||||||
|
setStress(src, needTypes.stress)
|
||||||
|
end
|
||||||
|
isConsuming[src] = nil
|
||||||
|
else
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
RegisterNetEvent(getScript()..":server:stopConsume", function()
|
||||||
|
local src = source
|
||||||
|
debugPrint("^5Player stopped consuming early^7", src)
|
||||||
|
isConsuming[src] = nil
|
||||||
|
end)
|
||||||
|
|
||||||
|
RegisterNetEvent(getScript()..':server:syncAddItem', function(itemName, data)
|
||||||
|
if not Consumables[itemName] then
|
||||||
|
Consumables[itemName] = data
|
||||||
|
--createUseableItem(itemName, function(source, item) TriggerClientEvent(getScript()..':Consume', source, itemName) end)
|
||||||
|
debugPrint("^5Debug^7: "..GetInvokingResource().." ^2is sending new ^3Item^7: '"..itemName.."'")
|
||||||
|
if not syncScheduled then
|
||||||
|
syncScheduled = true
|
||||||
|
SetTimeout(5000, syncConsumables)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
debugPrint("^1Debug^7: "..GetInvokingResource().." ^2is sending ^1duplicate ^3Item^7: '"..itemName.."'")
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
RegisterNetEvent(getScript()..':server:syncAddEmote', function(emoteName, data)
|
||||||
|
if not Emotes[emoteName] then
|
||||||
|
Emotes[emoteName] = data
|
||||||
|
debugPrint("^5Debug^7: "..GetInvokingResource().." ^2is sending new ^3Emote^7: '"..emoteName.."'")
|
||||||
|
if not emoteSyncScheduled then
|
||||||
|
emoteSyncScheduled = true
|
||||||
|
SetTimeout(5000, syncEmotes)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
debugPrint("^1Debug^7: "..GetInvokingResource().." ^2is sending ^1duplicate ^3Emote^7: '"..emoteName.."'")
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
--[[
|
||||||
|
Core.Commands.Add('consumableCreator', "Create consumables (admin only)", {}, false, function(source)
|
||||||
|
if source > 0 then return TriggerClientEvent(getScript()..":client:consumableCreator", source) end
|
||||||
|
end, 'admin')
|
||||||
|
|
||||||
|
Core.Commands.Add('testConsumableEmotes', "Test consumables Emotes (admin only)", {}, false, function(source)
|
||||||
|
if source > 0 then return TriggerClientEvent(getScript()..":client:testEmotes", source) end
|
||||||
|
end, 'admin')
|
||||||
|
]]
|
||||||
100
shared/consumables.lua
Normal file
100
shared/consumables.lua
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
Config = Config or {}
|
||||||
|
|
||||||
|
Config.Consumables = {
|
||||||
|
|
||||||
|
--Effects can be applied here, like stamina on coffee for example
|
||||||
|
vodka = { emote = "vodkab", canRun = false, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "alcohol", stats = { effect = "stress", time = 5000, amount = 2, thirst = math.random(10,20), canOD = true }},
|
||||||
|
beer = { emote = "beer", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "alcohol", stats = { thirst = math.random(10,20), canOD = true }},
|
||||||
|
whiskey = { emote = "whiskey", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "alcohol", stats = { thirst = math.random(10,20), canOD = true }},
|
||||||
|
sandwich = { emote = "sandwich", canRun = false, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "food", stats = { hunger = 20, }},
|
||||||
|
|
||||||
|
twerks_candy = { emote = "egobar", canRun = true, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "food", stats = { hunger = math.random(10,15), }},
|
||||||
|
snikkel_candy = { emote = "egobar", canRun = true, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "food", stats = { hunger = math.random(10,15), }},
|
||||||
|
|
||||||
|
coffee = { emote = "coffee", canRun = false, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "drink", stats = { time = 10000, thirst = math.random(10,15), }},
|
||||||
|
water_bottle = { emote = "drink", canRun = false, time = math.random(5000, 6000), stress = 0, heal = 0, armor = 0, type = "drink", stats = { thirst = 20, }},
|
||||||
|
tosti = { emote = "sandwich", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "food", stats = { hunger = math.random(10,15), }},
|
||||||
|
|
||||||
|
kurkakola = { emote = "ecola", canRun = false, time = math.random(5000, 6000), stress = math.random(2, 4), heal = 0, armor = 0, type = "drink", stats = { thirst = math.random(10,20), }},
|
||||||
|
|
||||||
|
--[[----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
-- Items that effect status changes, like bleeding can cause problems as they are all handled in their own scripts
|
||||||
|
-- Testing these but they may be best left handled by default scripts
|
||||||
|
["ifaks"] = { emote = "oxy", time = math.random(5000, 6000), stress = math.random(12, 24), heal = 10, armor = 0, type = "drug", stats = { effect = "heal", amount = 6, widepupils = false, canOD = false } },
|
||||||
|
["bandage"] = { emote = "oxy", time = math.random(5000, 6000), stress = 0, heal = 10, armor = 0, type = "drug", stats = { effect = "heal", amount = 3, widepupils = false, canOD = false } }, },
|
||||||
|
]]
|
||||||
|
|
||||||
|
--Testing effects & armor with small functionality to drugs - This may be another one left to default scripts
|
||||||
|
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
--[[ --Testing effects & armor with small functionality to drugs - This may be another one left to default scripts
|
||||||
|
joint = { emote = "smoke3", time = math.random(5000, 6000), stress = math.random(12, 24), heal = 0, armor = 10, type = "drug", stats = { screen = "weed", effect = "armor", widepupils = false, canOD = false } },
|
||||||
|
|
||||||
|
cokebaggy = { emote = "coke", time = math.random(5000, 6000), stress = math.random(12, 24), heal = 0, armor = 0, type = "drug", stats = { screen = "focus", effect = "stamina", widepupils = false, canOD = true } },
|
||||||
|
--crackbaggy = { emote = "coke", time = math.random(5000, 6000), stress = math.random(12, 24), heal = 0, armor = 0, type = "drug", stats = { effect = "heal", widepupils = false, canOD = true } },
|
||||||
|
xtcbaggy = { emote = "oxy", time = math.random(5000, 6000), stress = math.random(12, 24), heal = 0, armor = 10, type = "drug", stats = { effect = "strength", widepupils = true, canOD = true } },
|
||||||
|
oxy = { emote = "oxy", time = math.random(5000, 6000), stress = math.random(12, 24), heal = 0, armor = 0, type = "drug", stats = { effect = "heal", widepupils = false, canOD = false } },
|
||||||
|
meth = { emote = "coke", time = math.random(5000, 6000), stress = math.random(12, 24), heal = 0, armor = 10, type = "drug", stats = { effect = "stamina", widepupils = false, canOD = true } },
|
||||||
|
]] ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
--Example item
|
||||||
|
-- heartstopper = {
|
||||||
|
-- emote = "burger", -- Select an emote from below, it has to be in here
|
||||||
|
-- time = math.random(5000, 6000), -- Amount of time it takes to consume the item
|
||||||
|
-- stress = math.random(1,2), -- Amount of stress relief, can be 0
|
||||||
|
-- heal = 0, -- Set amount to heal by after consuming
|
||||||
|
-- armor = 5, -- Amount of armor to add
|
||||||
|
-- type = "food", -- Type: "alcohol" / "drink" / "food"
|
||||||
|
-- canRun = true, -- If true player can run while using the item, if not it will cancel the event
|
||||||
|
--
|
||||||
|
-- stats = {
|
||||||
|
-- screen = "thermal", -- The screen effect to be played when after consuming the item "rampage" "turbo" "focus" "weed" "trevor" "nightvision" "thermal"
|
||||||
|
-- effect = "heal", -- The status effect given by the item, "heal" / "stamina"
|
||||||
|
-- -- This supports ps-buffs effects "armor" "stress" "swimming" "hacking" "intelligence" "luck" "strength"
|
||||||
|
-- time = 10000, -- How long the effect should last (if not added it will default to 10000)
|
||||||
|
-- amount = 6, -- How much the value is changed by per second
|
||||||
|
-- hunger = math.random(10, 20), -- The hunger/thirst stats of the item, if not found in the items.lua
|
||||||
|
-- thirst = math.random(10, 20), -- The hunger/thirst stats of the item, if not found in the items.lua
|
||||||
|
-- canOD = true, -- This creates an OD Effect, killing the user if they have too much
|
||||||
|
-- },
|
||||||
|
-- --Reward Items Variables
|
||||||
|
-- -- These can be the only thing in a consumable table and the item will still work
|
||||||
|
-- amounttogive = 3, -- Used for "RewardItems", tells the script how many to give
|
||||||
|
-- rewards = {
|
||||||
|
-- [1] = {
|
||||||
|
-- item = "plastic", -- prize item name
|
||||||
|
-- max = 10, -- max amount to give (this is put into math.random(1, max) )
|
||||||
|
-- rarity = 1, -- the rarity system, 1 being rarest, 4 being most common
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
|
||||||
|
-- Example Box Item
|
||||||
|
-- ["9_box"] = { -- Name of the box item in the shared
|
||||||
|
-- emote = "uncuff", -- The emote than should run when "unboxing"
|
||||||
|
-- canRun = true, -- If true player can run while using the item, if not it will cancel the event
|
||||||
|
-- time = 3500, -- How long it takes to use the item
|
||||||
|
-- type = "pack", -- Designate it as a "pack" to the script knows what to do
|
||||||
|
-- pack = {
|
||||||
|
-- item = "9_ammo", -- The item to give from the box when complete
|
||||||
|
-- amount = 20 -- How many of the item to give
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
|
||||||
|
-- Example Cigar Item wiht requirements
|
||||||
|
-- ["cigar"] = { -- Name of the item in your shared items
|
||||||
|
-- emote = "smokecigar", -- The emote than should run when "smoking"
|
||||||
|
-- canRun = true, -- If true player can run while using the item, if not it will cancel the event
|
||||||
|
-- time = math.random(5000, 6000), -- How long it takes to use the item
|
||||||
|
-- type = "smoke", -- Designate it as a "smoke" to the script knows what to do
|
||||||
|
-- requiredItem = "lighter", -- Set a required item making it unsable if they don't have it
|
||||||
|
-- stats = {
|
||||||
|
-- effect = "stress",
|
||||||
|
-- time = 5000,
|
||||||
|
-- amount = math.random(10, 15),
|
||||||
|
-- canOD = false
|
||||||
|
-- }
|
||||||
|
-- },
|
||||||
|
}
|
||||||
89
shared/emotes.lua
Normal file
89
shared/emotes.lua
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
Config = Config or {}
|
||||||
|
|
||||||
|
Config.Emotes = {
|
||||||
|
drink = { "mp_player_intdrink", "loop_bottle", "Drink", AnimationOptions = { Prop = "prop_ld_flow_bottle", PropBone = 18905, PropPlacement = {0.12, 0.008, 0.03, 240.0, -60.0}, EmoteMoving = true, EmoteLoop = true, }},
|
||||||
|
milk = {"mp_player_intdrink", "loop_bottle", "Glass of milk", AnimationOptions = { Prop = 'bzzz_farmprops_milk_a', PropBone = 18905, PropPlacement = {-0.02, -0.04, 0.1, 34.0, 140.0, 224.0}, EmoteLoop = true, EmoteMoving = true, }},
|
||||||
|
coffee = {"amb@world_human_drinking@coffee@male@idle_a", "idle_c", "Coffee", AnimationOptions = { Prop = 'p_amb_coffeecup_01', PropBone = 28422, PropPlacement = {0.0,0.0,0.0,0.0,0.0,0.0}, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
burger = { "mp_player_inteat@burger", "mp_player_int_eat_burger", "Burger", AnimationOptions = { Prop = 'prop_cs_burger_01', PropBone = 18905, PropPlacement = {0.13,0.05,0.02,-50.0,16.0,60.0}, EmoteMoving = true }},
|
||||||
|
beer = {"amb@world_human_drinking@beer@male@idle_a", "idle_c", "Beer", AnimationOptions = { Prop = 'prop_amb_beer_bottle', PropBone = 28422, PropPlacement = {0.0,0.0,0.06,0.0,15.0,0.0}, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
egobar = {"mp_player_inteat@burger", "mp_player_int_eat_burger","Ego Bar", AnimationOptions = { Prop = 'prop_choc_ego', PropBone = 60309, PropPlacement = {0.0,0.0,0.0,0.0,0.0,0.0}, EmoteMoving = true }},
|
||||||
|
sandwich = {"mp_player_inteat@burger", "mp_player_int_eat_burger", "Sandwich", AnimationOptions = { Prop = 'prop_sandwich_01', PropBone = 18905, PropPlacement = {0.13,0.05,0.02,-50.0,16.0,60.0}, EmoteMoving = true }},
|
||||||
|
apple = {"mp_player_inteat@burger", "mp_player_int_eat_burger", "Apple", AnimationOptions = { Prop = 'idrp_apple_solo', PropBone = 18905, PropPlacement = {0.13,0.05,0.02,-50.0,16.0,60.0}, EmoteMoving = true }},
|
||||||
|
avacado = {"mp_player_inteat@burger", "mp_player_int_eat_burger", "Avacado", AnimationOptions = { Prop = 'idrp_avo_solo', PropBone = 18905, PropPlacement = {0.13,0.05,0.02,-50.0,16.0,60.0}, EmoteMoving = true }},
|
||||||
|
banana = {"mp_player_inteat@burger", "mp_player_int_eat_burger", "Banana", AnimationOptions = { Prop = 'idrp_bana_solo', PropBone = 18905, PropPlacement = {0.13,0.05,0.02,-50.0,16.0,60.0}, EmoteMoving = true }},
|
||||||
|
carrot = {"mp_player_inteat@burger", "mp_player_int_eat_burger", "Carrot", AnimationOptions = { Prop = 'idrp_carrot_single', PropBone = 18905, PropPlacement = {0.13,0.05,0.02,-50.0,16.0,60.0}, EmoteMoving = true }},
|
||||||
|
orange = {"mp_player_inteat@burger", "mp_player_int_eat_burger", "Orange", AnimationOptions = { Prop = 'idrp_bana_solo', PropBone = 18905, PropPlacement = {0.13,0.05,0.02,-50.0,16.0,60.0}, EmoteMoving = true }},
|
||||||
|
smoke3 = { "amb@world_human_aa_smoke@male@idle_a", "idle_b", "Smoke 3", AnimationOptions = { Prop = 'prop_cs_ciggy_01', PropBone = 28422, PropPlacement = {0.0,0.0,0.0,0.0,0.0,0.0}, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
whiskey = { "amb@world_human_drinking@coffee@male@idle_a", "idle_c", "Whiskey", AnimationOptions = { Prop = 'prop_drink_whisky', PropBone = 28422, PropPlacement = {0.01,-0.01,-0.06,0.0,0.0,0.0}, EmoteLoop = true, EmoteMoving = true } },
|
||||||
|
vodkab = {"mp_player_intdrink", "loop_bottle", "(Don't Use) Vodka Bottle", AnimationOptions = { Prop = 'prop_vodka_bottle', PropBone = 18905, PropPlacement = {0.00, -0.26, 0.10, 240.0, -60.0}, EmoteMoving = true, EmoteLoop = true }},
|
||||||
|
cherenkov1 = {"mp_player_intdrink", "loop_bottle", "(Don't Use) Vodka Bottle", AnimationOptions = { Prop = 'prop_cherenkov_01', PropBone = 18905, PropPlacement = {0.00, -0.26, 0.10, 240.0, -60.0}, EmoteMoving = true, EmoteLoop = true }},
|
||||||
|
cherenkov2 = {"mp_player_intdrink", "loop_bottle", "(Don't Use) Vodka Bottle", AnimationOptions = { Prop = 'prop_cherenkov_04', PropBone = 18905, PropPlacement = {0.00, -0.26, 0.10, 240.0, -60.0}, EmoteMoving = true, EmoteLoop = true }},
|
||||||
|
cherenkov3 = {"mp_player_intdrink", "loop_bottle", "(Don't Use) Vodka Bottle", AnimationOptions = { Prop = 'prop_cherenkov_03', PropBone = 18905, PropPlacement = {0.00, -0.26, 0.10, 240.0, -60.0}, EmoteMoving = true, EmoteLoop = true }},
|
||||||
|
cherenkov4 = {"mp_player_intdrink", "loop_bottle", "(Don't Use) Vodka Bottle", AnimationOptions = { Prop = 'prop_cherenkov_02', PropBone = 18905, PropPlacement = {0.00, -0.26, 0.10, 240.0, -60.0}, EmoteMoving = true, EmoteLoop = true }},
|
||||||
|
bleuturd = {"mp_player_intdrink", "loop_bottle", "(Don't Use) Vodka Bottle", AnimationOptions = { Prop = 'prop_champ_01b', PropBone = 18905, PropPlacement = {0.00, -0.26, 0.10, 240.0, -60.0}, EmoteMoving = true, EmoteLoop = true }},
|
||||||
|
bourgeoix = {"mp_player_intdrink", "loop_bottle", "(Don't Use) Vodka Bottle", AnimationOptions = { Prop = 'prop_bottle_cognac', PropBone = 18905, PropPlacement = {0.00, -0.26, 0.10, 240.0, -60.0}, EmoteMoving = true, EmoteLoop = true }},
|
||||||
|
cardiaque = {"mp_player_intdrink", "loop_bottle", "(Don't Use) Vodka Bottle", AnimationOptions = { Prop = 'prop_bottle_brandy', PropBone = 18905, PropPlacement = {0.00, -0.26, 0.10, 240.0, -60.0}, EmoteMoving = true, EmoteLoop = true }},
|
||||||
|
raggae = {"mp_player_intdrink", "loop_bottle", "(Don't Use) Vodka Bottle", AnimationOptions = { Prop = 'prop_rum_bottle', PropBone = 18905, PropPlacement = {0.00, -0.26, 0.10, 240.0, -60.0}, EmoteMoving = true, EmoteLoop = true }},
|
||||||
|
ecola = {"mp_player_intdrink", "loop_bottle", "E-cola", AnimationOptions = { Prop = "prop_ecola_can", PropBone = 18905, PropPlacement = {0.12, 0.008, 0.03, 240.0, -60.0}, EmoteMoving = true, EmoteLoop = true, }},
|
||||||
|
crisps = {"amb@world_human_drinking@coffee@male@idle_a", "idle_c", "Chrisps", AnimationOptions = { Prop = 'v_ret_ml_chips2', PropBone = 28422, PropPlacement = {0.01, -0.05, -0.1, 0.0, 0.0, 90.0}, EmoteLoop = true, EmoteMoving = true, }},
|
||||||
|
sprunk = {"mp_player_intdrink", "loop_bottle", "Sprunk", AnimationOptions = { Prop = "v_res_tt_can03", PropBone = 18905, PropPlacement = {0.12, 0.008, 0.03, 240.0, -60.0}, EmoteMoving = true, EmoteLoop = true, }},
|
||||||
|
wine = { "anim@heists@humane_labs@finale@keycards", "ped_a_enter_loop", "Wine", AnimationOptions = { Prop = 'prop_drink_redwine', PropBone = 18905, PropPlacement = {0.10, -0.03, 0.03, -100.0, 0.0, -10.0}, EmoteMoving = true, EmoteLoop = true }},
|
||||||
|
champagne = { "anim@heists@humane_labs@finale@keycards", "ped_a_enter_loop", "Champagne", AnimationOptions = { Prop = 'prop_drink_champ', PropBone = 18905, PropPlacement = { 0.10, -0.03, 0.03, -100.0, 0.0, -10.0 }, EmoteMoving = true, EmoteLoop = true }},
|
||||||
|
croissant = { "mp_player_inteat@burger", "mp_player_int_eat_burger", "Croissant", AnimationOptions = { Prop = 'bzzz_foodpack_croissant001', PropBone = 60309, PropPlacement = { 0.00, 0.0, -0.01, 0.0, 0.0, 90.0 }, EmoteMoving = true }},
|
||||||
|
cup = { "amb@world_human_drinking@coffee@male@idle_a", "idle_c", "Cup", AnimationOptions = { Prop = 'prop_plastic_cup_02', PropBone = 28422, PropPlacement = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
desert = { "mp_player_inteat@burger", "mp_player_int_eat_burger","Eat dessert", AnimationOptions = { Prop = 'bzzz_food_dessert_a', PropBone = 18905, PropPlacement = { 0.15, 0.03, 0.03, -42.0, -36.0, 0.0 }, EmoteMoving = true}},
|
||||||
|
dinner = { "anim@scripted@island@special_peds@pavel@hs4_pavel_ig5_caviar_p1", "base_idle", "Dinner", AnimationOptions = { Prop = "prop_cs_plate_01", PropBone = 60309, PropPlacement = { 0.0, 0.0, 0.0, 0.0, 0.0 }, SecondProp = 'h4_prop_h4_caviar_spoon_01a', SecondPropBone = 28422, SecondPropPlacement = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
flute = { "anim@heists@humane_labs@finale@keycards", "ped_a_enter_loop", "Flute", AnimationOptions = { Prop = 'prop_champ_flute', PropBone = 18905, PropPlacement = { 0.10, -0.03, 0.03, -100.0, 0.0, -10.0 }, EmoteMoving = true, EmoteLoop = true }},
|
||||||
|
frappe = { "amb@code_human_wander_drinking@male@base", "static", "Frappe", AnimationOptions = { Prop = 'brum_heartfrappe', PropBone = 28422, PropPlacement = { 0.0, -0.0150, -0.0100, 0.0, -3.9999, 0.0 }, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
frappe2 = { "amb@code_human_wander_drinking@female@base", "static", "Frappe 2", AnimationOptions = { Prop = 'beanmachine_cup', PropBone = 28422, PropPlacement = { 0.0110, 0.0, 0.0300, 0.0, 0.0, -140.0 }, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
frappe3 = { "amb@code_human_wander_drinking@female@base", "static", "Frappe 3", AnimationOptions = { Prop = 'beanmachine_cup2', PropBone = 28422, PropPlacement = { 0.0, 0.0, -0.0600, 0.0, 0.0, -178.0 }, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
frappe4 = { "amb@code_human_wander_drinking@female@base", "static", "Frappe 4", AnimationOptions = { Prop = 'beanmachine_cup3', PropBone = 28422, PropPlacement = { 0.0, 0.0, -0.0600, 0.0, 0.0, -178.0 }, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
hotdog = { "mp_player_inteat@burger", "mp_player_int_eat_burger", "Hotdog", AnimationOptions = { Prop = 'prop_cs_hotdog_02', PropBone = 60309, PropPlacement = { -0.0300, 0.0100, -0.0100, 95.1071, 94.7001, -66.9179 }, EmoteMoving = true }},
|
||||||
|
icecreama = { "mp_player_inteat@burger", "mp_player_int_eat_burger", "Ice cream Cherry", AnimationOptions = { Prop = 'bzzz_icecream_cherry', PropBone = 18905, PropPlacement = { 0.14, 0.03, 0.01, 85.0, 70.0, -203.0 }, EmoteMoving = true }},
|
||||||
|
icecreamb = { "mp_player_inteat@burger", "mp_player_int_eat_burger", "Ice cream Chocolate", AnimationOptions = { Prop = 'bzzz_icecream_chocolate', PropBone = 18905, PropPlacement = { 0.14, 0.03, 0.01, 85.0, 70.0, -203.0 }, EmoteMoving = true }},
|
||||||
|
icecreamc = { "mp_player_inteat@burger", "mp_player_int_eat_burger", "Ice cream Lemon", AnimationOptions = { Prop = 'bzzz_icecream_lemon', PropBone = 18905, PropPlacement = { 0.14, 0.03, 0.01, 85.0, 70.0, -203.0 }, EmoteMoving = true }},
|
||||||
|
icecreamd = { "mp_player_inteat@burger", "mp_player_int_eat_burger", "Ice cream Pistachio", AnimationOptions = { Prop = 'bzzz_icecream_pistachio', PropBone = 18905, PropPlacement = { 0.14, 0.03, 0.01, 85.0, 70.0, -203.0 }, EmoteMoving = true }},
|
||||||
|
icecreame = { "mp_player_inteat@burger", "mp_player_int_eat_burger", "Ice cream Raspberry", AnimationOptions = { Prop = 'bzzz_icecream_raspberry', PropBone = 18905, PropPlacement = { 0.14, 0.03, 0.01, 85.0, 70.0, -203.0 }, EmoteMoving = true }},
|
||||||
|
icecreamf = { "mp_player_inteat@burger", "mp_player_int_eat_burger", "Ice cream Stracciatella", AnimationOptions = { Prop = 'bzzz_icecream_stracciatella', PropBone = 18905, PropPlacement = { 0.14, 0.03, 0.01, 85.0, 70.0, -203.0 }, EmoteMoving = true }},
|
||||||
|
icecreamg = { "mp_player_inteat@burger", "mp_player_int_eat_burger", "Ice cream Strawberry", AnimationOptions = { Prop = 'bzzz_icecream_strawberry', PropBone = 18905, PropPlacement = { 0.14, 0.03, 0.01, 85.0, 70.0, -203.0 }, EmoteMoving = true }},
|
||||||
|
icecreamh = { "mp_player_inteat@burger", "mp_player_int_eat_burger", "Ice cream Walnut", AnimationOptions = { Prop = 'bzzz_icecream_walnut', PropBone = 18905, PropPlacement = { 0.14, 0.03, 0.01, 85.0, 70.0, -203.0 }, EmoteMoving = true }},
|
||||||
|
macaroon = { "mp_player_inteat@burger", "mp_player_int_eat_burger", "Macaroon", AnimationOptions = { Prop = 'bzzz_food_xmas_macaroon_a', PropBone = 18905, PropPlacement = { 0.15, 0.07, 0.00, 38.0, 7.0, 7.0 }, EmoteMoving = true }},
|
||||||
|
sipshake = { "smo@milkshake_idle", "milkshake_idle_clip", "Sip Milkshake - Bubblegum", AnimationOptions = { Prop = 'brum_cherryshake_raspberry', PropBone = 28422, PropPlacement = { 0.0850, 0.0670, -0.0350, -115.0862, -165.7841, 24.1318 }, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
sipshakeb = { "smo@milkshake_idle", "milkshake_idle_clip", "Sip Milkshake - Cherry", AnimationOptions = { Prop = 'brum_cherryshake_cherry', PropBone = 28422, PropPlacement = { 0.0850, 0.0670, -0.0350, -115.0862, -165.7841, 24.1318 }, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
sipshakec = { "smo@milkshake_idle", "milkshake_idle_clip", "Sip Milkshake - Chocolate", AnimationOptions = { Prop = 'brum_cherryshake_chocolate', PropBone = 28422, PropPlacement = { 0.0850, 0.0670, -0.0350, -115.0862, -165.7841, 24.1318 }, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
sipshaked = { "smo@milkshake_idle", "milkshake_idle_clip", "Sip Milkshake - Coffee", AnimationOptions = { Prop = 'brum_cherryshake_coffee', PropBone = 28422, PropPlacement = { 0.0850, 0.0670, -0.0350, -115.0862, -165.7841, 24.1318 }, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
sipshakee = { "smo@milkshake_idle", "milkshake_idle_clip", "Sip Milkshake - Double Chocolate", AnimationOptions = { Prop = 'brum_cherryshake_doublechocolate', PropBone = 28422, PropPlacement = { 0.0850, 0.0670, -0.0350, -115.0862, -165.7841, 24.1318 }, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
sipshakef = { "smo@milkshake_idle", "milkshake_idle_clip", "Sip Milkshake - Frappe", AnimationOptions = { Prop = 'brum_cherryshake_frappe', PropBone = 28422, PropPlacement = { 0.0850, 0.0670, -0.0350, -115.0862, -165.7841, 24.1318 }, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
sipshakeg = { "smo@milkshake_idle", "milkshake_idle_clip", "Sip Milkshake - Lemon", AnimationOptions = { Prop = 'brum_cherryshake_lemon', PropBone = 28422, PropPlacement = { 0.0850, 0.0670, -0.0350, -115.0862, -165.7841, 24.1318 }, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
sipshakeh = { "smo@milkshake_idle", "milkshake_idle_clip", "Sip Milkshake - Mint", AnimationOptions = { Prop = 'brum_cherryshake_mint', PropBone = 28422, PropPlacement = { 0.0850, 0.0670, -0.0350, -115.0862, -165.7841, 24.1318 }, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
sipshakei = { "smo@milkshake_idle", "milkshake_idle_clip", "Sip Milkshake - Strawberry", AnimationOptions = { Prop = 'brum_cherryshake_strawberry', PropBone = 28422, PropPlacement = { 0.0850, 0.0670, -0.0350, -115.0862, -165.7841, 24.1318 }, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
sipshakej = { "smo@milkshake_idle", "milkshake_idle_clip", "Sip Milkshake - Raspberry", AnimationOptions = { Prop = 'brum_cherryshake_raspberry', PropBone = 28422, PropPlacement = { 0.0850, 0.0670, -0.0350, -115.0862, -165.7841, 24.1318 }, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
sipshakek = { "smo@milkshake_idle", "milkshake_idle_clip", "Sip Milkshake - Salted", AnimationOptions = { Prop = 'brum_cherryshake_salted', PropBone = 28422, PropPlacement = { 0.0850, 0.0670, -0.0350, -115.0862, -165.7841, 24.1318 }, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
sipshakel = { "smo@milkshake_idle", "milkshake_idle_clip", "Sip Milkshake - Vanilla", AnimationOptions = { Prop = 'brum_cherryshake_vanilla', PropBone = 28422, PropPlacement = { 0.0850, 0.0670, -0.0350, -115.0862, -165.7841, 24.1318 }, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
pizzaslice = { "mp_player_inteat@burger", "mp_player_int_eat_burger", "Pizza Slice - Jalapeño And Peperoni", AnimationOptions = { Prop = 'knjgh_pizzaslice1', PropBone = 60309, PropPlacement = { 0.0500, -0.0200, -0.0200, 73.6928, -66.7427, 68.3677 }, EmoteMoving = true }},
|
||||||
|
pizzas = { "mp_player_inteat@burger", "mp_player_int_eat_burger", "Pizza Slice - Jalapeño And Peperoni", AnimationOptions = { Prop = 'knjgh_pizzaslice1', PropBone = 60309, PropPlacement = { 0.0500, -0.0200, -0.0200, 73.6928, -66.7427, 68.3677 }, EmoteMoving = true }},
|
||||||
|
pizzas2 = { "mp_player_inteat@burger", "mp_player_int_eat_burger", "Pizza Slice - Tomato And Pesto", AnimationOptions = { Prop = 'knjgh_pizzaslice2', PropBone = 60309, PropPlacement = { 0.0500, -0.0200, -0.0200, 73.6928, -66.7427, 68.3677 }, EmoteMoving = true }},
|
||||||
|
pizzas3 = { "mp_player_inteat@burger", "mp_player_int_eat_burger", "Pizza Slice - Mushroom", AnimationOptions = { Prop = 'knjgh_pizzaslice3', PropBone = 60309, PropPlacement = { 0.0500, -0.0200, -0.0200, 73.6928, -66.7427, 68.3677 }, EmoteMoving = true }},
|
||||||
|
pizzas4 = { "mp_player_inteat@burger", "mp_player_int_eat_burger", "Pizza Slice - Margherita", AnimationOptions = { Prop = 'knjgh_pizzaslice4', PropBone = 60309, PropPlacement = { 0.0500, -0.0200, -0.0200, 73.6928, -66.7427, 68.3677 }, EmoteMoving = true }},
|
||||||
|
pizzas5 = { "mp_player_inteat@burger", "mp_player_int_eat_burger", "Pizza Slice - Double Peperoni", AnimationOptions = { Prop = 'knjgh_pizzaslice5', PropBone = 60309, PropPlacement = { 0.0500, -0.0200, -0.0200, 73.6928, -66.7427, 68.3677 }, EmoteMoving = true }},
|
||||||
|
popcorn = { "amb@code_human_wander_drinking@female@base", "static", "Popcorn", AnimationOptions = { Prop = 'prop_taymckenzienz_popcorn', PropBone = 28422, PropPlacement = { -0.0200, -0.0100, -0.0700, -179.3626, 176.9331, 11.9833 }, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
sipsoda = { "smo@milkshake_idle", "milkshake_idle_clip", "Sip Soda Cup - Sprunk", AnimationOptions = { Prop = 'prop_rpemotes_soda01', PropBone = 28422, PropPlacement = { 0.0470, 0.0040, -0.0600, -88.0263, -25.0367, -27.3898 }, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
sipsodab = { "smo@milkshake_idle", "milkshake_idle_clip", "Sip Soda Cup - Sprunk Light", AnimationOptions = { Prop = 'prop_rpemotes_soda02', PropBone = 28422, PropPlacement = { 0.0470, 0.0040, -0.0600, -88.0263, -25.0367, -27.3898 }, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
sipsodac = { "smo@milkshake_idle", "milkshake_idle_clip", "Sip Soda Cup - eCola", AnimationOptions = { Prop = 'prop_rpemotes_soda03', PropBone = 28422, PropPlacement = { 0.0470, 0.0040, -0.0600, -88.0263, -25.0367, -27.3898 }, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
sipsodad = { "smo@milkshake_idle", "milkshake_idle_clip", "Sip Soda Cup - eCola Light", AnimationOptions = { Prop = 'prop_rpemotes_soda04', PropBone = 28422, PropPlacement = { 0.0470, 0.0040, -0.0600, -88.0263, -25.0367, -27.3898 }, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
taco = { "mp_player_inteat@burger", "mp_player_int_eat_burger", "Taco", AnimationOptions = { Prop = 'prop_taco_01', PropBone = 60309, PropPlacement = { -0.0170, 0.0070, -0.0210, 107.9846, -105.0251, 55.7779 }, EmoteMoving = true }},
|
||||||
|
xmascc = { "mp_player_inteat@burger", "mp_player_int_eat_burger", "Xmas Cupcake", AnimationOptions = { Prop = 'pata_christmasfood6', PropBone = 60309, PropPlacement = { 0.0100, 0.0200, -0.0100, -170.1788, 87.6716, 30.0540 }, EmoteMoving = true }},
|
||||||
|
xmascc2 = { "mp_player_inteat@burger", "mp_player_int_eat_burger", "Xmas Cupcake 2", AnimationOptions = { Prop = 'pata_christmasfood8', PropBone = 60309, PropPlacement = { 0.0200, 0.0, -0.0100, 9.3608, -90.1809, 66.3689 }, EmoteMoving = true }},
|
||||||
|
xmasic = { "anim@scripted@island@special_peds@pavel@hs4_pavel_ig5_caviar_p1", "base_idle", "Xmas Ice Cream", AnimationOptions = { Prop = "pata_christmasfood7", PropBone = 60309, PropPlacement = { -0.0460, 0.0000, -0.0300, 0.0, 0.0, -50.0000 }, SecondProp = 'h4_prop_h4_coke_spoon_01', SecondPropBone = 28422, SecondPropPlacement = { 0.0, 0.0, 0.0, 0.0, 20.0, 0.0 }, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
xmaswine = { "mp_player_intdrink", "loop_bottle", "Xmas Mulled Wine", AnimationOptions = { Prop = 'bzzz_food_xmas_mulled_wine_a', PropBone = 18905, PropPlacement = { 0.13, 0.03, 0.05, -110.0, -47.0, 7.0 }, EmoteMoving = true }},
|
||||||
|
cocoa = { "amb@world_human_aa_coffee@base", "base", "Xmas Cocoa", AnimationOptions = { Prop = 'pata_christmasfood1', PropBone = 28422, PropPlacement = { 0.0100, -0.1100, -0.1300, 0.0, 0.0, 0.0 }, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
coke = { "switch@trevor@trev_smoking_meth", "trev_smoking_meth_loop", "Coke", AnimationOptions = { EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
oxy = { "mp_suicide", "pill", "Oxy", AnimationOptions = { EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
cigar = { "amb@world_human_smoking@male@male_a@enter", "enter", "Cigar", AnimationOptions = { Prop = 'prop_cigar_02', PropBone = 47419, PropPlacement = { 0.010, 0.0, 0.0, 50.0, 0.0, -80.0 }, EmoteMoving = true, EmoteDuration = 2600 }},
|
||||||
|
cigar2 = { "amb@world_human_smoking@male@male_a@enter", "enter", "Cigar 2", AnimationOptions = { Prop = 'prop_cigar_01', PropBone = 47419, PropPlacement = { 0.010, 0.0, 0.0, 50.0, 0.0, -80.0 }, EmoteMoving = true, EmoteDuration = 2600 }},
|
||||||
|
joint = { "amb@world_human_smoking@male@male_a@enter", "enter", "Joint", AnimationOptions = { Prop = 'p_cs_joint_02', PropBone = 47419, PropPlacement = { 0.015, -0.009, 0.003, 55.0, 0.0, 110.0 }, EmoteMoving = true, EmoteDuration = 2600 }},
|
||||||
|
cig = { "amb@world_human_smoking@male@male_a@enter", "enter", "Cig", AnimationOptions = { Prop = 'prop_amb_ciggy_01', PropBone = 47419, PropPlacement = { 0.015, -0.009, 0.003, 55.0, 0.0, 110.0 }, EmoteMoving = true, EmoteDuration = 2600 }},
|
||||||
|
smoke2 = { "amb@world_human_aa_smoke@male@idle_a", "idle_c", "Smoke 2", AnimationOptions = { Prop = 'prop_cs_ciggy_01', PropBone = 28422, PropPlacement = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
smokecigar = { "amb@world_human_aa_smoke@male@idle_a", "idle_c", "Smoke Cigar", AnimationOptions = { Prop = 'prop_cigar_01', PropBone = 28422, PropPlacement = { 0.0, 0.0, 0.0, 0.0, 0.0, 180.0 }, EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
uncuff = { "mp_arresting", "a_uncuff", "Uncuff", AnimationOptions = { EmoteLoop = true, EmoteMoving = true }},
|
||||||
|
}
|
||||||
39
shared/shared.lua
Normal file
39
shared/shared.lua
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
function tempLockInv(toggle)
|
||||||
|
LocalPlayer.state:set("inv_busy", toggle, true)
|
||||||
|
TriggerEvent('inventory:client:busy:status', toggle)
|
||||||
|
TriggerEvent('canUseInventoryAndHotbar:toggle', not toggle)
|
||||||
|
end
|
||||||
|
|
||||||
|
function GenerateRandomValues(data)
|
||||||
|
local transData = {}
|
||||||
|
for k, v in pairs(data) do
|
||||||
|
if type(v) == "table" then
|
||||||
|
debugPrint("Converting Table "..json.encode(v).." to math.random")
|
||||||
|
transData[k] = math.random(v[1], v[2])
|
||||||
|
debugPrint("Translated value: "..k.." - "..transData[k])
|
||||||
|
else
|
||||||
|
transData[k] = v
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if transData.hunger > 0 then
|
||||||
|
transData.hunger = transData.hunger > 100 and 100 or transData.hunger
|
||||||
|
end
|
||||||
|
|
||||||
|
if transData.thirst > 0 then
|
||||||
|
transData.thirst = transData.thirst > 100 and 100 or transData.thirst
|
||||||
|
end
|
||||||
|
|
||||||
|
if transData.stress > 0 then
|
||||||
|
transData.stress = transData.stress > 100 and 100 or transData.stress
|
||||||
|
end
|
||||||
|
|
||||||
|
return transData["time"],
|
||||||
|
transData["heal"],
|
||||||
|
transData["armor"],
|
||||||
|
{
|
||||||
|
hunger = transData["hunger"] or 0,
|
||||||
|
thirst = transData["thirst"] or 0,
|
||||||
|
stress = transData["stress"] or 0
|
||||||
|
}
|
||||||
|
end
|
||||||
6
version.txt
Normal file
6
version.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
2.0.09
|
||||||
|
|
||||||
|
- Fix possible issue with nil needTypes tables being sent
|
||||||
|
- Fix packitems and return items not giving any items
|
||||||
|
|
||||||
|
https://github.com/jimathy/jim-consumables/releases/latest
|
||||||
Reference in New Issue
Block a user