neues consum script

This commit is contained in:
Nordi98 2025-06-17 21:38:35 +02:00
parent e491cb80bb
commit f28aeabf6b
163 changed files with 2364 additions and 10287 deletions

View file

@ -1,2 +0,0 @@
# Auto detect text files and perform LF normalization
* text=auto

View file

@ -1,77 +0,0 @@
# MR Consumables
Hello, This is a read me file designed to help you understand everything you need to know about the script
## Installation
Put the script somewhere in your resource folder
Go to the config in config/sh_config.lua and to config/cl_config.lua and config the script according to your server (Make sure the inventory and core names you wrote in the config are matching the inventory and core your have)
(IF YOU ARE USING THE SOUNDS)
Make sure you have xSound installed, if not. Go to this link and install it https://github.com/Xogy/xsound/releases/tag/1.4.3 (You can also use your own if you have coding knowlage but xSound is the most recommended right now)
Put the sounds in the sounds folder in xsound/html/sounds for them to work
(IF YOU WANT TO USE OUR DEFAULT ITEMS)
Make sure to put images in your inventories image folder
Add the items to your inventory/core
#### ox_inventory
["ecola"] = {
label = "eCola",
weight = 500,
stack = false,
close = true,
description = "For all the thirsty out there",
},
["sprunk"] = {
label = "Sprunk",
weight = 500,
stack = false,
close = true,
description = "For all the thirsty out there",
},
["burger"] = {
label = "Burger",
weight = 500,
stack = false,
close = true,
description = "For all the hungry out there",
},
["sandwich"] = {
label = "Sandwich",
weight = 500,
stack = false,
close = true,
description = "For all the hungry out there",
},
#### qb-inventory
['ecola'] = { name = 'ecola', label = 'eCola', weight = 500, type = 'item', image = 'ecola.png', unique = true, useable = true, shouldClose = true, combinable = nil, description = 'For all the thirsty out there' },
['sprunk'] = { name = 'sprunk', label = 'Sprunk', weight = 500, type = 'item', image = 'sprunk.png', unique = true, useable = true, shouldClose = true, combinable = nil, description = 'For all the thirsty out there' },
['sandwich'] = { name = 'sandwich', label = 'Sandwich', weight = 500, type = 'item', image = 'sandwich.png', unique = true, useable = true, shouldClose = true, combinable = nil, description = 'For all the hungry out there' },
['burger'] = { name = 'burger', label = 'Burger', weight = 500, type = 'item', image = 'burger.png', unique = true, useable = true, shouldClose = true, combinable = nil, description = 'For all the hungry out there' },
## IMPORTANT
If you want to add your own items, duplicate one of our default items in the config and change what you want according to your needs
## Make sure your item cannot be stacked (turn off stacked in ox_inventory or unique in qb-inventory) because the item is using metadata to count the amount of consumes remaining
And if you want to attach items to the animations specified in our config, Turn on debug in the config (Config.Debug = true) and use the command "consumes:debug" to trigger the animations, stop them and etc
The system does not have prop attachment tools (yet) but there are ones i recommened
Attach Prop to Player Editor By "PERPGamer" https://forum.cfx.re/t/dev-tool-attach-prop-to-player-editor/4864072
TGIANN Attach Prop to Player By "TGIANN" https://forum.cfx.re/t/dev-tool-tgiann-attach-prop-to-player/5107789
And of course make sure to enable it in your server cfg
"ensure mr-consumables"
## IF YOU NEED ANY EXTRA HELP FEEL FREE TO OPEN A TICKET IN OUR DISCORD

View file

@ -1,10 +0,0 @@
CLConfig = {
UI = {
TextUI = "ox_lib" -- The Type Of Text UI You Want To Use (gta, ox_lib or custom)
},
Keybinds = {
Use = "E", -- The Keybind To Use The Item
Drop = "G", -- The Keybind To Drop The Item
StopDebug = "X" -- The Keybind To Stop Debugging
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,43 +0,0 @@
fx_version 'cerulean'
games { 'gta5' }
shared_scripts {
'open/shared/*.lua',
'Locale.lua',
"@ox_lib/init.lua",
"config/sh_config.lua",
'langs/*.lua',
}
client_scripts {
'config/cl_config.lua',
'client/*.lua',
'open/client/*.lua',
}
server_scripts {
-- 'config/sv_config.lua',
'server/*.lua',
'open/server/*.lua',
}
ui_page 'ui/dist/index.html'
files {
'ui/dist/index.html',
'ui/dist/assets/*.js',
'ui/dist/assets/*.css',
}
escrow_ignore {
'open/shared/*.lua',
'open/client/*.lua',
'open/server/*.lua',
'config/*.lua',
'langs/*.lua',
}
lua54 'yes'
dependency '/assetpacks'
dependency '/assetpacks'

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

View file

@ -1,7 +0,0 @@
Translations["DE"] = {
["use"] = "{button} - Benutzen",
["put_back"] = "{button} - Zurücklegen",
["ate_item"] = "Du hast das gesamte %s gegessen", -- %s ist der vom Skript veränderte Gegenstandsname
["drank_item"] = "Du hast das gesamte %s getrunken", -- %s ist der vom Skript veränderte Gegenstandsname
["exit_debug"] = "{button} - Debug verlassen"
}

View file

@ -1,7 +0,0 @@
Translations["EN"] = {
["use"] = "{button} - Use",
["put_back"] = "{button} - Put Back",
["ate_item"] = "You Ate The Entire %s", -- %s Is The Item Name Changed By The Script
["drank_item"] = "You Drank The Entire %s", -- %s Is The Item Name Changed By The Script
["exit_debug"] = "{button} - Exit Debug"
}

View file

@ -1,21 +0,0 @@
function ShowTextUI(text) -- You Can Use This Function To Show Text UI
if CLConfig.UI.TextUI == "gta" then
AddTextEntry("textUIEntry", text)
BeginTextCommandDisplayHelp("textUIEntry")
EndTextCommandDisplayHelp(0, true, true, -1)
elseif CLConfig.UI.TextUI == "ox_lib" then
lib.showTextUI(text)
end
end
function HideTextUI() -- You Can Use This Function To Hide Text UI
if CLConfig.UI.TextUI == "gta" then
ClearAllHelpMessages()
elseif CLConfig.UI.TextUI == "ox_lib" then
lib.hideTextUI()
end
end
function Notify(text, type) -- You Can Put Your Own Notification System Here
Core.Functions.Notify(text, type)
end

View file

@ -1,22 +0,0 @@
while not Core do
Wait(100)
end
local arguments = {
{ name = 'item_name', help = 'The Item You Want To Test (Make Sure It Exists In Config)' },
{ name = 'action', help = 'The Action You Want To Test For The Item' },
{ name = 'with_prop', help = 'Attach Prop To The Player (1 = Yes, 0 = No)' },
{ name = 'freeze_anim', help = 'Freeze The Animation (1 = Yes, 0 = No)' }
}
local argsRequired = true -- if this is true the command won't work without args entered
Core.Commands.Add('consumes:debug', 'Test Action Animations For Attaching Props', arguments, argsRequired,
function(source, args)
if not Config.Debug then
Notify(source, 'This Command Is Disabled Because Debug Mode Is Off', 'error')
return
end
TriggerClientEvent("mr-consumables:debug:testAnim", source, args[1], args[2], tonumber(args[3]),
tonumber(args[4]))
end, 'god')

View file

@ -1,42 +0,0 @@
function Notify(src, text, type) -- You Can Put Your Own Notification System Here
TriggerClientEvent("QBCore:Notify", src, text, type)
end
function OnMetadataSet(src, ItemName, Metadata, NewValue) -- You Can Use This Function To Trigger Anything You Want When An Item Has Been Used Like Buffs
if Metadata == "hunger" or Metadata == "thirst" then -- Make Sure This Function Stays Here If You Want Your HUD to Update Once It Changed
local Player = Core.Functions.GetPlayer(src)
if Player then
TriggerClientEvent("hud:client:UpdateNeeds", src, Player.PlayerData.metadata['hunger'],
Player.PlayerData.metadata['thirst'])
end
end
end
function BanCheater(src) -- Add Ban If You Want, The Function This Triggered By Will Get Returned Anyway If This Function Will Trigger
print("BAN CHEATER")
end
local PlayerSounds = {} -- DON'T REMOVE THIS IF YOU ARE USING SOUNDS
function PlaySound(src, sound)
if not Config.Sounds.Enabled then return end
if GetResourceState(Config.Sounds.Resource) ~= "started" then
DebugPrint("ERROR", "The Sound Resource Does Not Exists Therefore Sounds Are Not Enabled")
return
end
if PlayerSounds[src] then
exports.xsound:Destroy(src, PlayerSounds[src])
end
PlayerSounds[src] = string.format("consumables_%s", src)
exports.xsound:PlayUrlPos(src, PlayerSounds[src], sound, Config.Sounds.Volume, GetEntityCoords(GetPlayerPed(src)))
Wait(100)
exports.xsound:Distance(PlayerSounds[src], Config.Sounds.Distance)
end
function StopSound(src)
if not Config.Sounds.Enabled then return end
if PlayerSounds[src] then
exports.xsound:Destroy(src, PlayerSounds[src])
PlayerSounds[src] = nil
end
end

View file

@ -1,15 +0,0 @@
function GetCoreObject()
return exports[Config.Framework.Resource]:GetCoreObject()
end
function DebugPrint(level, text)
print(string.format("[%s]: %s ERROR: %s", GetCurrentResourceName(), level, text))
end
function GetCoreItems()
if Config.Inventory.Name == "qs" then
return exports[Config.Inventory.Resource]:Items()
elseif Config.Inventory.Name == "qb" then
return Core.Shared.Items -- The Var "Core" Is Getting Initiated When The Script Is Loaded
end
end

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,13 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script type="module" crossorigin src="assets/index-D_LefMp9.js"></script>
<link rel="stylesheet" crossorigin href="assets/index-EUJbTM7x.css" />
</head>
<body>
<div id="root"></div>
</body>
</html>

File diff suppressed because it is too large Load diff