Hello! Here are my (very) basic breathalyzer and inventory scripts
---------------Breathalyzer-----------------
Features:
- Stores player’s B.A.C. levels via their player id
- Easily checkable
- Requires no additional frameworks or libraries
- Automatically clears the B.A.C upon the player leaving
- Includes password protected command to clear all B.A.C. levels and wipe the table
Commands:
- “/bacset [number]” Sets your B.A.C. level and attaches it to your player id
- “/bactest [playerid]” Tests a player’s B.A.C. level
- “/bacclear” Clears your B.A.C. level
- “/bacclearall [password]” Clears all B.A.C. levels, the password can be changed in the server.lua
How it works:
Upon receiving the “/bacset” command, it will take the second word (if it exists) and places it into an array, based off of the current player’s id. The “/bactest” command then will take the given id and check for an entry in the array at that location.
breathalyzer.zip (1.5 KB)
---------------Inventory-----------------
Features:
- Stores player’s ped and vehicle inventory (based off of what they enter)
- Easily checkable
- Requires no additional frameworks
- Automatically clears both inventories upon player leaving
Commands:
- “/setpedinv [items]” Sets your current player inventory
- “/setvehinv [items]” Sets your current vehicle inventory
- “/searchped [playerid]” Searches the given player’s inventory
- “/searchveh [playerid]” Searches the given player’s vehicle inventory
- “/clearinv” Clears both of your inventories
- “/clearallinv [password]” Clears all player’s inventories, the password can be changed in the server.lua
- “/clearoneinv [playerid] [password]” Clears a specific player’s inventories, the password can be changed in the server.lua
How it works:
Upon receiving the “/setpedinv” or “/setvehinv” command, it will take the second word (if it exists) and places it into an array, based off of the current player’s id. The “/searchped” or “/searchveh” command then will take the given id and check for an entry in the array at that location.
search.zip (1.6 KB)
If you have any issues please let me know, and I will do my best to fix them!