├── .gitignore ├── MP-Banking ├── .eslintrc.json ├── .gitignore ├── .prettierrc ├── .yarn.installed ├── README.md ├── fxmanifest.lua ├── lerna.json ├── package.json ├── packages │ ├── resource │ │ ├── client │ │ │ └── client.ts │ │ ├── config │ │ │ └── config.ts │ │ ├── dist │ │ │ ├── client.js │ │ │ └── server.js │ │ ├── package.json │ │ ├── scripts │ │ │ ├── build.js │ │ │ └── watch.js │ │ ├── server │ │ │ └── server.ts │ │ └── yarn.lock │ └── ui │ │ ├── .gitignore │ │ ├── dist │ │ ├── assets │ │ │ ├── index.66dfa777.css │ │ │ ├── index.d017c343.js │ │ │ └── mp.62a4aa8b.png │ │ ├── index.html │ │ ├── mp.png │ │ └── vite.svg │ │ ├── index.html │ │ ├── package.json │ │ ├── postcss.config.cjs │ │ ├── public │ │ ├── mp.png │ │ └── vite.svg │ │ ├── src │ │ ├── App.tsx │ │ ├── index.css │ │ ├── main.tsx │ │ ├── pages │ │ │ ├── MPBANKING │ │ │ │ └── MPBANKING.tsx │ │ │ └── index.ts │ │ ├── utils │ │ │ ├── exitListener.ts │ │ │ └── nui.ts │ │ └── vite-env.d.ts │ │ ├── tailwind.config.cjs │ │ ├── tsconfig.json │ │ ├── tsconfig.node.json │ │ ├── vite.config.ts │ │ └── yarn.lock ├── tsconfig.json └── yarn.lock ├── MP-Base ├── admin │ ├── cl_admin.lua │ └── sv_admin.lua ├── base.sql ├── character │ ├── cl_char.lua │ ├── db_char.lua │ └── sv_char.lua ├── core │ ├── cl_core.lua │ └── sv_core.lua ├── events │ ├── cl_events.lua │ └── sv_events.lua ├── fxmanifest.lua ├── gameplay │ └── gameplay.lua ├── html │ ├── app.js │ ├── img │ │ ├── background.png │ │ └── logo.png │ ├── index.html │ └── main.css ├── player │ └── player.lua └── shared │ └── shared.lua ├── MP-Commands ├── .yarn.installed ├── README.md ├── build │ ├── commands.js │ ├── server.js │ └── server │ │ ├── commands.js │ │ └── server.js ├── fxmanifest.lua ├── package-lock.json ├── package.json ├── prod.build.js ├── server │ ├── commands.ts │ ├── server.ts │ └── tsconfig.json └── yarn.lock ├── MP-Elements ├── client │ └── cl_ui.lua ├── fxmanifest.lua ├── html │ ├── drawtext.js │ ├── index.html │ ├── scripts.js │ └── style.css ├── readme.md └── server │ └── sv_ui.lua ├── MP-Framework-Hosting.sql ├── MP-Loading ├── bankgothic.ttf ├── fxmanifest.lua ├── index.html ├── loading.png └── style.css ├── MP-Logs ├── client │ ├── cl_discord.lua │ └── cl_logDeath.lua ├── config.lua ├── fxmanifest.lua └── server │ └── sv_logs.lua ├── MP-Spawn ├── client │ └── cl_spawn.lua ├── fxmanifest.lua └── html │ ├── index.html │ ├── scripts.js │ ├── spawnmenu.png │ └── style.css ├── MP-Weather ├── client │ └── cl_weather.lua └── fxmanifest.lua ├── README.md ├── [Port-Scripts] └── qb-clothing │ ├── LICENSE │ ├── README.md │ ├── client │ └── main.lua │ ├── config.lua │ ├── fxmanifest.lua │ ├── html │ ├── image.png │ ├── index.html │ ├── reset.css │ ├── script.js │ └── style.css │ ├── qb-clothing.sql │ └── server │ └── main.lua ├── [managers] └── mapmanager │ ├── fxmanifest.lua │ ├── mapmanager_client.lua │ ├── mapmanager_server.lua │ └── mapmanager_shared.lua ├── [ox] ├── ox_inventory │ ├── LICENSE │ ├── README.md │ ├── client.lua │ ├── data │ │ ├── animations.lua │ │ ├── crafting.lua │ │ ├── evidence.lua │ │ ├── items.lua │ │ ├── licenses.lua │ │ ├── shops.lua │ │ ├── stashes.lua │ │ ├── vehicles.lua │ │ └── weapons.lua │ ├── fxmanifest.lua │ ├── init.lua │ ├── locales │ │ └── en.json │ ├── modules │ │ ├── bridge │ │ │ ├── client.lua │ │ │ ├── qb │ │ │ │ ├── client.lua │ │ │ │ └── server.lua │ │ │ └── server.lua │ │ ├── crafting │ │ │ ├── client.lua │ │ │ └── server.lua │ │ ├── hooks │ │ │ └── server.lua │ │ ├── interface │ │ │ └── client.lua │ │ ├── inventory │ │ │ ├── client.lua │ │ │ └── server.lua │ │ ├── items │ │ │ ├── client.lua │ │ │ ├── containers.lua │ │ │ ├── server.lua │ │ │ └── shared.lua │ │ ├── mysql │ │ │ └── server.lua │ │ ├── pefcl │ │ │ └── server.lua │ │ ├── shops │ │ │ ├── client.lua │ │ │ └── server.lua │ │ ├── utils │ │ │ ├── client.lua │ │ │ └── server.lua │ │ └── weapon │ │ │ └── client.lua │ ├── server.lua │ ├── setup │ │ └── convert.lua │ └── web │ │ ├── build │ │ ├── assets │ │ │ ├── index-95f8e076.css │ │ │ └── index-d6f109a8.js │ │ └── index.html │ │ └── images │ │ ├── CIGARETTE.png │ │ ├── WEAPON_ADVANCEDRIFLE.png │ │ ├── WEAPON_APPISTOL.png │ │ ├── WEAPON_ASSAULTRIFLE.png │ │ ├── WEAPON_ASSAULTRIFLE_MK2.png │ │ ├── WEAPON_ASSAULTSHOTGUN.png │ │ ├── WEAPON_ASSAULTSMG.png │ │ ├── WEAPON_AUTOSHOTGUN.png │ │ ├── WEAPON_BALL.png │ │ ├── WEAPON_BAT.png │ │ ├── WEAPON_BATTLEAXE.png │ │ ├── WEAPON_BOTTLE.png │ │ ├── WEAPON_BULLPUPRIFLE.png │ │ ├── WEAPON_BULLPUPRIFLE_MK2.png │ │ ├── WEAPON_BULLPUPSHOTGUN.png │ │ ├── WEAPON_BZGAS.png │ │ ├── WEAPON_CANDYCANE.png │ │ ├── WEAPON_CARBINERIFLE.png │ │ ├── WEAPON_CARBINERIFLE_MK2.png │ │ ├── WEAPON_CERAMICPISTOL.png │ │ ├── WEAPON_COMBATMG.png │ │ ├── WEAPON_COMBATMG_MK2.png │ │ ├── WEAPON_COMBATPDW.png │ │ ├── WEAPON_COMBATPISTOL.png │ │ ├── WEAPON_COMBATSHOTGUN.png │ │ ├── WEAPON_COMPACTLAUNCHER.png │ │ ├── WEAPON_COMPACTRIFLE.png │ │ ├── WEAPON_CROWBAR.png │ │ ├── WEAPON_DBSHOTGUN.png │ │ ├── WEAPON_DIGISCANNER.png │ │ ├── WEAPON_DOUBLEACTION.png │ │ ├── WEAPON_EMPLAUNCHER.png │ │ ├── WEAPON_FERTILIZERCAN.png │ │ ├── WEAPON_FIREEXTINGUISHER.png │ │ ├── WEAPON_FIREWORK.png │ │ ├── WEAPON_FLARE.png │ │ ├── WEAPON_FLAREGUN.png │ │ ├── WEAPON_FLASHLIGHT.png │ │ ├── WEAPON_GADGETPISTOL.png │ │ ├── WEAPON_GOLFCLUB.png │ │ ├── WEAPON_GRENADE.png │ │ ├── WEAPON_GRENADELAUNCHER.png │ │ ├── WEAPON_GUSENBERG.png │ │ ├── WEAPON_HAMMER.png │ │ ├── WEAPON_HATCHET.png │ │ ├── WEAPON_HAZARDCAN.png │ │ ├── WEAPON_HEAVYPISTOL.png │ │ ├── WEAPON_HEAVYRIFLE.png │ │ ├── WEAPON_HEAVYSHOTGUN.png │ │ ├── WEAPON_HEAVYSNIPER.png │ │ ├── WEAPON_HEAVYSNIPER_MK2.png │ │ ├── WEAPON_HOMINGLAUNCHER.png │ │ ├── WEAPON_KNIFE.png │ │ ├── WEAPON_KNUCKLE.png │ │ ├── WEAPON_MACHETE.png │ │ ├── WEAPON_MACHINEPISTOL.png │ │ ├── WEAPON_MARKSMANPISTOL.png │ │ ├── WEAPON_MARKSMANRIFLE.png │ │ ├── WEAPON_MARKSMANRIFLE_MK2.png │ │ ├── WEAPON_METALDETECTOR.png │ │ ├── WEAPON_MG.png │ │ ├── WEAPON_MICROSMG.png │ │ ├── WEAPON_MILITARYRIFLE.png │ │ ├── WEAPON_MINIGUN.png │ │ ├── WEAPON_MINISMG.png │ │ ├── WEAPON_MOLOTOV.png │ │ ├── WEAPON_MUSKET.png │ │ ├── WEAPON_NAVYREVOLVER.png │ │ ├── WEAPON_NIGHTSTICK.png │ │ ├── WEAPON_PETROLCAN.png │ │ ├── WEAPON_PIPEBOMB.png │ │ ├── WEAPON_PISTOL.png │ │ ├── WEAPON_PISTOL50.png │ │ ├── WEAPON_PISTOLXM3.png │ │ ├── WEAPON_PISTOL_MK2.png │ │ ├── WEAPON_POOLCUE.png │ │ ├── WEAPON_PRECISIONRIFLE.png │ │ ├── WEAPON_PROXMINE.png │ │ ├── WEAPON_PUMPSHOTGUN.png │ │ ├── WEAPON_PUMPSHOTGUN_MK2.png │ │ ├── WEAPON_RAILGUN.png │ │ ├── WEAPON_RAILGUNXM3.png │ │ ├── WEAPON_RAYCARBINE.png │ │ ├── WEAPON_RAYMINIGUN.png │ │ ├── WEAPON_RAYPISTOL.png │ │ ├── WEAPON_REVOLVER.png │ │ ├── WEAPON_REVOLVER_MK2.png │ │ ├── WEAPON_RPG.png │ │ ├── WEAPON_SAWNOFFSHOTGUN.png │ │ ├── WEAPON_SMG.png │ │ ├── WEAPON_SMG_MK2.png │ │ ├── WEAPON_SMOKEGRENADE.png │ │ ├── WEAPON_SNIPERRIFLE.png │ │ ├── WEAPON_SNOWBALL.png │ │ ├── WEAPON_SNSPISTOL.png │ │ ├── WEAPON_SNSPISTOL_MK2.png │ │ ├── WEAPON_SPECIALCARBINE.png │ │ ├── WEAPON_SPECIALCARBINE_MK2.png │ │ ├── WEAPON_STICKYBOMB.png │ │ ├── WEAPON_STONE_HATCHET.png │ │ ├── WEAPON_STUNGUN.png │ │ ├── WEAPON_SWITCHBLADE.png │ │ ├── WEAPON_TACTICALRIFLE.png │ │ ├── WEAPON_TECPISTOL.png │ │ ├── WEAPON_VINTAGEPISTOL.png │ │ ├── WEAPON_WRENCH.png │ │ ├── ammo-9.png │ │ ├── ammo-musket.png │ │ ├── ammo-rifle.png │ │ ├── ammo-rifle2.png │ │ ├── ammo-shotgun.png │ │ ├── armour.png │ │ ├── at_flashlight.png │ │ ├── at_flashlight_rifle.png │ │ ├── bandage.png │ │ ├── beer.png │ │ ├── black_money.png │ │ ├── bsfries.png │ │ ├── burger.png │ │ ├── candy.png │ │ ├── carokit.png │ │ ├── chipscheese.png │ │ ├── chipshabanero.png │ │ ├── chipsribs.png │ │ ├── chipssalt.png │ │ ├── cocaine.png │ │ ├── cola.png │ │ ├── copper.png │ │ ├── diamond.png │ │ ├── donut.png │ │ ├── drug_blue.png │ │ ├── drug_red.png │ │ ├── drug_white.png │ │ ├── evidence.png │ │ ├── fertilizer.png │ │ ├── fixkit.png │ │ ├── garbage.png │ │ ├── gold.png │ │ ├── hotdog.png │ │ ├── iron.png │ │ ├── joint.png │ │ ├── keys.png │ │ ├── lockpick.png │ │ ├── medikit.png │ │ ├── meth.png │ │ ├── money.png │ │ ├── mustard.png │ │ ├── necklace.png │ │ ├── panties.png │ │ ├── paperbag.png │ │ ├── parachute.png │ │ ├── pepperoni.png │ │ ├── phone.png │ │ ├── radio.png │ │ ├── ramen.png │ │ ├── rolex.png │ │ ├── silver.png │ │ ├── small_armour.png │ │ ├── taco.png │ │ ├── trash_bread.png │ │ ├── trash_burgershot.png │ │ ├── trash_can.png │ │ ├── trash_chips.png │ │ ├── trash_coffee.png │ │ ├── trash_fags.png │ │ ├── trash_newspaper.png │ │ ├── trash_paper.png │ │ ├── turkey.png │ │ └── water.png ├── ox_lib │ ├── LICENSE │ ├── README.md │ ├── fxmanifest.lua │ ├── imports │ │ ├── __addCommand │ │ │ └── server.lua │ │ ├── addCommand │ │ │ └── server.lua │ │ ├── addKeybind │ │ │ └── client.lua │ │ ├── callback │ │ │ ├── client.lua │ │ │ └── server.lua │ │ ├── cron │ │ │ └── server.lua │ │ ├── disableControls │ │ │ └── client.lua │ │ ├── getClosestObject │ │ │ └── client.lua │ │ ├── getClosestPed │ │ │ └── client.lua │ │ ├── getClosestPlayer │ │ │ └── client.lua │ │ ├── getClosestVehicle │ │ │ └── client.lua │ │ ├── getNearbyObjects │ │ │ └── client.lua │ │ ├── getNearbyPeds │ │ │ └── client.lua │ │ ├── getNearbyPlayers │ │ │ └── client.lua │ │ ├── getNearbyVehicles │ │ │ └── client.lua │ │ ├── locale │ │ │ └── shared.lua │ │ ├── logger │ │ │ └── server.lua │ │ ├── math │ │ │ └── shared.lua │ │ ├── points │ │ │ └── client.lua │ │ ├── raycast │ │ │ └── client.lua │ │ ├── requestAnimDict │ │ │ └── client.lua │ │ ├── requestAnimSet │ │ │ └── client.lua │ │ ├── requestModel │ │ │ └── client.lua │ │ ├── requestNamedPtfxAsset │ │ │ └── client.lua │ │ ├── requestScaleformMovie │ │ │ └── client.lua │ │ ├── requestStreamedTextureDict │ │ │ └── client.lua │ │ ├── requestWeaponAsset │ │ │ └── client.lua │ │ ├── require │ │ │ └── shared.lua │ │ ├── table │ │ │ └── shared.lua │ │ ├── waitFor │ │ │ └── shared.lua │ │ └── zones │ │ │ ├── client.lua │ │ │ └── server.lua │ ├── init.lua │ ├── locales │ │ ├── al.json │ │ ├── cs.json │ │ ├── da.json │ │ ├── de.json │ │ ├── en.json │ │ ├── es.json │ │ ├── et.json │ │ ├── fi.json │ │ ├── fr.json │ │ ├── he.json │ │ ├── hr.json │ │ ├── hu.json │ │ ├── id.json │ │ ├── it.json │ │ ├── lt.json │ │ ├── nl.json │ │ ├── no.json │ │ ├── pl.json │ │ ├── pt-br.json │ │ ├── ru.json │ │ ├── sk.json │ │ ├── sl.json │ │ ├── sv.json │ │ ├── th.json │ │ ├── tr.json │ │ ├── zh-cn.json │ │ └── zh-tw.json │ ├── resource │ │ ├── acl │ │ │ └── server.lua │ │ ├── cache │ │ │ ├── .gitkeep │ │ │ └── client.lua │ │ ├── client.lua │ │ ├── init.lua │ │ ├── interface │ │ │ ├── client │ │ │ │ ├── alert.lua │ │ │ │ ├── clipboard.lua │ │ │ │ ├── context.lua │ │ │ │ ├── input.lua │ │ │ │ ├── main.lua │ │ │ │ ├── menu.lua │ │ │ │ ├── notify.lua │ │ │ │ ├── progress.lua │ │ │ │ ├── radial.lua │ │ │ │ ├── skillcheck.lua │ │ │ │ └── textui.lua │ │ │ └── server │ │ │ │ └── txadmin.lua │ │ ├── locale │ │ │ └── client.lua │ │ ├── shared.lua │ │ ├── vehicleProperties │ │ │ └── client.lua │ │ ├── version │ │ │ ├── server.lua │ │ │ └── shared.lua │ │ └── zoneCreator │ │ │ ├── client.lua │ │ │ └── server.lua │ └── web │ │ └── build │ │ ├── assets │ │ ├── index-281f5198.css │ │ └── index-c23fc323.js │ │ └── index.html └── ox_target │ ├── LICENSE │ ├── README.md │ ├── client │ ├── api.lua │ ├── compat │ │ ├── qb-target.lua │ │ └── qtarget.lua │ ├── debug.lua │ ├── defaults.lua │ ├── framework │ │ ├── esx.lua │ │ ├── ox.lua │ │ └── qb.lua │ ├── main.lua │ ├── state.lua │ └── utils.lua │ ├── fxmanifest.lua │ ├── locales │ ├── cs.json │ ├── da.json │ ├── de.json │ ├── en.json │ ├── es.json │ ├── et.json │ ├── fi.json │ ├── fr.json │ ├── hr.json │ ├── hu.json │ ├── id.json │ ├── nl.json │ ├── pl.json │ ├── sl.json │ ├── zh-cn.json │ └── zh-tw.json │ ├── server │ └── main.lua │ └── web │ ├── index.html │ ├── js │ ├── createOptions.js │ ├── fetchNui.js │ └── main.js │ └── style.css ├── mp-framework.sql ├── oxmysql ├── LICENSE ├── README.md ├── build.js ├── dist │ └── build.js ├── fxmanifest.lua ├── lerna.json ├── lib │ ├── MySQL.lua │ ├── MySQL.ts │ ├── README.md │ ├── define.lua │ ├── package.json │ └── tsconfig.json ├── package.json ├── patches │ ├── mysql2+^3.5.1.patch │ └── named-placeholders+^1.1.3.patch ├── pnpm-lock.yaml ├── src │ ├── config.ts │ ├── database │ │ ├── index.ts │ │ ├── rawExecute.ts │ │ ├── rawQuery.ts │ │ └── rawTransaction.ts │ ├── index.ts │ ├── logger │ │ └── index.ts │ ├── tsconfig.json │ ├── types │ │ └── index.ts │ ├── update │ │ └── index.ts │ └── utils │ │ ├── parseArguments.ts │ │ ├── parseExecute.ts │ │ ├── parseResponse.ts │ │ ├── parseTransaction.ts │ │ ├── scheduleTick.ts │ │ ├── setCallback.ts │ │ └── typeCast.ts ├── ui.lua └── web │ ├── build │ ├── assets │ │ ├── index-5e39ce18.js │ │ └── index-9bba0f49.css │ ├── index.html │ └── vite.svg │ ├── index.html │ ├── package.json │ ├── pnpm-lock.yaml │ ├── postcss.config.cjs │ ├── public │ └── vite.svg │ ├── src │ ├── App.svelte │ ├── index.css │ ├── main.ts │ ├── pages │ │ ├── resource │ │ │ ├── Resource.svelte │ │ │ └── components │ │ │ │ ├── Pagination.svelte │ │ │ │ ├── QueryTable.svelte │ │ │ │ ├── QueryTooltip.svelte │ │ │ │ └── ResourceHeader.svelte │ │ └── root │ │ │ ├── Root.svelte │ │ │ └── components │ │ │ ├── Chart.svelte │ │ │ └── Search.svelte │ ├── store │ │ ├── general.ts │ │ ├── index.ts │ │ └── resource.ts │ ├── utils │ │ ├── debugData.ts │ │ ├── fetchNui.ts │ │ ├── misc.ts │ │ └── useNuiEvent.ts │ └── vite-env.d.ts │ ├── svelte.config.js │ ├── tailwind.config.cjs │ ├── tsconfig.json │ ├── tsconfig.node.json │ └── vite.config.ts └── resources.cfg /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | MP-Commands/node_modules/* 3 | -------------------------------------------------------------------------------- /MP-Banking/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "es2021": true, 5 | "node": true 6 | }, 7 | "extends": [ 8 | "eslint:recommended", 9 | "plugin:react/recommended", 10 | "plugin:@typescript-eslint/recommended", 11 | "plugin:prettier/recommended" 12 | ], 13 | "parser": "@typescript-eslint/parser", 14 | "parserOptions": { 15 | "ecmaFeatures": { 16 | "jsx": true 17 | }, 18 | "ecmaVersion": 12, 19 | "sourceType": "module" 20 | }, 21 | "plugins": [ 22 | "react", "react-hooks", "@typescript-eslint", "prettier" 23 | ], 24 | "settings": { 25 | "import/resolver": { 26 | "typescript": {} 27 | } 28 | }, 29 | "rules": { 30 | "react/react-in-jsx-scope": "off", 31 | "camelcase": "error", 32 | "spaced-comment": "error", 33 | "quotes": ["error", "single"], 34 | "no-duplicate-imports": "error" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /MP-Banking/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "tabWidth": 2, 4 | "printWidth": 100, 5 | "singleQuote": true, 6 | "trailingComma": "all", 7 | "jsxSingleQuote": true, 8 | "bracketSpacing": true 9 | } 10 | -------------------------------------------------------------------------------- /MP-Banking/.yarn.installed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/MP-Banking/.yarn.installed -------------------------------------------------------------------------------- /MP-Banking/README.md: -------------------------------------------------------------------------------- 1 | # FiveM React Typescript Eslint Boilerplate 2 | 3 | Opinionated boilerplate for [FiveM](https://fivem.net/) with [React](https://reactjs.org/) JSX Vite [Typescript](https://www.typescriptlang.org/) Webpack & esbuild [Eslint](https://eslint.org/) [Prettier](https://prettier.io/) using [Lerna](https://lerna.js.org/) and yarn workspaces. 4 | 5 | Includes Eslint and prettier for client server and ui with typechecking. 6 | 7 | ## Requirements 8 | * Brains 9 | * Yarn 10 | * Basic understanding of web development with react and some understanding of FiveM resources. 11 | 12 | ## How to use 13 | 1. Download this repo and extract 14 | 2. Rename folder to something great and innovative 15 | 3. Place folder to your Cfx server resources folder 16 | 4. Add `ensure your_resource_name_here` to your server.cfg 17 | 5. `yarn install` in root of the project 18 | 6. Start making content using commands listed below 19 | 20 | ## Development 21 | 22 | ``yarn watch:web`` Launches web browser with UI. You can also develop in game with this mode. 23 | 24 | ``yarn watch`` Starts watching for changes in client and server. Rebuilds on change. Works also in game. 25 | 26 | ## Building 27 | 28 | ``yarn build`` 29 | 30 | 31 | ## Acknowledgements 32 | 33 | Some utils used are from Project Error. You can read more about the utils at [Project Error react boilerplate](https://github.com/project-error/fivem-react-boilerplate-lua) 34 | -------------------------------------------------------------------------------- /MP-Banking/fxmanifest.lua: -------------------------------------------------------------------------------- 1 | fx_version 'cerulean' 2 | games { 'gta5' } 3 | 4 | author 'Jax & JSP' 5 | description 'Main Power Banking' 6 | version '1.0.0' 7 | 8 | client_script 'packages/resource/dist/client.js' 9 | 10 | server_script 'packages/resource/dist/server.js' 11 | 12 | files { 13 | 'packages/ui/dist/index.html', 14 | 'packages/ui/dist/*', 15 | 'packages/ui/dist/**/*', 16 | 'packages/ui/dist/**/**/*', 17 | } 18 | 19 | ui_page 'packages/ui/dist/index.html' 20 | -------------------------------------------------------------------------------- /MP-Banking/lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "node_modules/lerna/schemas/lerna-schema.json", 3 | "useWorkspaces": true, 4 | "version": "0.0.0" 5 | } 6 | -------------------------------------------------------------------------------- /MP-Banking/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fivem-react-typescript-master", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "license": "MIT", 6 | "private": true, 7 | "workspaces": [ 8 | "packages/*" 9 | ], 10 | "scripts": { 11 | "watch": "lerna run watch --stream --parallel", 12 | "watch:web": "lerna run watch:web --stream --parallel", 13 | "build": "lerna run build --stream --parallel" 14 | }, 15 | "devDependencies": { 16 | "@typescript-eslint/eslint-plugin": "^5.40.1", 17 | "@typescript-eslint/parser": "^5.40.1", 18 | "eslint": "^8.25.0", 19 | "eslint-config-prettier": "^8.5.0", 20 | "eslint-import-resolver-typescript": "^3.5.2", 21 | "eslint-plugin-import": "^2.26.0", 22 | "eslint-plugin-prettier": "^4.2.1", 23 | "eslint-plugin-react": "^7.31.10", 24 | "eslint-plugin-react-hooks": "^4.6.0", 25 | "lerna": "^6.0.1", 26 | "prettier": "^2.7.1" 27 | }, 28 | "dependencies": { 29 | "@citizenfx/client": "^2.0.5963-1", 30 | "@citizenfx/server": "^2.0.5963-1", 31 | "@types/node": "^18.11.2", 32 | "concurrently": "^7.4.0", 33 | "typescript": "^4.8.4" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /MP-Banking/packages/resource/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "resource", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "private": true, 6 | "license": "MIT", 7 | "dependencies": { 8 | "@project-error/pe-utils": "^0.3.0", 9 | "esbuild": "^0.15.13", 10 | "esbuild-plugin-fileloc": "^0.0.6" 11 | }, 12 | "scripts": { 13 | "watch:web": "node scripts/watch.js", 14 | "watch": "node scripts/watch.js", 15 | "build": "node scripts/build.js" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /MP-Banking/packages/resource/scripts/build.js: -------------------------------------------------------------------------------- 1 | const { build } = require('esbuild') 2 | const { filelocPlugin } = require('esbuild-plugin-fileloc') 3 | 4 | build({ 5 | bundle: true, 6 | sourcemap: 'inline', 7 | entryPoints: ['./server/server.ts'], 8 | outfile: './dist/server.js', 9 | platform: 'node', 10 | target: 'node16', 11 | plugins: [filelocPlugin()], 12 | }) 13 | .then(() => console.log('Built server files')) 14 | .catch(() => process.exit(1)) 15 | 16 | build({ 17 | bundle: true, 18 | minify: true, 19 | sourcemap: 'inline', 20 | outfile: './dist/client.js', 21 | entryPoints: ['./client/client.ts'], 22 | platform: 'browser', 23 | }) 24 | .then(() => console.log('Built client files')) 25 | .catch(() => process.exit(1)) 26 | -------------------------------------------------------------------------------- /MP-Banking/packages/resource/scripts/watch.js: -------------------------------------------------------------------------------- 1 | const { build } = require('esbuild') 2 | const { filelocPlugin } = require('esbuild-plugin-fileloc') 3 | 4 | build({ 5 | bundle: true, 6 | sourcemap: 'inline', 7 | watch: true, 8 | entryPoints: ['./server/server.ts'], 9 | outfile: './dist/server.js', 10 | platform: 'node', 11 | target: 'node16', 12 | plugins: [filelocPlugin()], 13 | }) 14 | .then(() => console.log('Built server files')) 15 | .catch(() => process.exit(1)) 16 | 17 | build({ 18 | bundle: true, 19 | minify: false, 20 | sourcemap: 'inline', 21 | watch: true, 22 | outfile: './dist/client.js', 23 | entryPoints: ['./client/client.ts'], 24 | platform: 'browser', 25 | }) 26 | .then(() => console.log('Built client files')) 27 | .catch(() => process.exit(1)) 28 | -------------------------------------------------------------------------------- /MP-Banking/packages/ui/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | *.local 12 | 13 | # Editor directories and files 14 | .vscode/* 15 | !.vscode/extensions.json 16 | .idea 17 | .DS_Store 18 | *.suo 19 | *.ntvs* 20 | *.njsproj 21 | *.sln 22 | *.sw? 23 | -------------------------------------------------------------------------------- /MP-Banking/packages/ui/dist/assets/mp.62a4aa8b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/MP-Banking/packages/ui/dist/assets/mp.62a4aa8b.png -------------------------------------------------------------------------------- /MP-Banking/packages/ui/dist/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MP-Banking 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /MP-Banking/packages/ui/dist/mp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/MP-Banking/packages/ui/dist/mp.png -------------------------------------------------------------------------------- /MP-Banking/packages/ui/dist/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /MP-Banking/packages/ui/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MP-Banking 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /MP-Banking/packages/ui/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ui", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "watch:web": "vite", 8 | "watch": "vite build --watch", 9 | "build": "tsc && vite build", 10 | "preview": "vite preview" 11 | }, 12 | "dependencies": { 13 | "@tanstack/react-query": "^4.12.0", 14 | "react": "^18.2.0", 15 | "react-dom": "^18.2.0" 16 | }, 17 | "devDependencies": { 18 | "@types/react": "^18.0.17", 19 | "@types/react-dom": "^18.0.6", 20 | "@vitejs/plugin-react": "^2.1.0", 21 | "autoprefixer": "^10.4.12", 22 | "postcss": "^8.4.18", 23 | "tailwindcss": "^3.2.0", 24 | "typescript": "^4.6.4", 25 | "vite": "^3.1.0" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /MP-Banking/packages/ui/postcss.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /MP-Banking/packages/ui/public/mp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/MP-Banking/packages/ui/public/mp.png -------------------------------------------------------------------------------- /MP-Banking/packages/ui/public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /MP-Banking/packages/ui/src/main.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom/client' 3 | import App from './App' 4 | import './index.css' 5 | import { QueryClient, QueryClientProvider } from '@tanstack/react-query' 6 | 7 | const queryClient = new QueryClient({ 8 | defaultOptions: { 9 | queries: { 10 | retry: false, 11 | }, 12 | }, 13 | }) 14 | 15 | ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( 16 | 17 | 18 | 19 | 20 | , 21 | ) 22 | -------------------------------------------------------------------------------- /MP-Banking/packages/ui/src/pages/index.ts: -------------------------------------------------------------------------------- 1 | import MPBANKING from "./MPBANKING/MPBANKING"; 2 | 3 | const appPages = { 4 | MPBANKING: MPBANKING, 5 | } 6 | 7 | function generatePageList() { 8 | const pages: { name: string; page: any }[] = [] 9 | Object.keys(appPages).forEach((key) => { 10 | // eslint-disable-next-line @typescript-eslint/ban-ts-comment 11 | // @ts-ignore 12 | pages.push({ name: key, page: appPages[key] }) 13 | }) 14 | return pages 15 | } 16 | 17 | export { appPages, generatePageList } 18 | -------------------------------------------------------------------------------- /MP-Banking/packages/ui/src/utils/exitListener.ts: -------------------------------------------------------------------------------- 1 | import { useEffect, useRef } from 'react' 2 | 3 | const LISTENED_KEYS = ['Escape'] 4 | 5 | export const useExitListener = (callback: any) => { 6 | const setterRef = useRef(() => null) 7 | 8 | useEffect(() => { 9 | // eslint-disable-next-line @typescript-eslint/ban-ts-comment 10 | // @ts-ignore 11 | setterRef.current = callback 12 | }, [callback]) 13 | 14 | useEffect(() => { 15 | const keyHandler = (e: KeyboardEvent) => { 16 | if (LISTENED_KEYS.includes(e.code)) { 17 | setterRef.current() 18 | } 19 | } 20 | 21 | window.addEventListener('keydown', keyHandler) 22 | 23 | return () => window.removeEventListener('keydown', keyHandler) 24 | }, []) 25 | } 26 | -------------------------------------------------------------------------------- /MP-Banking/packages/ui/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /MP-Banking/packages/ui/tailwind.config.cjs: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | content: [ 4 | "./index.html", 5 | "./src/**/*.{js,ts,jsx,tsx}", 6 | ], 7 | theme: { 8 | extend: {}, 9 | }, 10 | plugins: [], 11 | } 12 | -------------------------------------------------------------------------------- /MP-Banking/packages/ui/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ESNext", 4 | "useDefineForClassFields": true, 5 | "lib": ["DOM", "DOM.Iterable", "ESNext"], 6 | "allowJs": false, 7 | "skipLibCheck": true, 8 | "esModuleInterop": false, 9 | "allowSyntheticDefaultImports": true, 10 | "strict": true, 11 | "forceConsistentCasingInFileNames": true, 12 | "module": "ESNext", 13 | "moduleResolution": "Node", 14 | "resolveJsonModule": true, 15 | "isolatedModules": true, 16 | "noEmit": true, 17 | "jsx": "react-jsx" 18 | }, 19 | "include": ["src"], 20 | "references": [{ "path": "./tsconfig.node.json" }] 21 | } 22 | -------------------------------------------------------------------------------- /MP-Banking/packages/ui/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "module": "ESNext", 5 | "moduleResolution": "Node", 6 | "allowSyntheticDefaultImports": true 7 | }, 8 | "include": ["vite.config.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /MP-Banking/packages/ui/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import react from '@vitejs/plugin-react' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()], 7 | base: './', 8 | }) 9 | -------------------------------------------------------------------------------- /MP-Banking/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "noImplicitAny": true, 4 | "module": "ES2022", 5 | "target": "ES2022", 6 | "allowJs": false, 7 | "lib": ["ES2021", "DOM"], 8 | "types": ["@citizenfx/server", "@citizenfx/client", "@types/node"], 9 | "moduleResolution": "node", 10 | "resolveJsonModule": true, 11 | "esModuleInterop": true 12 | }, 13 | "include": ["./**/*"], 14 | "exclude": ["node_modules", "**/__tests__/*"], 15 | "semi": [true,"always"] 16 | } 17 | -------------------------------------------------------------------------------- /MP-Base/admin/sv_admin.lua: -------------------------------------------------------------------------------- 1 | RegisterServerEvent('MP-Admin:RemovePlayer') 2 | AddEventHandler('MP-Admin:RemovePlayer', function(playerId, reason) 3 | DropPlayer(playerId, reason) 4 | end) 5 | 6 | RegisterServerEvent('MP-Admin:SaveCoords') 7 | AddEventHandler('MP-Admin:SaveCoords', function(blank, x, y, z) 8 | file = io.open('coords.txt', 'a') 9 | if file then 10 | file:write('[' .. blank .. ']' .. ' = ' .. x .. ',' .. y .. ',' .. z .. '') 11 | -- [1] = x,y,z 12 | end 13 | file:close() 14 | end) 15 | 16 | RegisterServerEvent('MP-Admin:DeleteCoords') 17 | AddEventHandler('MP-Admin:DeleteCoords', function() 18 | os.remove('coords.txt') 19 | end) -------------------------------------------------------------------------------- /MP-Base/base.sql: -------------------------------------------------------------------------------- 1 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 2 | START TRANSACTION; 3 | SET time_zone = "+00:00"; 4 | 5 | CREATE DATABASE IF NOT EXISTS `mp-framework` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; 6 | USE `mp-framework`; 7 | 8 | CREATE TABLE `players` ( 9 | `id` int(50) NOT NULL, 10 | `identifier` varchar(50) DEFAULT NULL, 11 | `license` varchar(50) DEFAULT NULL, 12 | `name` varchar(50) DEFAULT NULL, 13 | `cid` int(11) DEFAULT NULL, 14 | `cash` int(11) DEFAULT NULL, 15 | `bank` int(11) DEFAULT NULL, 16 | `firstname` varchar(50) DEFAULT NULL, 17 | `lastname` varchar(50) DEFAULT NULL, 18 | `sex` varchar(50) DEFAULT NULL, 19 | `dob` varchar(50) DEFAULT NULL, 20 | `job` varchar(50) DEFAULT 'unemployed', 21 | `phone` text DEFAULT NULL, 22 | `citizenid` varchar(200) DEFAULT NULL, 23 | `new` boolean DEFAULT true 24 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 25 | 26 | CREATE TABLE `ranking` ( 27 | `identifier` varchar(40) DEFAULT NULL, 28 | `usergroup` varchar(40) DEFAULT NULL 29 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; 30 | 31 | ALTER TABLE `players` 32 | ADD PRIMARY KEY (`id`); 33 | 34 | ALTER TABLE `ranking` 35 | ADD PRIMARY KEY (`identifier`); 36 | 37 | ALTER TABLE `players` 38 | MODIFY `id` int(50) NOT NULL AUTO_INCREMENT; 39 | COMMIT; -------------------------------------------------------------------------------- /MP-Base/core/cl_core.lua: -------------------------------------------------------------------------------- 1 | function MP.Base.Start(self) 2 | Citizen.CreateThread(function() 3 | while true do 4 | if NetworkIsSessionStarted() then 5 | TriggerEvent('MP-Base:Start') 6 | TriggerServerEvent('MP-Base:ServerStart') 7 | TriggerEvent("MP-Base:PlayerLoaded") 8 | break 9 | end 10 | end 11 | end) 12 | end 13 | MP.Base.Start(self) 14 | 15 | 16 | exports('GetObject', function() 17 | return MP 18 | end) 19 | -- local MP = exports['MP-Base']:GetObject() 20 | 21 | -- ADMIN 22 | 23 | exports('updateGroup', function(group) 24 | MP.PlayerData.UserGroups = group 25 | end) 26 | 27 | 28 | RegisterNetEvent("MP-Admin:updateGroup") 29 | AddEventHandler("MP-Admin:updateGroup", function(group) 30 | MP.PlayerData.UserGroups = group 31 | end) 32 | 33 | 34 | CreateThread(function() 35 | while true do 36 | local sleep = 0 37 | if LocalPlayer.state.LoggedIn then 38 | sleep = (1000 * 60) * MP.CharacterSaving 39 | -- print("saving character?") 40 | TriggerServerEvent('MP:UpdatePlayer') 41 | end 42 | Wait(sleep) 43 | end 44 | end) 45 | 46 | -------------------------------------------------------------------------------- /MP-Base/core/sv_core.lua: -------------------------------------------------------------------------------- 1 | RegisterServerEvent('MP-Base:ServerStart') 2 | AddEventHandler('MP-Base:ServerStart', function() 3 | local civ = source 4 | CreateThread(function() 5 | local Identifier = GetPlayerIdentifiers(civ)[1] -- This gets Steam:192913931 6 | if not Identifier then 7 | DropPlayer(Civ, "Identifier Not Located") -- Removes player if not found. 8 | end 9 | return 10 | end) 11 | end) 12 | 13 | -- CHANGE TO EXPORT will edit for typescript later 14 | -- RegisterNetEvent('MP-Base:server:getObject') 15 | -- AddEventHandler('MP-Base:server:getObject', function(callback) 16 | -- callback(MP) 17 | -- end) 18 | 19 | exports('GetObject', function() 20 | return MP 21 | end) 22 | 23 | -- exports['MP-Base']:changeMoney(source, bankingType, amount, changer) 24 | exports('changeMoney', function(source, bankingType, amount, changer) 25 | local Player = MP.Functions.GetPlayer(source) 26 | if Player ~= nil then 27 | Player.Functions.UpdateMoney(bankingType, amount, changer) 28 | end 29 | end) 30 | 31 | -- Callback Server 32 | RegisterServerEvent('MP-Base:server:triggerServerCallback') 33 | AddEventHandler('MP-Base:server:triggerServerCallback', function(name, requestId, ...) 34 | local civ = source 35 | 36 | MP.Functions.TriggerServerCallback(name, requestId, civ, function(...) 37 | TriggerClientEvent('MP-Base:client:serverCallback', civ, requestId, ...) 38 | end, ...) 39 | end) -------------------------------------------------------------------------------- /MP-Base/fxmanifest.lua: -------------------------------------------------------------------------------- 1 | 2 | fx_version 'adamant' 3 | game 'gta5' 4 | 5 | 6 | dependency 'oxmysql' 7 | 8 | author 'JSP' 9 | 10 | ui_page 'html/index.html' 11 | 12 | client_scripts{ 13 | "shared/shared.lua", 14 | "events/cl_events.lua", 15 | "gameplay/gameplay.lua", 16 | "core/cl_core.lua", 17 | "admin/cl_admin.lua", 18 | "character/cl_char.lua", 19 | } 20 | 21 | server_script '@oxmysql/lib/MySQL.lua' 22 | 23 | server_scripts{ 24 | "shared/shared.lua", 25 | "events/sv_events.lua", 26 | "character/db_char.lua", 27 | "character/sv_char.lua", 28 | "core/sv_core.lua", 29 | "admin/sv_admin.lua", 30 | "player/player.lua", 31 | } 32 | 33 | files{ 34 | "html/img/background.png", 35 | "html/img/logo.png", 36 | "html/main.css", 37 | "html/index.html", 38 | "html/app.js", 39 | } 40 | -------------------------------------------------------------------------------- /MP-Base/gameplay/gameplay.lua: -------------------------------------------------------------------------------- 1 | local function StartingRoleplay() 2 | 3 | CreateThread(function() 4 | for i = 1, 25 do 5 | EnableDispatchService(i,false) -- ty tuggummi for noticing error 6 | end 7 | 8 | for i = 0, 255 do 9 | if NetworkIsPlayerConnected(i) then 10 | if NetworkIsPlayerConnected(i) and GetPlayerPed(i) ~= nil then 11 | SetCanAttackFriendly(GetPlayerPed(i), true, true) 12 | end 13 | end 14 | end 15 | end) 16 | 17 | CreateThread(function() 18 | while true do 19 | Wait(1000) 20 | local Player = PlayerId() 21 | SetPlayerWantedLevel(Player, 0 , false) 22 | SetPlayerWantedLevelNow(Player, false) 23 | end 24 | end) 25 | 26 | CreateThread(function() 27 | while true do 28 | Wait(1000) 29 | local pos = GetEntityCoords(PlayerPedId(), false) 30 | local dist = GetDistanceBetweenCoords(GetEntityCoords(GetPlayerPed(-1)), 2729.47, 1514.56, 23.7, false) 31 | if dist > 150.0 then 32 | ClearAreaOfCops(pos, 400.0) 33 | else 34 | Wait(5000) 35 | end 36 | end 37 | end) 38 | 39 | 40 | CreateThread(function() 41 | while true do 42 | Wait(0) 43 | 44 | -- should hide area/street bottom right 45 | for i=1, 22 , 1 do 46 | HideHudComponentThisFrame(i) 47 | end 48 | end 49 | end) 50 | end 51 | 52 | AddEventHandler('MP-Base:Start', function() 53 | StartingRoleplay() 54 | end) 55 | -------------------------------------------------------------------------------- /MP-Base/html/img/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/MP-Base/html/img/background.png -------------------------------------------------------------------------------- /MP-Base/html/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/MP-Base/html/img/logo.png -------------------------------------------------------------------------------- /MP-Commands/.yarn.installed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/MP-Commands/.yarn.installed -------------------------------------------------------------------------------- /MP-Commands/README.md: -------------------------------------------------------------------------------- 1 | # FiveM-TypeScript 2 | easy to use just type 3 | ## npm i 4 | this will install everything needed for fivem coding. 5 | 6 | ## installs 7 | 8 | npm i = installs all profiles for package and fivem 9 | 10 | ## builds 11 | 12 | npm run build = for production. 13 | 14 | npm run watch = for dev instant updates. 15 | -------------------------------------------------------------------------------- /MP-Commands/build/server/commands.js: -------------------------------------------------------------------------------- 1 | "use strict";(()=>{var a=global.exports["MP-Base"].GetObject(),l=[{name:"ooc",suggestion:"talk out of game character",isAdmin:!1,handler:(n,t)=>{let e=t.join(" "),o=a.Functions.GetPlayer(n),s=o.Data.PlayerId,r=o.Data.firstname,i=o.Data.lastname,c=`|${s}| ${r} ${i} `;emitNet("chatMessage",-1,`OOC: ${c} `,2,e)}},{name:"giveMoney",suggestion:"Give money to player id, cash/bank, amount, add/del",isAdmin:!0,handler:(n,t)=>{let e=parseInt(t[0]),o=GetPlayerPed(e.toString()),s=a.Functions.GetPlayer(e),r=t[1],i=parseInt(t[2]),c=t[3];s!==null?global.exports["MP-Base"].changeMoney(e,r,i,c):emitNet("MP-Elements:SendNotification",n,2,"No Player Found.")}},{name:"saveCoords",suggestion:"save coords for admins",isAdmin:!0,handler:(n,t)=>{let e=n;global.exports["MP-Base"].AdminSaveCoords(e)}},{name:"console",suggestion:"used for rcon",isAdmin:!0,handler:(n,t)=>{let e=t.join(" ");emitNet("chatMessage",-1,`CONSOLE: ${e}`,3)}},{name:"setgroup",suggestion:"used for rcon",isAdmin:!0,handler:(n,t)=>{let e=parseInt(t[0]),o=t[1],s=a.Functions.GetPlayer(e);e!==null&&(s?a.UserGroups[o]?(a.Functions.setGroup(s,o),emitNet("MP-Elements:SendNotification",e,1,`Set Group Correctly to ${o}`)):emitNet("MP-Elements:SendNotification",n,2,"Incorrect Group"):emitNet("MP-Elements:SendNotification",n,2,"No Player Found."))}}];})(); 2 | -------------------------------------------------------------------------------- /MP-Commands/build/server/server.js: -------------------------------------------------------------------------------- 1 | "use strict";(()=>{var a=global.exports["MP-Base"].GetObject(),c=[{name:"ooc",suggestion:"talk out of game character",isAdmin:!1,handler:(n,e)=>{let t=e.join(" "),o=a.Functions.GetPlayer(n),s=o.Data.PlayerId,r=o.Data.firstname,i=o.Data.lastname,m=`|${s}| ${r} ${i} `;emitNet("chatMessage",-1,`OOC: ${m} `,2,t)}},{name:"giveMoney",suggestion:"Give money to player id, cash/bank, amount, add/del",isAdmin:!0,handler:(n,e)=>{let t=parseInt(e[0]),o=GetPlayerPed(t.toString()),s=a.Functions.GetPlayer(t),r=e[1],i=parseInt(e[2]),m=e[3];s!==null?global.exports["MP-Base"].changeMoney(t,r,i,m):emitNet("MP-Elements:SendNotification",n,2,"No Player Found.")}},{name:"saveCoords",suggestion:"save coords for admins",isAdmin:!0,handler:(n,e)=>{let t=n;global.exports["MP-Base"].AdminSaveCoords(t)}},{name:"console",suggestion:"used for rcon",isAdmin:!0,handler:(n,e)=>{let t=e.join(" ");emitNet("chatMessage",-1,`CONSOLE: ${t}`,3)}},{name:"setgroup",suggestion:"used for rcon",isAdmin:!0,handler:(n,e)=>{let t=parseInt(e[0]),o=e[1],s=a.Functions.GetPlayer(t);t!==null&&(s?a.UserGroups[o]?(a.Functions.setGroup(s,o),emitNet("MP-Elements:SendNotification",t,1,`Set Group Correctly to ${o}`)):emitNet("MP-Elements:SendNotification",n,2,"Incorrect Group"):emitNet("MP-Elements:SendNotification",n,2,"No Player Found."))}}];var g=global.exports["MP-Base"].GetObject();function l(){for(let n of c)RegisterCommand(n.name,(e,t)=>{n.isAdmin&&IsPlayerAceAllowed(e.toString(),"group.admin")?emitNet("chat:addMessage",e,{args:["^1Error","You do not have permission to use this command."]}):n.handler(e,t)},!1)}l();on("playerConnecting",()=>{l()});})(); 2 | -------------------------------------------------------------------------------- /MP-Commands/fxmanifest.lua: -------------------------------------------------------------------------------- 1 | fx_version 'cerulean' 2 | game 'gta5' 3 | 4 | author 'JSP' 5 | 6 | 7 | server_scripts { 8 | 'build/commands.js', 9 | 'build/server.js', 10 | } -------------------------------------------------------------------------------- /MP-Commands/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "name", 3 | "version": "1.0.0", 4 | "description": "", 5 | "scripts": { 6 | "build": "node ./prod.build.js", 7 | "watch": "esbuild --watch --bundle --minify --platform=browser --target=es2020 --outdir=build ./server/*.ts" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "devDependencies": { 13 | "@citizenfx/client": "^2.0.6947-1", 14 | "@citizenfx/server": "^2.0.6947-1", 15 | "@types/node": "^20.8.9", 16 | "esbuild": "^0.19.5", 17 | "typescript": "^5.2.2" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /MP-Commands/prod.build.js: -------------------------------------------------------------------------------- 1 | const { resolve } = require("path"); 2 | const buildPath = resolve(__dirname, "build"); 3 | 4 | const { build } = require("esbuild"); 5 | 6 | build({ 7 | entryPoints: ["./server/*.ts"], 8 | outdir: resolve(buildPath), 9 | bundle: true, 10 | minify: true, 11 | platform: "browser", 12 | target: "es2020", 13 | logLevel: "info", 14 | }).catch(() => process.exit(1)); 15 | -------------------------------------------------------------------------------- /MP-Commands/server/server.ts: -------------------------------------------------------------------------------- 1 | import { commands } from './commands'; // Adjust the path to the actual location of the commands.ts file 2 | // const Delay = (time: number) => new Promise(resolve => setTimeout(resolve, time)); 3 | const MP = global.exports["MP-Base"].GetObject(); 4 | 5 | function registerCommands() { 6 | for (const command of commands) { 7 | RegisterCommand( 8 | command.name, 9 | (source: number, args: string[]) => { 10 | // change to ace perms 11 | if (command.isAdmin && IsPlayerAceAllowed(source.toString(), "group.admin")) { 12 | // Handle unauthorized access to admin command here 13 | emitNet('chat:addMessage', source, { args: ['^1Error', 'You do not have permission to use this command.'] }); 14 | } else { 15 | command.handler(source, args); 16 | } 17 | }, 18 | false 19 | ); 20 | emitNet("chat:addSuggestion", -1, `/${command.name}`, command.suggestion) 21 | } 22 | } 23 | 24 | 25 | registerCommands(); 26 | 27 | on('playerConnecting', () => { 28 | registerCommands(); // Call the function to register commands 29 | }); -------------------------------------------------------------------------------- /MP-Commands/server/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2020", 4 | "strict": true, 5 | "esModuleInterop": true, 6 | "allowSyntheticDefaultImports": true, 7 | "resolveJsonModule": true, 8 | "module": "CommonJS", 9 | "types": ["@citizenfx/server", "@types/node"], 10 | "lib": ["ES2020"] 11 | }, 12 | "include": ["./**/*"], 13 | "exclude": ["**/node_modules", "**/__tests__/*"] 14 | } -------------------------------------------------------------------------------- /MP-Elements/fxmanifest.lua: -------------------------------------------------------------------------------- 1 | fx_version 'adamant' 2 | 3 | game 'gta5' 4 | 5 | ui_page 'html/index.html' 6 | 7 | author 'JSP' 8 | 9 | client_scripts { 10 | 'client/cl_ui.lua', 11 | } 12 | 13 | server_scripts { 14 | '@oxmysql/lib/MySQL.lua', 15 | 'server/sv_ui.lua' 16 | } 17 | 18 | files { 19 | 'html/index.html', 20 | 'html/scripts.js', 21 | 'html/style.css', 22 | } -------------------------------------------------------------------------------- /MP-Elements/html/drawtext.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/MP-Elements/html/drawtext.js -------------------------------------------------------------------------------- /MP-Elements/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 | 15 | 16 |
17 |
18 |
19 |
20 | t 21 |
22 |
23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /MP-Elements/readme.md: -------------------------------------------------------------------------------- 1 | exports['MP-Elements']:Noti(clr, msg, time) -------------------------------------------------------------------------------- /MP-Loading/bankgothic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/MP-Loading/bankgothic.ttf -------------------------------------------------------------------------------- /MP-Loading/fxmanifest.lua: -------------------------------------------------------------------------------- 1 | -- This resource is part of the default Cfx.re asset pack (cfx-server-data) 2 | -- Altering or recreating for local use only is strongly discouraged. 3 | 4 | version '1.0.0' 5 | author 'Cfx.re ' 6 | 7 | files { 8 | 'index.html', 9 | 'style.css', 10 | 'loading.png', 11 | } 12 | 13 | loadscreen 'index.html' 14 | 15 | fx_version 'bodacious' 16 | game 'gta5' -------------------------------------------------------------------------------- /MP-Loading/loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/MP-Loading/loading.png -------------------------------------------------------------------------------- /MP-Logs/client/cl_discord.lua: -------------------------------------------------------------------------------- 1 | Citizen.CreateThread(function() 2 | while true do 3 | SetDiscordAppId(MP.Discord.idBot) 4 | SetDiscordRichPresenceAsset(MP.Discord.AssetImage) 5 | SetDiscordRichPresenceAssetText(MP.Discord.AssetText) 6 | SetDiscordRichPresenceAssetSmall(MP.Discord.SmallAssetImg) 7 | SetDiscordRichPresenceAssetSmallText(MP.Discord.SmallAssetText) 8 | if MP.Discord.ButtonActive then 9 | SetDiscordRichPresenceAction(0, MP.Discord.ActionButtonName1, MP.Discord.AssetDescriptionName1) 10 | end 11 | Wait(MP.Discord.Wait) 12 | end 13 | end) 14 | 15 | 16 | -- exports['MP-Logs']:sendTODiscord(log,name,message,color) 17 | 18 | exports('sendToDiscord', function(log, name, message,color) 19 | TriggerServerEvent('MP-Logs:Server:Send', log, name, message,color) 20 | end) -------------------------------------------------------------------------------- /MP-Logs/config.lua: -------------------------------------------------------------------------------- 1 | MP = {} 2 | 3 | MP.Discord = { 4 | Wait = 15000, 5 | CheckWait = 10000, 6 | SlotFiveM = '32', 7 | idBot = 1151705282519498893, 8 | AssetImage = 'imagelarge', 9 | AssetText = 'Main-Power Framework', 10 | SmallAssetImg = 'smallimgage', 11 | SmallAssetText = 'brought to you by: xmplfy', 12 | ButtonActive = true, 13 | ActionButtonName1 = 'Main Power - Discord', 14 | AssetDescriptionName1 = 'https://discord.gg/3zTZpjMVFN', 15 | } -------------------------------------------------------------------------------- /MP-Logs/fxmanifest.lua: -------------------------------------------------------------------------------- 1 | 2 | fx_version 'adamant' 3 | game 'gta5' 4 | 5 | 6 | dependency 'oxmysql' 7 | 8 | author 'JSP' 9 | 10 | server_script '@oxmysql/lib/MySQL.lua' 11 | server_scripts { 12 | "config.lua", 13 | "server/sv_logs.lua", 14 | } 15 | 16 | client_scripts{ 17 | "config.lua", 18 | "client/cl_discord.lua", 19 | -- "client/cl_logDeath.lua", 20 | } -------------------------------------------------------------------------------- /MP-Spawn/fxmanifest.lua: -------------------------------------------------------------------------------- 1 | fx_version "adamant" 2 | games { "gta5" } 3 | 4 | ui_page "html/index.html" 5 | 6 | files { 7 | 'html/index.html', 8 | 'html/scripts.js', 9 | 'html/style.css', 10 | 'html/spawnmenu.png' 11 | } 12 | 13 | client_scripts { 14 | 'client/cl_spawn.lua' 15 | } -------------------------------------------------------------------------------- /MP-Spawn/html/spawnmenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/MP-Spawn/html/spawnmenu.png -------------------------------------------------------------------------------- /MP-Weather/fxmanifest.lua: -------------------------------------------------------------------------------- 1 | fx_version "adamant" 2 | games { "gta5" } 3 | 4 | 5 | client_scripts { 6 | 'client/cl_weather.lua' 7 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MainPower 2 | All Main Power Files for fivem framework 3 | # Discord 4 | For Support: https://discord.gg/wf5emKqqvc 5 | For Server: https://mainpower.net 6 | 7 | 8 | ### More Info 9 | [Coming Soon. ](https://mainpower.net) 10 | 11 | 12 | # Server CFG 13 | type exec resources.cfg 14 | then use resources.cfg file inside of this 15 | make sure you also use the mapmanger which fixes our awaiting scripts error. 16 | -------------------------------------------------------------------------------- /[Port-Scripts]/qb-clothing/fxmanifest.lua: -------------------------------------------------------------------------------- 1 | fx_version 'cerulean' 2 | game 'gta5' 3 | 4 | description 'QB-Clothing' 5 | 6 | ui_page 'html/index.html' 7 | 8 | shared_script 'config.lua' 9 | 10 | shared_scripts { 11 | '@ox_lib/init.lua', 12 | } 13 | 14 | server_scripts { 15 | '@oxmysql/lib/MySQL.lua', 16 | 'server/main.lua' 17 | } 18 | 19 | client_scripts { 20 | '@PolyZone/client.lua', 21 | '@PolyZone/BoxZone.lua', 22 | '@PolyZone/ComboZone.lua', 23 | 'client/main.lua' 24 | } 25 | files { 26 | 'html/index.html', 27 | 'html/style.css', 28 | 'html/reset.css', 29 | 'html/script.js', 30 | 'html/image.png', 31 | } 32 | 33 | lua54 'yes' 34 | -------------------------------------------------------------------------------- /[Port-Scripts]/qb-clothing/html/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[Port-Scripts]/qb-clothing/html/image.png -------------------------------------------------------------------------------- /[Port-Scripts]/qb-clothing/html/reset.css: -------------------------------------------------------------------------------- 1 | html, body, div, span, applet, object, iframe, 2 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 3 | a, abbr, acronym, address, big, cite, code, 4 | del, dfn, em, img, ins, kbd, q, s, samp, 5 | small, strike, strong, sub, sup, tt, var, 6 | b, u, i, center, 7 | dl, dt, dd, ol, ul, li, 8 | fieldset, form, label, legend, 9 | table, caption, tbody, tfoot, thead, tr, th, td, 10 | article, aside, canvas, details, embed, 11 | figure, figcaption, footer, header, hgroup, 12 | menu, nav, output, ruby, section, summary, 13 | time, mark, audio, video { 14 | margin: 0; 15 | padding: 0; 16 | border: 0; 17 | font-size: 100%; 18 | vertical-align: baseline; 19 | font-family: 'Poppins', sans-serif; 20 | overflow: hidden; 21 | font-weight:900; 22 | } 23 | /* HTML5 display-role reset for older browsers */ 24 | article, aside, details, figcaption, figure, 25 | footer, header, hgroup, menu, nav, section { 26 | display: block; 27 | } 28 | body { 29 | line-height: 1; 30 | user-select: none; 31 | } 32 | ol, ul { 33 | list-style: none; 34 | } 35 | blockquote, q { 36 | quotes: none; 37 | } 38 | blockquote:before, blockquote:after, 39 | q:before, q:after { 40 | content: ''; 41 | content: none; 42 | } 43 | table { 44 | border-collapse: collapse; 45 | border-spacing: 0; 46 | } -------------------------------------------------------------------------------- /[Port-Scripts]/qb-clothing/qb-clothing.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `playerskins` ( 2 | `id` int(11) NOT NULL AUTO_INCREMENT, 3 | `citizenid` varchar(255) NOT NULL, 4 | `model` varchar(255) NOT NULL, 5 | `skin` text NOT NULL, 6 | `active` tinyint(2) NOT NULL DEFAULT 1, 7 | PRIMARY KEY (`id`), 8 | KEY `citizenid` (`citizenid`), 9 | KEY `active` (`active`) 10 | ) ENGINE=InnoDB AUTO_INCREMENT=43010 DEFAULT CHARSET=latin1; 11 | 12 | CREATE TABLE IF NOT EXISTS `player_outfits` ( 13 | `id` int(11) NOT NULL AUTO_INCREMENT, 14 | `citizenid` varchar(50) DEFAULT NULL, 15 | `outfitname` varchar(50) NOT NULL, 16 | `model` varchar(50) DEFAULT NULL, 17 | `skin` text DEFAULT NULL, 18 | `outfitId` varchar(50) NOT NULL, 19 | PRIMARY KEY (`id`), 20 | KEY `citizenid` (`citizenid`), 21 | KEY `outfitId` (`outfitId`) 22 | ) ENGINE=InnoDB AUTO_INCREMENT=8970 DEFAULT CHARSET=utf8mb4; -------------------------------------------------------------------------------- /[managers]/mapmanager/fxmanifest.lua: -------------------------------------------------------------------------------- 1 | -- This resource is part of the default Cfx.re asset pack (cfx-server-data) 2 | -- Altering or recreating for local use only is strongly discouraged. 3 | 4 | version '1.0.0' 5 | author 'Cfx.re ' 6 | description 'A flexible handler for game type/map association.' 7 | repository 'https://github.com/citizenfx/cfx-server-data' 8 | resource_type 'gametype' { name = 'Freeroam' } 9 | client_scripts { 10 | "mapmanager_shared.lua", 11 | "mapmanager_client.lua" 12 | } 13 | 14 | server_scripts { 15 | "mapmanager_shared.lua", 16 | "mapmanager_server.lua" 17 | } 18 | 19 | fx_version 'adamant' 20 | games { 'gta5', 'rdr3' } 21 | 22 | server_export "getCurrentGameType" 23 | server_export "getCurrentMap" 24 | server_export "changeGameType" 25 | server_export "changeMap" 26 | server_export "doesMapSupportGameType" 27 | server_export "getMaps" 28 | server_export "roundEnded" 29 | 30 | rdr3_warning 'I acknowledge that this is a prerelease build of RedM, and I am aware my resources *will* become incompatible once RedM ships.' 31 | -------------------------------------------------------------------------------- /[ox]/ox_inventory/data/animations.lua: -------------------------------------------------------------------------------- 1 | return { 2 | anim = { 3 | ['eating'] = { dict = 'mp_player_inteat@burger', clip = 'mp_player_int_eat_burger_fp' }, 4 | }, 5 | prop = { 6 | ['burger'] = { model = `prop_cs_burger_01`, pos = vec3(0.02, 0.02, -0.02), rot = vec3(0.0, 0.0, 0.0) }, 7 | } 8 | } -------------------------------------------------------------------------------- /[ox]/ox_inventory/data/crafting.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | items = { 4 | { 5 | name = 'lockpick', 6 | ingredients = { 7 | scrapmetal = 5, 8 | WEAPON_HAMMER = 0.05 9 | }, 10 | duration = 5000, 11 | count = 2, 12 | }, 13 | }, 14 | points = { 15 | vec3(-1147.083008, -2002.662109, 13.180260), 16 | vec3(-345.374969, -130.687088, 39.009613) 17 | }, 18 | zones = { 19 | { 20 | coords = vec3(-1146.2, -2002.05, 13.2), 21 | size = vec3(3.8, 1.05, 0.15), 22 | distance = 1.5, 23 | rotation = 315.0, 24 | }, 25 | { 26 | coords = vec3(-346.1, -130.45, 39.0), 27 | size = vec3(3.8, 1.05, 0.15), 28 | distance = 1.5, 29 | rotation = 70.0, 30 | }, 31 | }, 32 | blip = { id = 566, colour = 31, scale = 0.8 }, 33 | }, 34 | } 35 | -------------------------------------------------------------------------------- /[ox]/ox_inventory/data/evidence.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | coords = vec3(458.97, -982.79, 30.68), 4 | target = { -- qtarget support 5 | name = 'mrpd_evidence', -- name of zone must be uniuqe 6 | loc = vec3(459.07, -984.07, 30.69), 7 | length = 1.4, 8 | width = 3.2, 9 | heading = 0, 10 | minZ = 29.09, 11 | maxZ = 31.89 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /[ox]/ox_inventory/data/licenses.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { name = 'weapon', coords = vec3(12.42198, -1105.82, 29.7854), price = 5000 } 3 | } -------------------------------------------------------------------------------- /[ox]/ox_inventory/data/stashes.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | coords = vec3(452.3, -991.4, 30.7), 4 | target = { 5 | loc = vec3(451.25, -994.28, 30.69), 6 | length = 1.2, 7 | width = 5.6, 8 | heading = 0, 9 | minZ = 29.49, 10 | maxZ = 32.09, 11 | label = 'Open personal locker' 12 | }, 13 | name = 'policelocker', 14 | label = 'Personal locker', 15 | owner = true, 16 | slots = 70, 17 | weight = 70000, 18 | groups = shared.police 19 | }, 20 | 21 | { 22 | coords = vec3(301.3, -600.23, 43.28), 23 | target = { 24 | loc = vec3(301.82, -600.99, 43.29), 25 | length = 0.6, 26 | width = 1.8, 27 | heading = 340, 28 | minZ = 43.34, 29 | maxZ = 44.74, 30 | label = 'Open personal locker' 31 | }, 32 | name = 'emslocker', 33 | label = 'Personal Locker', 34 | owner = true, 35 | slots = 70, 36 | weight = 70000, 37 | groups = {['ambulance'] = 0} 38 | }, 39 | } 40 | -------------------------------------------------------------------------------- /[ox]/ox_inventory/fxmanifest.lua: -------------------------------------------------------------------------------- 1 | fx_version 'cerulean' 2 | use_experimental_fxv2_oal 'yes' 3 | lua54 'yes' 4 | game 'gta5' 5 | name 'ox_inventory' 6 | author 'Overextended' 7 | version '2.34.2' 8 | repository 'https://github.com/overextended/ox_inventory' 9 | description 'Slot-based inventory with item metadata support' 10 | 11 | dependencies { 12 | -- '/server:6116', 13 | '/onesync', 14 | 'oxmysql', 15 | 'ox_lib', 16 | } 17 | 18 | shared_script '@ox_lib/init.lua' 19 | 20 | ox_libs { 21 | 'locale', 22 | 'table', 23 | 'math', 24 | } 25 | 26 | server_scripts { 27 | '@oxmysql/lib/MySQL.lua', 28 | 'init.lua' 29 | } 30 | 31 | client_script 'init.lua' 32 | 33 | ui_page 'web/build/index.html' 34 | 35 | files { 36 | 'client.lua', 37 | 'server.lua', 38 | 'locales/*.json', 39 | 'web/build/index.html', 40 | 'web/build/assets/*.js', 41 | 'web/build/assets/*.css', 42 | 'web/images/*.png', 43 | 'modules/**/shared.lua', 44 | 'modules/**/client.lua', 45 | 'modules/bridge/**/client.lua', 46 | 'data/*.lua', 47 | } 48 | -------------------------------------------------------------------------------- /[ox]/ox_inventory/modules/interface/client.lua: -------------------------------------------------------------------------------- 1 | if not lib then return end 2 | 3 | -- Module is deprecated and provided for compatibility 4 | -- All functions are now part of with ox_lib 5 | 6 | exports('Keyboard', lib.inputDialog) 7 | 8 | exports('Progress', function(options, completed) 9 | local success = lib.progressBar(options) 10 | 11 | if completed then 12 | completed(not success) 13 | end 14 | end) 15 | 16 | exports('CancelProgress', lib.cancelProgress) 17 | exports('ProgressActive', lib.progressActive) 18 | -------------------------------------------------------------------------------- /[ox]/ox_inventory/modules/utils/server.lua: -------------------------------------------------------------------------------- 1 | if not lib then return end 2 | 3 | local Utils = {} 4 | 5 | local webHook = GetConvar('inventory:webhook', '') 6 | 7 | if webHook ~= '' then 8 | local validHosts = { 9 | ['i.imgur.com'] = true, 10 | } 11 | 12 | local validExtensions = { 13 | ['png'] = true, 14 | ['apng'] = true, 15 | ['webp'] = true, 16 | } 17 | 18 | local headers = { ['Content-Type'] = 'application/json' } 19 | 20 | function Utils.IsValidImageUrl(url) 21 | local host, extension = url:match('^https?://([^/]+).+%.([%l]+)') 22 | return host and extension and validHosts[host] and validExtensions[extension] 23 | end 24 | 25 | ---@param title string 26 | ---@param message string 27 | ---@param image string 28 | function Utils.DiscordEmbed(title, message, image, color) 29 | PerformHttpRequest(webHook, function() end, 'POST', json.encode({ 30 | username = 'ox_inventory', embeds = { 31 | { 32 | title = title, 33 | color = color, 34 | footer = { 35 | text = os.date('%c'), 36 | }, 37 | description = message, 38 | thumbnail = { 39 | url = image, 40 | width = 100, 41 | } 42 | } 43 | } 44 | }), headers) 45 | end 46 | end 47 | 48 | return Utils 49 | -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/build/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | NUI React Boilerplate 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/CIGARETTE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/CIGARETTE.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_ADVANCEDRIFLE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_ADVANCEDRIFLE.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_APPISTOL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_APPISTOL.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_ASSAULTRIFLE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_ASSAULTRIFLE.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_ASSAULTRIFLE_MK2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_ASSAULTRIFLE_MK2.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_ASSAULTSHOTGUN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_ASSAULTSHOTGUN.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_ASSAULTSMG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_ASSAULTSMG.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_AUTOSHOTGUN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_AUTOSHOTGUN.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_BALL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_BALL.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_BAT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_BAT.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_BATTLEAXE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_BATTLEAXE.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_BOTTLE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_BOTTLE.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_BULLPUPRIFLE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_BULLPUPRIFLE.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_BULLPUPRIFLE_MK2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_BULLPUPRIFLE_MK2.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_BULLPUPSHOTGUN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_BULLPUPSHOTGUN.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_BZGAS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_BZGAS.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_CANDYCANE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_CANDYCANE.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_CARBINERIFLE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_CARBINERIFLE.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_CARBINERIFLE_MK2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_CARBINERIFLE_MK2.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_CERAMICPISTOL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_CERAMICPISTOL.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_COMBATMG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_COMBATMG.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_COMBATMG_MK2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_COMBATMG_MK2.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_COMBATPDW.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_COMBATPDW.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_COMBATPISTOL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_COMBATPISTOL.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_COMBATSHOTGUN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_COMBATSHOTGUN.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_COMPACTLAUNCHER.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_COMPACTLAUNCHER.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_COMPACTRIFLE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_COMPACTRIFLE.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_CROWBAR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_CROWBAR.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_DBSHOTGUN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_DBSHOTGUN.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_DIGISCANNER.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_DIGISCANNER.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_DOUBLEACTION.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_DOUBLEACTION.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_EMPLAUNCHER.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_EMPLAUNCHER.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_FERTILIZERCAN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_FERTILIZERCAN.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_FIREEXTINGUISHER.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_FIREEXTINGUISHER.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_FIREWORK.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_FIREWORK.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_FLARE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_FLARE.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_FLAREGUN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_FLAREGUN.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_FLASHLIGHT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_FLASHLIGHT.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_GADGETPISTOL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_GADGETPISTOL.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_GOLFCLUB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_GOLFCLUB.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_GRENADE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_GRENADE.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_GRENADELAUNCHER.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_GRENADELAUNCHER.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_GUSENBERG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_GUSENBERG.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_HAMMER.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_HAMMER.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_HATCHET.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_HATCHET.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_HAZARDCAN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_HAZARDCAN.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_HEAVYPISTOL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_HEAVYPISTOL.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_HEAVYRIFLE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_HEAVYRIFLE.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_HEAVYSHOTGUN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_HEAVYSHOTGUN.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_HEAVYSNIPER.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_HEAVYSNIPER.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_HEAVYSNIPER_MK2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_HEAVYSNIPER_MK2.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_HOMINGLAUNCHER.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_HOMINGLAUNCHER.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_KNIFE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_KNIFE.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_KNUCKLE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_KNUCKLE.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_MACHETE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_MACHETE.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_MACHINEPISTOL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_MACHINEPISTOL.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_MARKSMANPISTOL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_MARKSMANPISTOL.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_MARKSMANRIFLE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_MARKSMANRIFLE.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_MARKSMANRIFLE_MK2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_MARKSMANRIFLE_MK2.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_METALDETECTOR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_METALDETECTOR.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_MG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_MG.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_MICROSMG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_MICROSMG.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_MILITARYRIFLE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_MILITARYRIFLE.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_MINIGUN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_MINIGUN.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_MINISMG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_MINISMG.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_MOLOTOV.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_MOLOTOV.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_MUSKET.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_MUSKET.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_NAVYREVOLVER.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_NAVYREVOLVER.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_NIGHTSTICK.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_NIGHTSTICK.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_PETROLCAN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_PETROLCAN.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_PIPEBOMB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_PIPEBOMB.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_PISTOL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_PISTOL.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_PISTOL50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_PISTOL50.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_PISTOLXM3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_PISTOLXM3.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_PISTOL_MK2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_PISTOL_MK2.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_POOLCUE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_POOLCUE.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_PRECISIONRIFLE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_PRECISIONRIFLE.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_PROXMINE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_PROXMINE.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_PUMPSHOTGUN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_PUMPSHOTGUN.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_PUMPSHOTGUN_MK2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_PUMPSHOTGUN_MK2.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_RAILGUN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_RAILGUN.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_RAILGUNXM3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_RAILGUNXM3.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_RAYCARBINE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_RAYCARBINE.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_RAYMINIGUN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_RAYMINIGUN.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_RAYPISTOL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_RAYPISTOL.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_REVOLVER.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_REVOLVER.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_REVOLVER_MK2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_REVOLVER_MK2.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_RPG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_RPG.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_SAWNOFFSHOTGUN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_SAWNOFFSHOTGUN.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_SMG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_SMG.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_SMG_MK2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_SMG_MK2.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_SMOKEGRENADE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_SMOKEGRENADE.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_SNIPERRIFLE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_SNIPERRIFLE.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_SNOWBALL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_SNOWBALL.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_SNSPISTOL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_SNSPISTOL.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_SNSPISTOL_MK2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_SNSPISTOL_MK2.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_SPECIALCARBINE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_SPECIALCARBINE.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_SPECIALCARBINE_MK2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_SPECIALCARBINE_MK2.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_STICKYBOMB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_STICKYBOMB.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_STONE_HATCHET.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_STONE_HATCHET.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_STUNGUN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_STUNGUN.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_SWITCHBLADE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_SWITCHBLADE.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_TACTICALRIFLE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_TACTICALRIFLE.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_TECPISTOL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_TECPISTOL.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_VINTAGEPISTOL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_VINTAGEPISTOL.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/WEAPON_WRENCH.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/WEAPON_WRENCH.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/ammo-9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/ammo-9.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/ammo-musket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/ammo-musket.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/ammo-rifle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/ammo-rifle.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/ammo-rifle2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/ammo-rifle2.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/ammo-shotgun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/ammo-shotgun.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/armour.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/armour.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/at_flashlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/at_flashlight.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/at_flashlight_rifle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/at_flashlight_rifle.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/bandage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/bandage.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/beer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/beer.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/black_money.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/black_money.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/bsfries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/bsfries.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/burger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/burger.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/candy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/candy.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/carokit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/carokit.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/chipscheese.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/chipscheese.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/chipshabanero.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/chipshabanero.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/chipsribs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/chipsribs.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/chipssalt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/chipssalt.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/cocaine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/cocaine.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/cola.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/cola.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/copper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/copper.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/diamond.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/diamond.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/donut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/donut.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/drug_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/drug_blue.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/drug_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/drug_red.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/drug_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/drug_white.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/evidence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/evidence.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/fertilizer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/fertilizer.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/fixkit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/fixkit.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/garbage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/garbage.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/gold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/gold.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/hotdog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/hotdog.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/iron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/iron.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/joint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/joint.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/keys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/keys.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/lockpick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/lockpick.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/medikit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/medikit.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/meth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/meth.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/money.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/money.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/mustard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/mustard.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/necklace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/necklace.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/panties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/panties.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/paperbag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/paperbag.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/parachute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/parachute.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/pepperoni.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/pepperoni.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/phone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/phone.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/radio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/radio.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/ramen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/ramen.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/rolex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/rolex.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/silver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/silver.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/small_armour.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/small_armour.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/taco.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/taco.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/trash_bread.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/trash_bread.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/trash_burgershot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/trash_burgershot.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/trash_can.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/trash_can.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/trash_chips.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/trash_chips.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/trash_coffee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/trash_coffee.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/trash_fags.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/trash_fags.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/trash_newspaper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/trash_newspaper.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/trash_paper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/trash_paper.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/turkey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/turkey.png -------------------------------------------------------------------------------- /[ox]/ox_inventory/web/images/water.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_inventory/web/images/water.png -------------------------------------------------------------------------------- /[ox]/ox_lib/README.md: -------------------------------------------------------------------------------- 1 | # ox_lib 2 | 3 | A FiveM library and resource implementing reusable modules, methods, and UI elements. 4 | 5 | ![](https://img.shields.io/github/downloads/overextended/ox_lib/total?logo=github) 6 | ![](https://img.shields.io/github/downloads/overextended/ox_lib/latest/total?logo=github) 7 | ![](https://img.shields.io/github/contributors/overextended/ox_lib?logo=github) 8 | ![](https://img.shields.io/github/v/release/overextended/ox_lib?logo=github) 9 | 10 | ## 📚 Documentation 11 | 12 | https://overextended.dev/ox_lib 13 | 14 | ## 💾 Download 15 | 16 | https://github.com/overextended/ox_lib/releases/latest/download/ox_lib.zip 17 | 18 | ## npm Package 19 | 20 | https://www.npmjs.com/package/@overextended/ox_lib 21 | 22 | ## Lua Language Server 23 | 24 | - Install [Lua Language Server](https://marketplace.visualstudio.com/items?itemName=sumneko.lua) to ease development with annotations, type checking, diagnostics, and more. 25 | - Install [cfxlua-vscode](https://marketplace.visualstudio.com/items?itemName=overextended.cfxlua-vscode) to add natives and cfxlua runtime declarations to LLS. 26 | - You can load ox_lib into your global development environment by modifying workspace/user settings "Lua.workspace.library" with the resource path. 27 | - e.g. "c:/fxserver/resources/ox_lib" 28 | -------------------------------------------------------------------------------- /[ox]/ox_lib/fxmanifest.lua: -------------------------------------------------------------------------------- 1 | --[[ FX Information ]]-- 2 | fx_version 'cerulean' 3 | use_experimental_fxv2_oal 'yes' 4 | lua54 'yes' 5 | games { 'rdr3', 'gta5' } 6 | rdr3_warning 'I acknowledge that this is a prerelease build of RedM, and I am aware my resources *will* become incompatible once RedM ships.' 7 | 8 | --[[ Resource Information ]]-- 9 | name 'ox_lib' 10 | author 'Overextended' 11 | version '3.9.1' 12 | license 'LGPL-3.0-or-later' 13 | repository 'https://github.com/overextended/ox_lib' 14 | description 'A library of shared functions to utilise in other resources.' 15 | 16 | --[[ Manifest ]]-- 17 | dependencies { 18 | '/server:5848', 19 | '/onesync', 20 | } 21 | 22 | ui_page 'web/build/index.html' 23 | 24 | files { 25 | 'init.lua', 26 | 'imports/**/client.lua', 27 | 'imports/**/shared.lua', 28 | 'web/build/index.html', 29 | 'web/build/**/*', 30 | 'locales/*.json', 31 | } 32 | 33 | shared_script 'resource/init.lua' 34 | 35 | shared_scripts { 36 | 'resource/**/shared.lua', 37 | -- 'resource/**/shared/*.lua' 38 | } 39 | 40 | client_scripts { 41 | 'resource/**/client.lua', 42 | 'resource/**/client/*.lua' 43 | } 44 | 45 | server_scripts { 46 | 'imports/callback/server.lua', 47 | 'resource/**/server.lua', 48 | 'resource/**/server/*.lua', 49 | } 50 | 51 | -------------------------------------------------------------------------------- /[ox]/ox_lib/imports/disableControls/client.lua: -------------------------------------------------------------------------------- 1 | --- Call on frame to disable all stored keys. 2 | --- ``` 3 | --- disableControls() 4 | --- ``` 5 | local disableControls = {} 6 | 7 | ---@param ... number | table 8 | function disableControls:Add(...) 9 | local keys = type(...) == 'table' and ... or {...} 10 | for i=1, #keys do 11 | local key = keys[i] 12 | if self[key] then 13 | self[key] += 1 14 | else 15 | self[key] = 1 16 | end 17 | end 18 | end 19 | 20 | ---@param ... number | table 21 | function disableControls:Remove(...) 22 | local keys = type(...) == 'table' and ... or {...} 23 | for i=1, #keys do 24 | local key = keys[i] 25 | local exists = self[key] 26 | if exists and exists > 1 then 27 | self[key] -= 1 28 | else 29 | self[key] = nil 30 | end 31 | end 32 | end 33 | 34 | ---@param ... number | table 35 | function disableControls:Clear(...) 36 | local keys = type(...) == 'table' and ... or {...} 37 | for i=1, #keys do 38 | self[keys[i]] = nil 39 | end 40 | end 41 | 42 | local keys = {} 43 | local DisableControlAction = DisableControlAction 44 | local pairs = pairs 45 | 46 | lib.disableControls = setmetatable(disableControls, { 47 | __index = keys, 48 | __newindex = keys, 49 | __call = function() 50 | for k in pairs(keys) do 51 | DisableControlAction(0, k, true) 52 | end 53 | end 54 | }) 55 | 56 | return lib.disableControls 57 | -------------------------------------------------------------------------------- /[ox]/ox_lib/imports/getClosestObject/client.lua: -------------------------------------------------------------------------------- 1 | ---@param coords vector3 The coords to check from. 2 | ---@param maxDistance number The max distance to check. 3 | ---@return number? object 4 | ---@return vector3? objectCoords 5 | function lib.getClosestObject(coords, maxDistance) 6 | local objects = GetGamePool('CObject') 7 | local closestObject, closestCoords 8 | maxDistance = maxDistance or 2.0 9 | 10 | for i = 1, #objects do 11 | local object = objects[i] 12 | 13 | local objectCoords = GetEntityCoords(object) 14 | local distance = #(coords - objectCoords) 15 | 16 | if distance < maxDistance then 17 | maxDistance = distance 18 | closestObject = object 19 | closestCoords = objectCoords 20 | end 21 | end 22 | 23 | return closestObject, closestCoords 24 | end 25 | 26 | return lib.getClosestObject 27 | -------------------------------------------------------------------------------- /[ox]/ox_lib/imports/getClosestPed/client.lua: -------------------------------------------------------------------------------- 1 | ---@param coords vector3 The coords to check from. 2 | ---@param maxDistance number The max distance to check. 3 | ---@return number? ped 4 | ---@return vector3? pedCoords 5 | function lib.getClosestPed(coords, maxDistance) 6 | local peds = GetGamePool('CPed') 7 | local closestPed, closestCoords 8 | maxDistance = maxDistance or 2.0 9 | 10 | for i = 1, #peds do 11 | local ped = peds[i] 12 | 13 | if not IsPedAPlayer(ped) then 14 | local pedCoords = GetEntityCoords(ped) 15 | local distance = #(coords - pedCoords) 16 | 17 | if distance < maxDistance then 18 | maxDistance = distance 19 | closestPed = ped 20 | closestCoords = pedCoords 21 | end 22 | end 23 | end 24 | 25 | return closestPed, closestCoords 26 | end 27 | 28 | return lib.getClosestPed 29 | -------------------------------------------------------------------------------- /[ox]/ox_lib/imports/getClosestPlayer/client.lua: -------------------------------------------------------------------------------- 1 | ---@param coords vector3 The coords to check from. 2 | ---@param maxDistance number The max distance to check. 3 | ---@param includePlayer boolean Whether or not to include the current player. 4 | ---@return number? playerId 5 | ---@return number? playerPed 6 | ---@return vector3? playerCoords 7 | function lib.getClosestPlayer(coords, maxDistance, includePlayer) 8 | local players = GetActivePlayers() 9 | local closestId, closestPed, closestCoords 10 | maxDistance = maxDistance or 2.0 11 | 12 | for i = 1, #players do 13 | local playerId = players[i] 14 | 15 | if playerId ~= cache.playerId or includePlayer then 16 | local playerPed = GetPlayerPed(playerId) 17 | local playerCoords = GetEntityCoords(playerPed) 18 | local distance = #(coords - playerCoords) 19 | 20 | if distance < maxDistance then 21 | maxDistance = distance 22 | closestId = playerId 23 | closestPed = playerPed 24 | closestCoords = playerCoords 25 | end 26 | end 27 | end 28 | 29 | return closestId, closestPed, closestCoords 30 | end 31 | 32 | return lib.getClosestPlayer 33 | -------------------------------------------------------------------------------- /[ox]/ox_lib/imports/getClosestVehicle/client.lua: -------------------------------------------------------------------------------- 1 | ---@param coords vector3 The coords to check from. 2 | ---@param maxDistance number The max distance to check. 3 | ---@param includePlayerVehicle boolean Whether or not to include the player's current vehicle. 4 | ---@return number? vehicle 5 | ---@return vector3? vehicleCoords 6 | function lib.getClosestVehicle(coords, maxDistance, includePlayerVehicle) 7 | local vehicles = GetGamePool('CVehicle') 8 | local closestVehicle, closestCoords 9 | maxDistance = maxDistance or 2.0 10 | 11 | for i = 1, #vehicles do 12 | local vehicle = vehicles[i] 13 | 14 | if not cache.vehicle or vehicle ~= cache.vehicle or includePlayerVehicle then 15 | local vehicleCoords = GetEntityCoords(vehicle) 16 | local distance = #(coords - vehicleCoords) 17 | 18 | if distance < maxDistance then 19 | maxDistance = distance 20 | closestVehicle = vehicle 21 | closestCoords = vehicleCoords 22 | end 23 | end 24 | end 25 | 26 | return closestVehicle, closestCoords 27 | end 28 | 29 | return lib.getClosestVehicle 30 | -------------------------------------------------------------------------------- /[ox]/ox_lib/imports/getNearbyObjects/client.lua: -------------------------------------------------------------------------------- 1 | ---@param coords vector3 The coords to check from. 2 | ---@param maxDistance number The max distance to check. 3 | ---@return { object: number, coords: vector3 }[] 4 | function lib.getNearbyObjects(coords, maxDistance) 5 | local objects = GetGamePool('CObject') 6 | local nearby = {} 7 | local count = 0 8 | maxDistance = maxDistance or 2.0 9 | 10 | for i = 1, #objects do 11 | local object = objects[i] 12 | 13 | local objectCoords = GetEntityCoords(object) 14 | local distance = #(coords - objectCoords) 15 | 16 | if distance < maxDistance then 17 | count += 1 18 | nearby[count] = { 19 | object = object, 20 | coords = objectCoords 21 | } 22 | end 23 | end 24 | 25 | return nearby 26 | end 27 | 28 | return lib.getNearbyObjects 29 | -------------------------------------------------------------------------------- /[ox]/ox_lib/imports/getNearbyPeds/client.lua: -------------------------------------------------------------------------------- 1 | ---@param coords vector3 The coords to check from. 2 | ---@param maxDistance number The max distance to check. 3 | ---@return { ped: number, coords: vector3 }[] 4 | function lib.getNearbyPeds(coords, maxDistance) 5 | local peds = GetGamePool('CPed') 6 | local nearby = {} 7 | local count = 0 8 | maxDistance = maxDistance or 2.0 9 | 10 | for i = 1, #peds do 11 | local ped = peds[i] 12 | 13 | if not IsPedAPlayer(ped) then 14 | local pedCoords = GetEntityCoords(ped) 15 | local distance = #(coords - pedCoords) 16 | 17 | if distance < maxDistance then 18 | count += 1 19 | nearby[count] = { 20 | ped = ped, 21 | coords = pedCoords, 22 | } 23 | end 24 | end 25 | end 26 | 27 | return nearby 28 | end 29 | 30 | return lib.getNearbyPeds 31 | -------------------------------------------------------------------------------- /[ox]/ox_lib/imports/getNearbyPlayers/client.lua: -------------------------------------------------------------------------------- 1 | ---@param coords vector3 The coords to check from. 2 | ---@param maxDistance number The max distance to check. 3 | ---@param includePlayer boolean? Whether or not to include the current player. 4 | ---@return { id: number, ped: number, coords: vector3 }[] 5 | function lib.getNearbyPlayers(coords, maxDistance, includePlayer) 6 | local players = GetActivePlayers() 7 | local nearby = {} 8 | local count = 0 9 | maxDistance = maxDistance or 2.0 10 | 11 | for i = 1, #players do 12 | local playerId = players[i] 13 | 14 | if playerId ~= cache.playerId or includePlayer then 15 | local playerPed = GetPlayerPed(playerId) 16 | local playerCoords = GetEntityCoords(playerPed) 17 | local distance = #(coords - playerCoords) 18 | 19 | if distance < maxDistance then 20 | count += 1 21 | nearby[count] = { 22 | id = playerId, 23 | ped = playerPed, 24 | coords = playerCoords, 25 | } 26 | end 27 | end 28 | end 29 | 30 | return nearby 31 | end 32 | 33 | return lib.getNearbyPlayers 34 | -------------------------------------------------------------------------------- /[ox]/ox_lib/imports/getNearbyVehicles/client.lua: -------------------------------------------------------------------------------- 1 | ---@param coords vector3 The coords to check from. 2 | ---@param maxDistance number The max distance to check. 3 | ---@param includePlayerVehicle boolean Whether or not to include the player's current vehicle. 4 | ---@return { vehicle: number, coords: vector3 }[] 5 | function lib.getNearbyVehicles(coords, maxDistance, includePlayerVehicle) 6 | local vehicles = GetGamePool('CVehicle') 7 | local nearby = {} 8 | local count = 0 9 | maxDistance = maxDistance or 2.0 10 | 11 | for i = 1, #vehicles do 12 | local vehicle = vehicles[i] 13 | 14 | if not cache.vehicle or vehicle ~= cache.vehicle or includePlayerVehicle then 15 | local vehicleCoords = GetEntityCoords(vehicle) 16 | local distance = #(coords - vehicleCoords) 17 | 18 | if distance < maxDistance then 19 | count += 1 20 | nearby[count] = { 21 | vehicle = vehicle, 22 | coords = vehicleCoords 23 | } 24 | end 25 | end 26 | end 27 | 28 | return nearby 29 | end 30 | 31 | return lib.getNearbyVehicles 32 | -------------------------------------------------------------------------------- /[ox]/ox_lib/imports/locale/shared.lua: -------------------------------------------------------------------------------- 1 | ---@type { [string]: string } 2 | local dict = {} 3 | 4 | ---@param str string 5 | ---@param ... string | number 6 | ---@return string 7 | function locale(str, ...) 8 | local lstr = dict[str] 9 | 10 | if lstr then 11 | if ... then 12 | return lstr and lstr:format(...) 13 | end 14 | 15 | return lstr 16 | end 17 | 18 | return str 19 | end 20 | 21 | function lib.getLocales() 22 | return dict 23 | end 24 | 25 | function lib.locale() 26 | local lang = GetConvar('ox:locale', 'en') 27 | local locales = json.decode(LoadResourceFile(cache.resource, ('locales/%s.json'):format(lang))) 28 | 29 | if not locales then 30 | local warning = "could not load 'locales/%s.json'" 31 | warn(warning:format(lang)) 32 | 33 | if lang ~= 'en' then 34 | locales = json.decode(LoadResourceFile(cache.resource, 'locales/en.json')) 35 | 36 | if not locales then 37 | warn(warning:format('en')) 38 | end 39 | end 40 | 41 | if not locales then return end 42 | end 43 | 44 | for k, v in pairs(locales) do 45 | if type(v) == 'string' then 46 | for var in v:gmatch('${[%w%s%p]-}') do 47 | local locale = locales[var:sub(3, -2)] 48 | 49 | if locale then 50 | locale = locale:gsub('%%', '%%%%') 51 | v = v:gsub(var, locale) 52 | end 53 | end 54 | end 55 | 56 | dict[k] = v 57 | end 58 | end 59 | 60 | return lib.locale 61 | -------------------------------------------------------------------------------- /[ox]/ox_lib/imports/raycast/client.lua: -------------------------------------------------------------------------------- 1 | lib.raycast = {} 2 | 3 | local StartShapeTestLosProbe = StartShapeTestLosProbe 4 | local GetShapeTestResultIncludingMaterial = GetShapeTestResultIncludingMaterial 5 | local GetWorldCoordFromScreenCoord = GetWorldCoordFromScreenCoord 6 | 7 | ---@alias ShapetestIgnore 8 | ---| 1 GLASS 9 | ---| 2 SEE_THROUGH 10 | ---| 3 GLASS | SEE_THROUGH 11 | ---| 4 NO_COLLISION 12 | ---| 7 GLASS | SEE_THROUGH | NO_COLLISION 13 | 14 | ---@param flags number? Line of sight flags, defaults to 511 (see: https://docs.fivem.net/natives/?_0x377906D8A31E5586). 15 | ---@param ignore ShapetestIgnore? Defaults to 4. 16 | ---@param distance number? Defaults to 10. 17 | ---@return boolean hit 18 | ---@return number entityHit 19 | ---@return vector3 endCoords 20 | ---@return vector3 surfaceNormal 21 | ---@return number materialHash 22 | function lib.raycast.cam(flags, ignore, distance) 23 | local coords, normal = GetWorldCoordFromScreenCoord(0.5, 0.5) 24 | local destination = coords + normal * (distance or 10) 25 | local handle = StartShapeTestLosProbe(coords.x, coords.y, coords.z, destination.x, destination.y, destination.z, 26 | flags or 511, cache.ped, ignore or 4) 27 | 28 | while true do 29 | Wait(0) 30 | local retval, hit, endCoords, surfaceNormal, materialHash, entityHit = GetShapeTestResultIncludingMaterial(handle) 31 | 32 | if retval ~= 1 then 33 | ---@diagnostic disable-next-line: return-type-mismatch 34 | return hit, entityHit, endCoords, surfaceNormal, materialHash 35 | end 36 | end 37 | end 38 | 39 | return lib.raycast 40 | -------------------------------------------------------------------------------- /[ox]/ox_lib/imports/requestAnimDict/client.lua: -------------------------------------------------------------------------------- 1 | ---Load an animation dictionary. When called from a thread, it will yield until it has loaded. 2 | ---@param animDict string 3 | ---@param timeout number? Number of ticks to wait for the dictionary to load. Default is 500. 4 | ---@return string? animDict 5 | function lib.requestAnimDict(animDict, timeout) 6 | if HasAnimDictLoaded(animDict) then return animDict end 7 | 8 | if type(animDict) ~= 'string' then 9 | error(("expected animDict to have type 'string' (received %s)"):format(type(animDict))) 10 | end 11 | 12 | if not DoesAnimDictExist(animDict) then 13 | return error(("attempted to load invalid animDict '%s'"):format(animDict)) 14 | end 15 | 16 | RequestAnimDict(animDict) 17 | 18 | if not coroutine.isyieldable() then return animDict end 19 | 20 | return lib.waitFor(function() 21 | if HasAnimDictLoaded(animDict) then return animDict end 22 | end, ("failed to load animDict '%s'"):format(animDict), timeout or 500) 23 | end 24 | 25 | return lib.requestAnimDict 26 | -------------------------------------------------------------------------------- /[ox]/ox_lib/imports/requestAnimSet/client.lua: -------------------------------------------------------------------------------- 1 | ---Load an animation clipset. When called from a thread, it will yield until it has loaded. 2 | ---@param animSet string 3 | ---@param timeout number? Number of ticks to wait for the clipset to load. Default is 500. 4 | ---@return string? animSet 5 | function lib.requestAnimSet(animSet, timeout) 6 | if HasAnimSetLoaded(animSet) then return animSet end 7 | 8 | if type(animSet) ~= 'string' then 9 | error(("expected animSet to have type 'string' (received %s)"):format(type(animSet))) 10 | end 11 | 12 | RequestAnimSet(animSet) 13 | 14 | if not coroutine.isyieldable() then return animSet end 15 | 16 | return lib.waitFor(function() 17 | if HasAnimSetLoaded(animSet) then return animSet end 18 | end, ("failed to load animSet '%s'"):format(animSet), timeout or 500) 19 | end 20 | 21 | return lib.requestAnimSet 22 | -------------------------------------------------------------------------------- /[ox]/ox_lib/imports/requestModel/client.lua: -------------------------------------------------------------------------------- 1 | ---Load a model. When called from a thread, it will yield until it has loaded. 2 | ---@param model number | string 3 | ---@param timeout number? Number of ticks to wait for the model to load. Default is 500. 4 | ---@return number? model 5 | function lib.requestModel(model, timeout) 6 | if not tonumber(model) then model = joaat(model) end 7 | ---@cast model -string 8 | if HasModelLoaded(model) then return model end 9 | 10 | if not IsModelValid(model) then 11 | return error(("attempted to load invalid model '%s'"):format(model)) 12 | end 13 | 14 | RequestModel(model) 15 | 16 | if not coroutine.isyieldable() then return model end 17 | 18 | return lib.waitFor(function() 19 | if HasModelLoaded(model) then return model end 20 | end, ("failed to load model '%s'"):format(model), timeout or 500) 21 | end 22 | 23 | return lib.requestModel 24 | -------------------------------------------------------------------------------- /[ox]/ox_lib/imports/requestNamedPtfxAsset/client.lua: -------------------------------------------------------------------------------- 1 | ---Load a named particle effect. When called from a thread, it will yield until it has loaded. 2 | ---@param ptFxName string 3 | ---@param timeout number? Number of ticks to wait for the particle effect to load. Default is 500. 4 | ---@return string? ptFxName 5 | function lib.requestNamedPtfxAsset(ptFxName, timeout) 6 | if HasNamedPtfxAssetLoaded(ptFxName) then return ptFxName end 7 | 8 | if type(ptFxName) ~= 'string' then 9 | error(("expected ptFxName to have type 'string' (received %s)"):format(type(ptFxName))) 10 | end 11 | 12 | RequestNamedPtfxAsset(ptFxName) 13 | 14 | if not coroutine.isyieldable() then return ptFxName end 15 | 16 | return lib.waitFor(function() 17 | if HasNamedPtfxAssetLoaded(ptFxName) then return ptFxName end 18 | end, ("failed to load ptFxName '%s'"):format(ptFxName), timeout or 500) 19 | end 20 | 21 | return lib.requestNamedPtfxAsset 22 | -------------------------------------------------------------------------------- /[ox]/ox_lib/imports/requestScaleformMovie/client.lua: -------------------------------------------------------------------------------- 1 | ---Load a scaleform movie. When called from a thread, it will yield until it has loaded. 2 | ---@param scaleformName string 3 | ---@param timeout number? Number of ticks to wait for the scaleform movie to load. Default is 500. 4 | ---@return number? scaleform 5 | function lib.requestScaleformMovie(scaleformName, timeout) 6 | if type(scaleformName) ~= 'string' then 7 | error(("expected scaleformName to have type 'string' (received %s)"):format(type(scaleformName))) 8 | end 9 | 10 | local scaleform = RequestScaleformMovie(scaleformName) 11 | 12 | if not coroutine.isyieldable() then return scaleform end 13 | 14 | return lib.waitFor(function() 15 | if HasScaleformMovieLoaded(scaleform) then return scaleform end 16 | end, ("failed to load scaleform '%s'"):format(scaleform), timeout or 500) 17 | end 18 | 19 | return lib.requestScaleformMovie 20 | -------------------------------------------------------------------------------- /[ox]/ox_lib/imports/requestStreamedTextureDict/client.lua: -------------------------------------------------------------------------------- 1 | ---Load a texture dictionary. When called from a thread, it will yield until it has loaded. 2 | ---@param textureDict string 3 | ---@param timeout number? Number of ticks to wait for the dictionary to load. Default is 500. 4 | ---@return string? textureDict 5 | function lib.requestStreamedTextureDict(textureDict, timeout) 6 | if HasStreamedTextureDictLoaded(textureDict) then return textureDict end 7 | 8 | if type(textureDict) ~= 'string' then 9 | error(("expected textureDict to have type 'string' (received %s)"):format(type(textureDict))) 10 | end 11 | 12 | RequestStreamedTextureDict(textureDict, false) 13 | 14 | if not coroutine.isyieldable() then return textureDict end 15 | 16 | return lib.waitFor(function() 17 | if HasStreamedTextureDictLoaded(textureDict) then return textureDict end 18 | end, ("failed to load textureDict '%s'"):format(textureDict), timeout or 500) 19 | end 20 | 21 | return lib.requestStreamedTextureDict 22 | -------------------------------------------------------------------------------- /[ox]/ox_lib/imports/waitFor/shared.lua: -------------------------------------------------------------------------------- 1 | ---Yields the current thread until a non-nil value is returned by the function. 2 | ---Errors after timeout (default 1000) iterations. 3 | ---@generic T 4 | ---@param cb fun(): T? 5 | ---@param errMessage string? 6 | ---@param timeout number? 7 | ---@return T? 8 | ---@async 9 | function lib.waitFor(cb, errMessage, timeout) 10 | local value = cb() 11 | 12 | if value ~= nil then return value end 13 | 14 | if timeout or timeout == nil then 15 | timeout = tonumber(timeout) or 1000 16 | end 17 | 18 | local start = GetGameTimer() 19 | local i = 0 20 | 21 | while value == nil do 22 | if timeout then 23 | i += 1 24 | 25 | if i > timeout then return error(('%s (waited %.1fms)'):format(errMessage or 'failed to resolve callback', (GetGameTimer() - start) / 1000), 2) end 26 | end 27 | 28 | Wait(0) 29 | value = cb() 30 | end 31 | 32 | return value 33 | end 34 | 35 | return lib.waitFor 36 | -------------------------------------------------------------------------------- /[ox]/ox_lib/locales/al.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "Shqip", 3 | "ui": { 4 | "cancel": "Cancel", 5 | "close": "Mbylle", 6 | "confirm": "Konfirmo", 7 | "more": "More..." 8 | }, 9 | "txadmin_announcement": "Server announcement by %s", 10 | "txadmin_dm": "Direct Message from %s", 11 | "txadmin_warn": "You have been warned by %s", 12 | "txadmin_warn_content": "%s \nAction ID: %s", 13 | "txadmin_scheduledrestart": "Scheduled Restart" 14 | } 15 | -------------------------------------------------------------------------------- /[ox]/ox_lib/locales/cs.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "Čeština", 3 | "ui": { 4 | "cancel": "Zrušit", 5 | "close": "Zavřít", 6 | "confirm": "Potvrdit", 7 | "more": "Více..." 8 | }, 9 | "txadmin_announcement": "Server oznámení od %s", 10 | "txadmin_dm": "Soukromá zpráva od %s", 11 | "txadmin_warn": "Byl jsi varován %s", 12 | "txadmin_warn_content": "%s \nID Akce: %s", 13 | "txadmin_scheduledrestart": "Plánovaný restart" 14 | } 15 | -------------------------------------------------------------------------------- /[ox]/ox_lib/locales/da.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "Dansk", 3 | "ui": { 4 | "cancel": "Annuller", 5 | "close": "Luk", 6 | "confirm": "Bekræft", 7 | "more": "Mere..." 8 | }, 9 | "txadmin_announcement": "Servermeddelelse af %s", 10 | "txadmin_dm": "Direkte besked fra %s", 11 | "txadmin_warn": "Du er blevet advaret af %s", 12 | "txadmin_warn_content": "%s \nHandlings-id: %s", 13 | "txadmin_scheduledrestart": "Planlagt genstart" 14 | } 15 | -------------------------------------------------------------------------------- /[ox]/ox_lib/locales/de.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "Deutsch", 3 | "ui": { 4 | "cancel": "Abbrechen", 5 | "close": "Schließen", 6 | "confirm": "Bestätigen", 7 | "more": "Mehr..." 8 | }, 9 | "txadmin_announcement": "Server announcement by %s", 10 | "txadmin_dm": "Direct Message from %s", 11 | "txadmin_warn": "You have been warned by %s", 12 | "txadmin_warn_content": "%s \nAction ID: %s", 13 | "txadmin_scheduledrestart": "Scheduled Restart" 14 | } 15 | -------------------------------------------------------------------------------- /[ox]/ox_lib/locales/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "English", 3 | "ui": { 4 | "cancel": "Cancel", 5 | "close": "Close", 6 | "confirm": "Confirm", 7 | "more": "More..." 8 | }, 9 | "txadmin_announcement": "Server announcement by %s", 10 | "txadmin_dm": "Direct Message from %s", 11 | "txadmin_warn": "You have been warned by %s", 12 | "txadmin_warn_content": "%s \nAction ID: %s", 13 | "txadmin_scheduledrestart": "Scheduled Restart" 14 | } 15 | -------------------------------------------------------------------------------- /[ox]/ox_lib/locales/es.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "Español", 3 | "ui": { 4 | "cancel": "Cancelar", 5 | "close": "Cerrar", 6 | "confirm": "Confirmar", 7 | "more": "Más..." 8 | }, 9 | "txadmin_announcement": "Anuncio de servidor de %s", 10 | "txadmin_dm": "Mensaje directo de %s", 11 | "txadmin_warn": "Has sido advertido por %s", 12 | "txadmin_warn_content": "%s \nID de acción: %s", 13 | "txadmin_scheduledrestart": "Reinicio programado" 14 | } 15 | -------------------------------------------------------------------------------- /[ox]/ox_lib/locales/et.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "Eesti", 3 | "ui": { 4 | "cancel": "Tühista", 5 | "close": "Sulge", 6 | "confirm": "Kinnita", 7 | "more": "Rohkem..." 8 | }, 9 | "txadmin_announcement": "Serveri teadaanne kasutajalt %s", 10 | "txadmin_dm": "Sulle saadeti sõnum kasutajalt %s", 11 | "txadmin_warn": "Sind hoiatati kasutaja %s poolt", 12 | "txadmin_warn_content": "%s \nTegevuse ID: %s", 13 | "txadmin_scheduledrestart": "Planeeritud taaskäivitus" 14 | } 15 | -------------------------------------------------------------------------------- /[ox]/ox_lib/locales/fi.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "Suomi", 3 | "ui": { 4 | "cancel": "Peruuta", 5 | "close": "Sulje", 6 | "confirm": "Vahvista", 7 | "more": "Lisää..." 8 | }, 9 | "txadmin_announcement": "Ilmoitus palvelimen ylläpitäjältä %s", 10 | "txadmin_dm": "Sait viestin henkilöltä %s", 11 | "txadmin_warn": "Sinua on varoitettu henkilön %s toimesta", 12 | "txadmin_warn_content": "%s \nTunniste: %s", 13 | "txadmin_scheduledrestart": "Ajoitettu uudelleenkäynnistyminen" 14 | } 15 | -------------------------------------------------------------------------------- /[ox]/ox_lib/locales/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "Français", 3 | "ui": { 4 | "cancel": "Annuler", 5 | "close": "Fermer", 6 | "confirm": "Confirmer", 7 | "more": "Plus..." 8 | }, 9 | "txadmin_announcement": "Server announcement by %s", 10 | "txadmin_dm": "Direct Message from %s", 11 | "txadmin_warn": "You have been warned by %s", 12 | "txadmin_warn_content": "%s \nAction ID: %s", 13 | "txadmin_scheduledrestart": "Scheduled Restart" 14 | } 15 | -------------------------------------------------------------------------------- /[ox]/ox_lib/locales/he.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "עברית", 3 | "ui": { 4 | "cancel": "ביטול", 5 | "close": "סגירה", 6 | "confirm": "אישור", 7 | "more": "...עוד" 8 | }, 9 | "txadmin_announcement": "Server announcement by %s", 10 | "txadmin_dm": "Direct Message from %s", 11 | "txadmin_warn": "You have been warned by %s", 12 | "txadmin_warn_content": "%s \nAction ID: %s", 13 | "txadmin_scheduledrestart": "Scheduled Restart" 14 | } 15 | -------------------------------------------------------------------------------- /[ox]/ox_lib/locales/hr.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "Hrvatski", 3 | "ui": { 4 | "cancel": "Odustani", 5 | "close": "Zatvori", 6 | "confirm": "Potvrdi", 7 | "more": "Više..." 8 | }, 9 | "txadmin_announcement": "Server announcement by %s", 10 | "txadmin_dm": "Direct Message from %s", 11 | "txadmin_warn": "You have been warned by %s", 12 | "txadmin_warn_content": "%s \nAction ID: %s", 13 | "txadmin_scheduledrestart": "Scheduled Restart" 14 | } 15 | -------------------------------------------------------------------------------- /[ox]/ox_lib/locales/hu.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "Magyar", 3 | "ui": { 4 | "cancel": "Mégse", 5 | "close": "Bezárás", 6 | "confirm": "Megerősít", 7 | "more": "Tovább..." 8 | }, 9 | "txadmin_announcement": "Szerver bejelentés által %s", 10 | "txadmin_dm": "Közvetlen üzenet a %s", 11 | "txadmin_warn": "Figyelmeztetett %s", 12 | "txadmin_warn_content": "%s \nMűvelet ID: %s", 13 | "txadmin_scheduledrestart": "Ütemezett újraindítás" 14 | } 15 | -------------------------------------------------------------------------------- /[ox]/ox_lib/locales/id.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "Indonesian", 3 | "ui": { 4 | "cancel": "Batal", 5 | "close": "Tutup", 6 | "confirm": "Konfirmasi", 7 | "more": "More..." 8 | }, 9 | "txadmin_announcement": "Server announcement by %s", 10 | "txadmin_dm": "Direct Message from %s", 11 | "txadmin_warn": "You have been warned by %s", 12 | "txadmin_warn_content": "%s \nAction ID: %s", 13 | "txadmin_scheduledrestart": "Scheduled Restart" 14 | } 15 | -------------------------------------------------------------------------------- /[ox]/ox_lib/locales/it.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "Italiano", 3 | "ui": { 4 | "cancel": "Annulla", 5 | "close": "Chiudi", 6 | "confirm": "Conferma", 7 | "more": "Altro..." 8 | }, 9 | "txadmin_announcement": "Annuncio server da %s", 10 | "txadmin_dm": "Messaggio diretto da %s", 11 | "txadmin_warn": "Sei stato richiamato da %s", 12 | "txadmin_warn_content": "%s \nAction ID: %s", 13 | "txadmin_scheduledrestart": "Riavvio Programmato" 14 | } 15 | -------------------------------------------------------------------------------- /[ox]/ox_lib/locales/lt.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "Lietuvių", 3 | "ui": { 4 | "cancel": "Atšaukti", 5 | "close": "Uždaryti", 6 | "confirm": "Patvirtinti", 7 | "more": "Daugiau..." 8 | }, 9 | "txadmin_announcement": "Server announcement by %s", 10 | "txadmin_dm": "Direct Message from %s", 11 | "txadmin_warn": "You have been warned by %s", 12 | "txadmin_warn_content": "%s \nAction ID: %s", 13 | "txadmin_scheduledrestart": "Scheduled Restart" 14 | } 15 | -------------------------------------------------------------------------------- /[ox]/ox_lib/locales/nl.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "Nederlands", 3 | "ui": { 4 | "cancel": "Annuleren", 5 | "close": "Sluiten", 6 | "confirm": "Bevestig", 7 | "more": "More..." 8 | }, 9 | "txadmin_announcement": "Server announcement by %s", 10 | "txadmin_dm": "Direct Message from %s", 11 | "txadmin_warn": "You have been warned by %s", 12 | "txadmin_warn_content": "%s \nAction ID: %s", 13 | "txadmin_scheduledrestart": "Scheduled Restart" 14 | } 15 | -------------------------------------------------------------------------------- /[ox]/ox_lib/locales/no.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "Norsk", 3 | "ui": { 4 | "cancel": "Avbryt", 5 | "close": "Lukk", 6 | "confirm": "Bekreft", 7 | "more": "Mer..." 8 | }, 9 | "txadmin_announcement": "Server announcement by %s", 10 | "txadmin_dm": "Direct Message from %s", 11 | "txadmin_warn": "You have been warned by %s", 12 | "txadmin_warn_content": "%s \nAction ID: %s", 13 | "txadmin_scheduledrestart": "Scheduled Restart" 14 | } 15 | -------------------------------------------------------------------------------- /[ox]/ox_lib/locales/pl.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "Polski", 3 | "ui": { 4 | "cancel": "Anuluj", 5 | "close": "Zamknij", 6 | "confirm": "Potwierdź", 7 | "more": "Więcej..." 8 | }, 9 | "txadmin_announcement": "Ogłoszenie serwerowe od %s", 10 | "txadmin_dm": "Prywatna wiadomość od %s", 11 | "txadmin_warn": "Otrzymano ostrzeżenie od %s", 12 | "txadmin_warn_content": "%s \nId akcji: %s", 13 | "txadmin_scheduledrestart": "Zaplanowany restart" 14 | } 15 | -------------------------------------------------------------------------------- /[ox]/ox_lib/locales/pt-br.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "Português", 3 | "ui": { 4 | "cancel": "Cancelar", 5 | "close": "Fechar", 6 | "confirm": "Confirmar", 7 | "more": "Mais..." 8 | }, 9 | "txadmin_announcement": "Server announcement by %s", 10 | "txadmin_dm": "Direct Message from %s", 11 | "txadmin_warn": "You have been warned by %s", 12 | "txadmin_warn_content": "%s \nAction ID: %s", 13 | "txadmin_scheduledrestart": "Scheduled Restart" 14 | } 15 | -------------------------------------------------------------------------------- /[ox]/ox_lib/locales/ru.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "Русский", 3 | "ui": { 4 | "cancel": "Отменить", 5 | "close": "Закрыть", 6 | "confirm": "Подтвердить", 7 | "more": "Ещё..." 8 | }, 9 | "txadmin_announcement": "Server announcement by %s", 10 | "txadmin_dm": "Direct Message from %s", 11 | "txadmin_warn": "You have been warned by %s", 12 | "txadmin_warn_content": "%s \nAction ID: %s", 13 | "txadmin_scheduledrestart": "Scheduled Restart" 14 | } 15 | -------------------------------------------------------------------------------- /[ox]/ox_lib/locales/sk.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "Slovenčina", 3 | "ui": { 4 | "cancel": "Zrušiť", 5 | "close": "Zavrieť", 6 | "confirm": "Potvrdiť", 7 | "more": "More..." 8 | }, 9 | "txadmin_announcement": "Server announcement by %s", 10 | "txadmin_dm": "Direct Message from %s", 11 | "txadmin_warn": "You have been warned by %s", 12 | "txadmin_warn_content": "%s \nAction ID: %s", 13 | "txadmin_scheduledrestart": "Scheduled Restart" 14 | } 15 | -------------------------------------------------------------------------------- /[ox]/ox_lib/locales/sl.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "Slovenski", 3 | "ui": { 4 | "cancel": "Cancel", 5 | "close": "Zapri", 6 | "confirm": "Potrdi", 7 | "more": "More..." 8 | }, 9 | "txadmin_announcement": "Server announcement by %s", 10 | "txadmin_dm": "Direct Message from %s", 11 | "txadmin_warn": "You have been warned by %s", 12 | "txadmin_warn_content": "%s \nAction ID: %s", 13 | "txadmin_scheduledrestart": "Scheduled Restart" 14 | } 15 | -------------------------------------------------------------------------------- /[ox]/ox_lib/locales/sv.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "Svenska", 3 | "ui": { 4 | "cancel": "Avbryt", 5 | "close": "Stäng", 6 | "confirm": "Acceptera", 7 | "more": "Mer..." 8 | }, 9 | "txadmin_announcement": "Server announcement by %s", 10 | "txadmin_dm": "Direct Message from %s", 11 | "txadmin_warn": "You have been warned by %s", 12 | "txadmin_warn_content": "%s \nAction ID: %s", 13 | "txadmin_scheduledrestart": "Scheduled Restart" 14 | } 15 | -------------------------------------------------------------------------------- /[ox]/ox_lib/locales/th.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "Thailand", 3 | "ui": { 4 | "cancel": "ยกเลิก", 5 | "close": "ปิด", 6 | "confirm": "ยืนยัน", 7 | "more": "เพิ่มเติม..." 8 | }, 9 | "txadmin_announcement": "Server announcement by %s", 10 | "txadmin_dm": "Direct Message from %s", 11 | "txadmin_warn": "You have been warned by %s", 12 | "txadmin_warn_content": "%s \nAction ID: %s", 13 | "txadmin_scheduledrestart": "Scheduled Restart" 14 | } 15 | -------------------------------------------------------------------------------- /[ox]/ox_lib/locales/tr.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "Türkçe", 3 | "ui": { 4 | "cancel": "İptal", 5 | "close": "Kapat", 6 | "confirm": "Onayla", 7 | "more": "Daha Fazla..." 8 | }, 9 | "txadmin_announcement": "Server announcement by %s", 10 | "txadmin_dm": "Direct Message from %s", 11 | "txadmin_warn": "You have been warned by %s", 12 | "txadmin_warn_content": "%s \nAction ID: %s", 13 | "txadmin_scheduledrestart": "Scheduled Restart" 14 | } 15 | -------------------------------------------------------------------------------- /[ox]/ox_lib/locales/zh-cn.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "简体中文", 3 | "ui": { 4 | "cancel": "取消", 5 | "close": "关闭", 6 | "confirm": "确认", 7 | "more": "更多..." 8 | }, 9 | "txadmin_announcement": "来自 %s 的服务器通告", 10 | "txadmin_dm": "来自 %s 的信息", 11 | "txadmin_warn": "您被 %s 警告了", 12 | "txadmin_warn_content": "%s \n操作 ID: %s", 13 | "txadmin_scheduledrestart": "计划内重启" 14 | } 15 | -------------------------------------------------------------------------------- /[ox]/ox_lib/locales/zh-tw.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "繁體中文", 3 | "ui": { 4 | "cancel": "取消", 5 | "close": "關閉", 6 | "confirm": "確認", 7 | "more": "更多..." 8 | }, 9 | "txadmin_announcement": "來自 %s 的伺服器通告", 10 | "txadmin_dm": "來自 %s 的訊息", 11 | "txadmin_warn": "您被 %s 警告了", 12 | "txadmin_warn_content": "%s \n操作 ID: %s", 13 | "txadmin_scheduledrestart": "計劃內重啟" 14 | } 15 | -------------------------------------------------------------------------------- /[ox]/ox_lib/resource/acl/server.lua: -------------------------------------------------------------------------------- 1 | local function allowAce(allow) 2 | return allow == false and 'deny' or 'allow' 3 | end 4 | 5 | -- Adds the ace to the principal. 6 | function lib.addAce(principal, ace, allow) 7 | if type(principal) == 'number' then 8 | principal = 'player.'..principal 9 | end 10 | 11 | ExecuteCommand(('add_ace %s %s %s'):format(principal, ace, allowAce(allow))) 12 | end 13 | 14 | -- Removes the ace from the principal. 15 | function lib.removeAce(principal, ace, allow) 16 | if type(principal) == 'number' then 17 | principal = 'player.'..principal 18 | end 19 | 20 | ExecuteCommand(('remove_ace %s %s %s'):format(principal, ace, allowAce(allow))) 21 | end 22 | 23 | -- Adds the child principal to the parent principal. 24 | function lib.addPrincipal(child, parent) 25 | if type(child) == 'number' then 26 | child = 'player.'..child 27 | end 28 | 29 | ExecuteCommand(('add_principal %s %s'):format(child, parent)) 30 | end 31 | 32 | -- Removes the child principal from the parent principal. 33 | function lib.removePrincipal(child, parent) 34 | if type(child) == 'number' then 35 | child = 'player.'..child 36 | end 37 | 38 | ExecuteCommand(('remove_principal %s %s'):format(child, parent)) 39 | end 40 | 41 | lib.callback.register('ox_lib:checkPlayerAce', function(source, command) 42 | return IsPlayerAceAllowed(source, command) 43 | end) 44 | -------------------------------------------------------------------------------- /[ox]/ox_lib/resource/cache/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99JSP/MainPower/354e89104b9f72823c04877c2d99d9bba0d9f257/[ox]/ox_lib/resource/cache/.gitkeep -------------------------------------------------------------------------------- /[ox]/ox_lib/resource/client.lua: -------------------------------------------------------------------------------- 1 | local _registerCommand = RegisterCommand 2 | 3 | ---@param commandName string 4 | ---@param callback fun(source, args, raw) 5 | ---@param restricted boolean? 6 | function RegisterCommand(commandName, callback, restricted) 7 | _registerCommand(commandName, function(source, args, raw) 8 | if not restricted or lib.callback.await('ox_lib:checkPlayerAce', 100, ('command.%s'):format(commandName)) then 9 | callback(source, args, raw) 10 | end 11 | end) 12 | end 13 | 14 | RegisterNUICallback('getConfig', function(_, cb) 15 | cb({ 16 | primaryColor = GetConvar('ox:primaryColor', 'blue'), 17 | primaryShade = GetConvarInt('ox:primaryShade', 8) 18 | }) 19 | end) -------------------------------------------------------------------------------- /[ox]/ox_lib/resource/interface/client/alert.lua: -------------------------------------------------------------------------------- 1 | local alert = nil 2 | 3 | ---@class AlertDialogProps 4 | ---@field header string; 5 | ---@field content string; 6 | ---@field centered? boolean?; 7 | ---@field size? 'xs' | 'sm' | 'md' | 'lg' | 'xl'; 8 | ---@field overflow? boolean?; 9 | ---@field cancel? boolean?; 10 | ---@field labels? {cancel?: string, confirm?: string} 11 | 12 | ---@param data AlertDialogProps 13 | ---@return 'cancel' | 'confirm' | nil 14 | function lib.alertDialog(data) 15 | if alert then return end 16 | 17 | alert = promise.new() 18 | 19 | lib.setNuiFocus(false) 20 | SendNUIMessage({ 21 | action = 'sendAlert', 22 | data = data 23 | }) 24 | 25 | return Citizen.Await(alert) 26 | end 27 | 28 | function lib.closeAlertDialog() 29 | if not alert then return end 30 | 31 | lib.resetNuiFocus() 32 | SendNUIMessage({ 33 | action = 'closeAlertDialog' 34 | }) 35 | 36 | alert:resolve(nil) 37 | alert = nil 38 | end 39 | 40 | 41 | RegisterNUICallback('closeAlert', function(data, cb) 42 | cb(1) 43 | lib.resetNuiFocus() 44 | 45 | local promise = alert 46 | alert = nil 47 | 48 | promise:resolve(data) 49 | end) 50 | 51 | RegisterNetEvent('ox_lib:alertDialog', lib.alertDialog) 52 | -------------------------------------------------------------------------------- /[ox]/ox_lib/resource/interface/client/clipboard.lua: -------------------------------------------------------------------------------- 1 | ---@param value string 2 | function lib.setClipboard(value) 3 | SendNUIMessage({ 4 | action = 'setClipboard', 5 | data = value 6 | }) 7 | end -------------------------------------------------------------------------------- /[ox]/ox_lib/resource/interface/client/main.lua: -------------------------------------------------------------------------------- 1 | ---@alias IconProp 'fas' | 'far' | 'fal' | 'fat' | 'fad' | 'fab' | 'fak' | 'fass' 2 | 3 | local keepInput = IsNuiFocusKeepingInput() 4 | 5 | function lib.setNuiFocus(allowInput, disableCursor) 6 | keepInput = IsNuiFocusKeepingInput() 7 | SetNuiFocus(true, not disableCursor) 8 | SetNuiFocusKeepInput(allowInput) 9 | end 10 | 11 | function lib.resetNuiFocus() 12 | SetNuiFocus(false, false) 13 | SetNuiFocusKeepInput(keepInput) 14 | end 15 | -------------------------------------------------------------------------------- /[ox]/ox_lib/resource/interface/client/notify.lua: -------------------------------------------------------------------------------- 1 | ---@alias NotificationPosition 'top' | 'top-right' | 'top-left' | 'bottom' | 'bottom-right' | 'bottom-left' | 'center-right' | 'center-left' 2 | ---@alias NotificationType 'info' | 'warning' | 'success' | 'error' 3 | 4 | ---@class NotifyProps 5 | ---@field id? string 6 | ---@field title? string 7 | ---@field description? string 8 | ---@field duration? number 9 | ---@field position? NotificationPosition 10 | ---@field type? NotificationType 11 | ---@field style? { [string]: any } 12 | ---@field icon? string | {[1]: IconProp, [2]: string}; 13 | ---@field iconColor? string; 14 | 15 | ---`client` 16 | ---@param data NotifyProps 17 | ---@diagnostic disable-next-line: duplicate-set-field 18 | function lib.notify(data) 19 | SendNUIMessage({ 20 | action = 'notify', 21 | data = data 22 | }) 23 | end 24 | 25 | ---@class DefaultNotifyProps 26 | ---@field title? string 27 | ---@field description? string 28 | ---@field duration? number 29 | ---@field position? NotificationPosition 30 | ---@field status? 'info' | 'warning' | 'success' | 'error' 31 | ---@field id? number 32 | 33 | ---@param data DefaultNotifyProps 34 | function lib.defaultNotify(data) 35 | -- Backwards compat for v3 36 | data.type = data.status 37 | if data.type == 'inform' then data.type = 'info' end 38 | return lib.notify(data --[[@as NotifyProps]]) 39 | end 40 | 41 | RegisterNetEvent('ox_lib:notify', lib.notify) 42 | RegisterNetEvent('ox_lib:defaultNotify', lib.defaultNotify) 43 | -------------------------------------------------------------------------------- /[ox]/ox_lib/resource/interface/client/skillcheck.lua: -------------------------------------------------------------------------------- 1 | ---@type promise? 2 | local skillcheck 3 | 4 | ---@alias SkillCheckDifficulity 'easy' | 'medium' | 'hard' | { areaSize: number, speedMultiplier: number } 5 | 6 | ---@param difficulty SkillCheckDifficulity | SkillCheckDifficulity[] 7 | ---@param inputs string[]? 8 | ---@return boolean? 9 | function lib.skillCheck(difficulty, inputs) 10 | if skillcheck then return end 11 | skillcheck = promise:new() 12 | 13 | lib.setNuiFocus(false, true) 14 | SendNUIMessage({ 15 | action = 'startSkillCheck', 16 | data = { 17 | difficulty = difficulty, 18 | inputs = inputs 19 | } 20 | }) 21 | 22 | return Citizen.Await(skillcheck) 23 | end 24 | 25 | function lib.cancelSkillCheck() 26 | if not skillcheck then 27 | error('No skillCheck is active') 28 | end 29 | 30 | SendNUIMessage({action = 'skillCheckCancel'}) 31 | end 32 | 33 | ---@return boolean 34 | function lib.skillCheckActive() 35 | return skillcheck ~= nil 36 | end 37 | 38 | RegisterNUICallback('skillCheckOver', function(success, cb) 39 | cb(1) 40 | 41 | if skillcheck then 42 | lib.resetNuiFocus() 43 | 44 | skillcheck:resolve(success) 45 | skillcheck = nil 46 | end 47 | end) 48 | -------------------------------------------------------------------------------- /[ox]/ox_lib/resource/interface/client/textui.lua: -------------------------------------------------------------------------------- 1 | ---@class TextUIOptions 2 | ---@field position? 'right-center' | 'left-center' | 'top-center'; 3 | ---@field icon? string | {[1]: IconProp, [2]: string}; 4 | ---@field iconColor? string; 5 | ---@field style? string | table; 6 | 7 | local isOpen = false 8 | local currentText 9 | 10 | ---@param text string 11 | ---@param options? TextUIOptions 12 | function lib.showTextUI(text, options) 13 | if currentText == text then return end 14 | 15 | if not options then options = {} end 16 | 17 | options.text = text 18 | currentText = text 19 | 20 | SendNUIMessage({ 21 | action = 'textUi', 22 | data = options 23 | }) 24 | 25 | isOpen = true 26 | end 27 | 28 | function lib.hideTextUI() 29 | SendNUIMessage({ 30 | action = 'textUiHide' 31 | }) 32 | 33 | isOpen = false 34 | currentText = nil 35 | end 36 | 37 | ---@return boolean 38 | function lib.isTextUIOpen() 39 | return isOpen 40 | end 41 | -------------------------------------------------------------------------------- /[ox]/ox_lib/resource/locale/client.lua: -------------------------------------------------------------------------------- 1 | RegisterNUICallback('init', function(_, cb) 2 | cb(1) 3 | 4 | SendNUIMessage({ 5 | action = 'loadLocales', 6 | data = {} 7 | }) 8 | 9 | local JSON = LoadResourceFile(cache.resource, ('locales/%s.json'):format(GetConvar('ox:locale', 'en'))) or LoadResourceFile(cache.resource, 'locales/en.json') 10 | 11 | SendNUIMessage({ 12 | action = 'setLocale', 13 | data = JSON and json.decode(JSON) or {} 14 | }) 15 | end) 16 | -------------------------------------------------------------------------------- /[ox]/ox_lib/resource/shared.lua: -------------------------------------------------------------------------------- 1 | lib.locale() 2 | -------------------------------------------------------------------------------- /[ox]/ox_lib/resource/version/server.lua: -------------------------------------------------------------------------------- 1 | function lib.versionCheck(repository) 2 | local resource = GetInvokingResource() or GetCurrentResourceName() 3 | 4 | local currentVersion = GetResourceMetadata(resource, 'version', 0) 5 | 6 | if currentVersion then 7 | currentVersion = currentVersion:match('%d+%.%d+%.%d+') 8 | end 9 | 10 | if not currentVersion then return print(("^1Unable to determine current resource version for '%s' ^0"):format(resource)) end 11 | 12 | SetTimeout(1000, function() 13 | PerformHttpRequest(('https://api.github.com/repos/%s/releases/latest'):format(repository), function(status, response) 14 | if status ~= 200 then return end 15 | 16 | response = json.decode(response) 17 | if response.prerelease then return end 18 | 19 | local latestVersion = response.tag_name:match('%d+%.%d+%.%d+') 20 | if not latestVersion or latestVersion == currentVersion then return end 21 | 22 | local cv = { string.strsplit('.', currentVersion) } 23 | local lv = { string.strsplit('.', latestVersion) } 24 | 25 | for i = 1, #cv do 26 | local current, minimum = tonumber(cv[i]), tonumber(lv[i]) 27 | 28 | if current ~= minimum then 29 | if current < minimum then 30 | return print(('^3An update is available for %s (current version: %s)\r\n%s^0'):format(resource, currentVersion, response.html_url)) 31 | else break end 32 | end 33 | end 34 | end, 'GET') 35 | end) 36 | end 37 | 38 | lib.versionCheck('overextended/ox_lib') 39 | -------------------------------------------------------------------------------- /[ox]/ox_lib/resource/version/shared.lua: -------------------------------------------------------------------------------- 1 | function lib.checkDependency(resource, minimumVersion, printMessage) 2 | local currentVersion = GetResourceMetadata(resource, 'version', 0) 3 | currentVersion = currentVersion and currentVersion:match('%d+%.%d+%.%d+') or 'unknown' 4 | 5 | if currentVersion ~= minimumVersion then 6 | local cv = { string.strsplit('.', currentVersion) } 7 | local mv = { string.strsplit('.', minimumVersion) } 8 | local msg = ("^1%s requires version '%s' of '%s' (current version: %s)^0"):format(GetInvokingResource() or GetCurrentResourceName(), minimumVersion, resource, currentVersion) 9 | 10 | for i = 1, #cv do 11 | local current, minimum = tonumber(cv[i]), tonumber(mv[i]) 12 | 13 | if current ~= minimum then 14 | if not current or current < minimum then 15 | if printMessage then 16 | return print(msg) 17 | end 18 | 19 | return false, msg 20 | else break end 21 | end 22 | end 23 | end 24 | 25 | return true 26 | end 27 | -------------------------------------------------------------------------------- /[ox]/ox_lib/web/build/assets/index-281f5198.css: -------------------------------------------------------------------------------- 1 | @import"https://fonts.googleapis.com/css2?family=Poppins:wght@200;400;500;700&display=swap";@import"https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500&display=swap";@import"https://fonts.googleapis.com/css2?family=Fira+Mono&display=swap";@import"https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&display=swap";@import"https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;500;600;700&display=swap";@import"https://use.typekit.net/wxh5ury.css";@import"https://use.typekit.net/qgr5ebd.css";html{color-scheme:normal!important}body{background:none!important;margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;height:100vh;user-select:none;overflow:hidden!important}p{margin:0}#root{height:100%}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}@keyframes progress-bar{0%{width:0%}to{width:100%}}::-webkit-scrollbar{background-color:transparent;padding:0;margin:0;width:0;height:0}.toast-inform{background-color:#2980b9}.toast-success{background-color:#27ae60}.toast-error{background-color:#c0392b} 2 | -------------------------------------------------------------------------------- /[ox]/ox_lib/web/build/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | NUI React Boilerplate 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /[ox]/ox_target/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Overextended 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /[ox]/ox_target/README.md: -------------------------------------------------------------------------------- 1 |

Documentation

2 | 3 | ## ox_target 4 | 5 | A performant and flexible standalone "third-eye" targeting resource, with additional functionality when using ox_core, esx, or qb-core. 6 | 7 | ox_target is the successor to qtarget, which was a mostly-compatible fork of bt-target. 8 | To improve many design flaws, ox_target has been written from scratch and drops support for bt-target/qtarget standards, though partial compatibility is being implemented where possible. 9 | 10 | - Performance increased ~4x compared to qtarget. 11 | - Improved error handling protects against soft-locking. 12 | - Improved entity and world collision detection. 13 | - Options now stack, rather than overriding. 14 | -------------------------------------------------------------------------------- /[ox]/ox_target/client/framework/ox.lua: -------------------------------------------------------------------------------- 1 | local playerGroups = exports.ox_core.GetPlayerData()?.groups or {} 2 | 3 | AddEventHandler('ox:playerLoaded', function(data) 4 | playerGroups = data.groups 5 | end) 6 | 7 | RegisterNetEvent('ox:setGroup', function(name, grade) 8 | if source == '' then return end 9 | playerGroups[name] = grade 10 | end) 11 | 12 | local utils = require 'client.utils' 13 | 14 | ---@diagnostic disable-next-line: duplicate-set-field 15 | function utils.hasPlayerGotGroup(filter) 16 | local _type = type(filter) 17 | 18 | if _type == 'string' then 19 | local grade = playerGroups[filter] 20 | 21 | if grade then 22 | return true 23 | end 24 | elseif _type == 'table' then 25 | local tabletype = table.type(filter) 26 | 27 | if tabletype == 'hash' then 28 | for name, grade in pairs(filter) do 29 | local playerGrade = playerGroups[name] 30 | 31 | if playerGrade and grade <= playerGrade then 32 | return true 33 | end 34 | end 35 | elseif tabletype == 'array' then 36 | for i = 1, #filter do 37 | local name = filter[i] 38 | local grade = playerGroups[name] 39 | 40 | if grade then 41 | return true 42 | end 43 | end 44 | end 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /[ox]/ox_target/client/state.lua: -------------------------------------------------------------------------------- 1 | local state = {} 2 | 3 | local isActive = false 4 | 5 | ---@return boolean 6 | function state.isActive() 7 | return isActive 8 | end 9 | 10 | ---@param value boolean 11 | function state.setActive(value) 12 | isActive = value 13 | 14 | if value then 15 | SendNuiMessage('{"event": "visible", "state": true}') 16 | end 17 | end 18 | 19 | local nuiFocus = false 20 | 21 | ---@return boolean 22 | function state.isNuiFocused() 23 | return nuiFocus 24 | end 25 | 26 | ---@param value boolean 27 | function state.setNuiFocus(value, cursor) 28 | if value then SetCursorLocation(0.5, 0.5) end 29 | 30 | nuiFocus = value 31 | SetNuiFocus(value, cursor or false) 32 | SetNuiFocusKeepInput(value) 33 | end 34 | 35 | local isDisabled = false 36 | 37 | ---@return boolean 38 | function state.isDisabled() 39 | return isDisabled 40 | end 41 | 42 | ---@param value boolean 43 | function state.setDisabled(value) 44 | isDisabled = value 45 | end 46 | 47 | return state 48 | -------------------------------------------------------------------------------- /[ox]/ox_target/fxmanifest.lua: -------------------------------------------------------------------------------- 1 | -- FX Information 2 | fx_version 'cerulean' 3 | use_experimental_fxv2_oal 'yes' 4 | lua54 'yes' 5 | game 'gta5' 6 | 7 | -- Resource Information 8 | name 'ox_target' 9 | author 'Overextended' 10 | version '1.13.0' 11 | repository 'https://github.com/overextended/ox_target' 12 | description '' 13 | 14 | -- Manifest 15 | ui_page 'web/index.html' 16 | 17 | shared_scripts { 18 | '@ox_lib/init.lua', 19 | } 20 | 21 | client_scripts { 22 | '@ox_lib/init.lua', 23 | 'client/main.lua', 24 | } 25 | 26 | server_scripts { 27 | 'server/main.lua' 28 | } 29 | 30 | files { 31 | 'web/**', 32 | 'locales/*.json', 33 | 'client/api.lua', 34 | 'client/utils.lua', 35 | 'client/state.lua', 36 | 'client/debug.lua', 37 | 'client/defaults.lua', 38 | 'client/framework/ox.lua', 39 | 'client/framework/esx.lua', 40 | 'client/framework/qb.lua', 41 | 'client/compat/qtarget.lua', 42 | 'client/compat/qb-target.lua', 43 | } 44 | 45 | provide 'qtarget' 46 | provide 'qb-target' 47 | 48 | dependency 'ox_lib' 49 | -------------------------------------------------------------------------------- /[ox]/ox_target/locales/cs.json: -------------------------------------------------------------------------------- 1 | { 2 | "toggle_front_driver_door": "Přední dveře řidiče", 3 | "toggle_front_passenger_door": "Přední dveře spolujezdce", 4 | "toggle_rear_driver_door": "Zadní dveře řidiče", 5 | "toggle_rear_passenger_door": "Zadní dveře spolujezdce", 6 | "toggle_hood": "Kapota", 7 | "toggle_trunk": "Kufr", 8 | "debug_box": "(Debug) Box", 9 | "debug_sphere": "(Debug) Koule", 10 | "debug_police_car": "Policejní auto", 11 | "debug_ped": "(Debug) Ped", 12 | "debug_vehicle": "(Debug) Vozidlo", 13 | "debug_object": "(Debug) Objekt", 14 | "toggle_targeting": "Výběr zaměření" 15 | } 16 | -------------------------------------------------------------------------------- /[ox]/ox_target/locales/da.json: -------------------------------------------------------------------------------- 1 | { 2 | "toggle_front_driver_door": "Åben/Luk forreste førerdør", 3 | "toggle_front_passenger_door": "Åben/Luk forreste passagerdør", 4 | "toggle_rear_driver_door": "Åben/Luk bageste førerdør", 5 | "toggle_rear_passenger_door": "Åben/Luk bageste passagerdør", 6 | "toggle_hood": "Åben/Luk motorhjelm", 7 | "toggle_trunk": "Åben/Luk bagagerum", 8 | "debug_box": "(Debug) Boks", 9 | "debug_sphere": "(Debug) Kugle", 10 | "debug_police_car": "Politi Bil", 11 | "debug_ped": "(Debug) Ped", 12 | "debug_vehicle": "(Debug) Køretøj", 13 | "debug_object": "(Debug) Objekt", 14 | "toggle_targeting": "Slå targeting fra/til" 15 | } 16 | -------------------------------------------------------------------------------- /[ox]/ox_target/locales/de.json: -------------------------------------------------------------------------------- 1 | { 2 | "toggle_front_driver_door": "Vordere Fahrertür umschalten", 3 | "toggle_front_passenger_door": "Vordere Beifahrertür umschalten", 4 | "toggle_rear_driver_door": "Hintere Fahrertür umschalten", 5 | "toggle_rear_passenger_door": "Hintere Beifahrertür umschalten", 6 | "toggle_hood": "Motorhaube umschalten", 7 | "toggle_trunk": "Kofferraum umschalten", 8 | "debug_box": "(Debug) Box", 9 | "debug_sphere": "(Debug) Sphäre", 10 | "debug_police_car": "Polizeiauto", 11 | "debug_ped": "(Debug) Ped", 12 | "debug_vehicle": "(Debug) Fahrzeug", 13 | "debug_object": "(Debug) Objekt", 14 | "toggle_targeting": "Zielen umschalten" 15 | } 16 | -------------------------------------------------------------------------------- /[ox]/ox_target/locales/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "toggle_front_driver_door": "Toggle front driver door", 3 | "toggle_front_passenger_door": "Toggle front passenger door", 4 | "toggle_rear_driver_door": "Toggle rear driver door", 5 | "toggle_rear_passenger_door": "Toggle rear passenger door", 6 | "toggle_hood": "Toggle hood", 7 | "toggle_trunk": "Toggle trunk", 8 | "debug_box": "(Debug) Box", 9 | "debug_sphere": "(Debug) Sphere", 10 | "debug_police_car": "Police car", 11 | "debug_ped": "(Debug) Ped", 12 | "debug_vehicle": "(Debug) Vehicle", 13 | "debug_object": "(Debug) Object", 14 | "toggle_targeting": "Toggle targeting", 15 | "go_back": "Go back" 16 | } 17 | -------------------------------------------------------------------------------- /[ox]/ox_target/locales/es.json: -------------------------------------------------------------------------------- 1 | { 2 | "toggle_front_driver_door": "Abrir/Cerrar puerta delantera del conductor", 3 | "toggle_front_passenger_door": "Abrir/Cerrar puerta delantera del pasajero", 4 | "toggle_rear_driver_door": "Abrir/Cerrar puerta trasera del conductor", 5 | "toggle_rear_passenger_door": "Abrir/Cerrar puerta trasera del pasajero", 6 | "toggle_hood": "Abrir/Cerrar capó", 7 | "toggle_trunk": "Abrir/Cerrar maletero", 8 | "debug_box": "(Debug) Caja", 9 | "debug_sphere": "(Debug) Esfera", 10 | "debug_police_car": "Coche de policía", 11 | "debug_ped": "(Debug) Peatón", 12 | "debug_vehicle": "(Debug) Vehículo", 13 | "debug_object": "(Debug) Objeto", 14 | "toggle_targeting": "Activar/Desactivar apuntado" 15 | } 16 | -------------------------------------------------------------------------------- /[ox]/ox_target/locales/et.json: -------------------------------------------------------------------------------- 1 | { 2 | "toggle_front_driver_door": "Ava/sulge eesuks", 3 | "toggle_front_passenger_door": "Ava/sulge eesuks", 4 | "toggle_rear_driver_door": "Ava/sulge tagauks", 5 | "toggle_rear_passenger_door": "Ava/sulge tagauks", 6 | "toggle_hood": "Ava/sulge kapott", 7 | "toggle_trunk": "Ava/sulge pagasiruum", 8 | "debug_box": "(Debug) Kast", 9 | "debug_sphere": "(Debug) Kera", 10 | "debug_police_car": "Politseiauto", 11 | "debug_ped": "(Debug) Ped", 12 | "debug_vehicle": "(Debug) Sõiduk", 13 | "debug_object": "(Debug) Objekt", 14 | "toggle_targeting": "Näita kolmandat silma" 15 | } 16 | -------------------------------------------------------------------------------- /[ox]/ox_target/locales/fi.json: -------------------------------------------------------------------------------- 1 | { 2 | "toggle_front_driver_door": "Avaa/Sulje kuljettajan etuovi", 3 | "toggle_front_passenger_door": "Avaa/Sulje repsikan etuovi", 4 | "toggle_rear_driver_door": "Avaa/Sulje kuljettajan takaovi", 5 | "toggle_rear_passenger_door": "Avaa/Sulje repsikan takaovi", 6 | "toggle_hood": "Avaa/Sulje konepelti", 7 | "toggle_trunk": "Avaa/Sulje takakontti", 8 | "debug_box": "(Debug) Laatikko", 9 | "debug_sphere": "(Debug) Ympyrä", 10 | "debug_police_car": "Poliisiauto", 11 | "debug_ped": "(Debug) Ped", 12 | "debug_vehicle": "(Debug) Ajoneuvo", 13 | "debug_object": "(Debug) Objekti", 14 | "toggle_targeting": "Päällä/Pois tähtäys" 15 | } 16 | -------------------------------------------------------------------------------- /[ox]/ox_target/locales/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "toggle_front_driver_door": "Porte conducteur avant", 3 | "toggle_front_passenger_door": "Porte passager avant", 4 | "toggle_rear_driver_door": "Porte conducteur arrière", 5 | "toggle_rear_passenger_door": "Porte passager arrière", 6 | "toggle_hood": "Capot", 7 | "toggle_trunk": "Coffre", 8 | "debug_box": "(Debug) Box", 9 | "debug_sphere": "(Debug) Sphère", 10 | "debug_police_car": "Véhicule de police", 11 | "debug_ped": "(Debug) Ped", 12 | "debug_vehicle": "(Debug) Véhicule", 13 | "debug_object": "(Debug) Objet", 14 | "toggle_targeting": "Afficher le système d'interaction" 15 | } 16 | -------------------------------------------------------------------------------- /[ox]/ox_target/locales/hr.json: -------------------------------------------------------------------------------- 1 | { 2 | "toggle_front_driver_door": "Prednja lijeva vrata", 3 | "toggle_front_passenger_door": "Prednja desna vrata", 4 | "toggle_rear_driver_door": "Zadnja lijeva vrata", 5 | "toggle_rear_passenger_door": "Zadnja desna vrata", 6 | "toggle_hood": "Hauba", 7 | "toggle_trunk": "Gepek", 8 | "debug_box": "(Debug) Kocka (Box)", 9 | "debug_sphere": "(Debug) Sfera (Sphere)", 10 | "debug_police_car": "Policijski auto", 11 | "debug_ped": "(Debug) Ped", 12 | "debug_vehicle": "(Debug) Auto", 13 | "debug_object": "(Debug) Objekt", 14 | "toggle_targeting": "Upali/Ugasi Target sistem" 15 | } 16 | -------------------------------------------------------------------------------- /[ox]/ox_target/locales/hu.json: -------------------------------------------------------------------------------- 1 | { 2 | "toggle_front_driver_door": "Sofőroldali ajtó nyitása/zárása", 3 | "toggle_front_passenger_door": "Anyósülés oldali ajtó nyitása/zárása", 4 | "toggle_rear_driver_door": "Sofőroldali hátsó ajtó nyitása/zárása", 5 | "toggle_rear_passenger_door": "Anyósülés oldali hátsó ajtó nyitása/zárása", 6 | "toggle_hood": "Motorháztető nyitása/zárása", 7 | "toggle_trunk": "Csomagtartó nyitása/zárása", 8 | "debug_box": "(Hibakeresés) Doboz", 9 | "debug_sphere": "(Hibakeresés) Gömb", 10 | "debug_police_car": "(Hibakeresés) Rendőrautó", 11 | "debug_ped": "(Hibakeresés) Entitás", 12 | "debug_vehicle": "(Hibakeresés) Jármű", 13 | "debug_object": "(Hibakeresés) Objekt", 14 | "toggle_targeting": "Célzó be- és kikapcsolása", 15 | "go_back": "Vissza" 16 | } 17 | -------------------------------------------------------------------------------- /[ox]/ox_target/locales/id.json: -------------------------------------------------------------------------------- 1 | { 2 | "toggle_front_driver_door": "Tombol pintu pengemudi depan", 3 | "toggle_front_passenger_door": "Tombol pintu penumpang depan", 4 | "toggle_rear_driver_door": "Tombol pintu pengemudi belakang", 5 | "toggle_rear_passenger_door": "Tombol pintu penumpang belakang", 6 | "toggle_hood": "Tombol kap", 7 | "toggle_trunk": "Tombol bagasi", 8 | "debug_box": "(Debug) Kotak", 9 | "debug_sphere": "(Debug) Bola", 10 | "debug_police_car": "Mobil polisi", 11 | "debug_ped": "(Debug) Ped", 12 | "debug_vehicle": "(Debug) Kendaraan", 13 | "debug_object": "(Debug) Objek", 14 | "toggle_targeting": "Tombol penargetan" 15 | } 16 | -------------------------------------------------------------------------------- /[ox]/ox_target/locales/nl.json: -------------------------------------------------------------------------------- 1 | { 2 | "toggle_front_driver_door": "Toggle bestuurdersdeur", 3 | "toggle_front_passenger_door": "Toggle bijrijdersdeur", 4 | "toggle_rear_driver_door": "Toggle achterdeur links", 5 | "toggle_rear_passenger_door": "Toggle achterdeur rechts", 6 | "toggle_hood": "Toggle motorkap", 7 | "toggle_trunk": "Toggle kofferbak", 8 | "debug_box": "(Debug) Doos", 9 | "debug_sphere": "(Debug) Bol", 10 | "debug_police_car": "Politie voertuig", 11 | "debug_ped": "(Debug) Ped", 12 | "debug_vehicle": "(Debug) Voertuig", 13 | "debug_object": "(Debug) Object", 14 | "toggle_targeting": "Toggle richten" 15 | } 16 | -------------------------------------------------------------------------------- /[ox]/ox_target/locales/pl.json: -------------------------------------------------------------------------------- 1 | { 2 | "toggle_front_driver_door": "Przednie drzwi kierowcy", 3 | "toggle_front_passenger_door": "Przednie drzwi pasażera", 4 | "toggle_rear_driver_door": "Tylne drzwi kierowcy", 5 | "toggle_rear_passenger_door": "Tylne drzwi pasażera", 6 | "toggle_hood": "Maska", 7 | "toggle_trunk": "Bagażnik", 8 | "debug_box": "(Debug) Blok", 9 | "debug_sphere": "(Debug) Kula", 10 | "debug_police_car": "Radiowóz", 11 | "debug_ped": "(Debug) Ped", 12 | "debug_vehicle": "(Debug) Pojazd", 13 | "debug_object": "(Debug) Objekt", 14 | "toggle_targeting": "Przełącz targetowanie" 15 | } 16 | -------------------------------------------------------------------------------- /[ox]/ox_target/locales/sl.json: -------------------------------------------------------------------------------- 1 | { 2 | "toggle_front_driver_door": "Odpri/Zapri leva sprednja vrata", 3 | "toggle_front_passenger_door": "Odpri/Zapri desna sprednja vrata", 4 | "toggle_rear_driver_door": "Odpri/Zapri leva zadnja vrata", 5 | "toggle_rear_passenger_door": "Odpri/Zapri desna zadnja vrata", 6 | "toggle_hood": "Odpri/Zapri pokrov motorja", 7 | "toggle_trunk": "Odpri/Zapri prtljažnik", 8 | "debug_box": "(Debug) Kvadrat", 9 | "debug_sphere": "(Debug) Krog", 10 | "debug_police_car": "Policijsko vozilo", 11 | "debug_ped": "(Debug) Pešec", 12 | "debug_vehicle": "(Debug) Vozilo", 13 | "debug_object": "(Debug) Predmet", 14 | "toggle_targeting": "Vklopi/Izklopi tretje oko" 15 | } 16 | -------------------------------------------------------------------------------- /[ox]/ox_target/locales/zh-cn.json: -------------------------------------------------------------------------------- 1 | { 2 | "toggle_front_driver_door": "开关左前车门", 3 | "toggle_front_passenger_door": "开关左后车门", 4 | "toggle_rear_driver_door": "开关右前车门", 5 | "toggle_rear_passenger_door": "开关右后车门", 6 | "toggle_hood": "打开引擎盖", 7 | "toggle_trunk": "打开后备箱", 8 | "debug_box": "(Debug) 箱子", 9 | "debug_sphere": "(Debug) 球", 10 | "debug_police_car": "警车", 11 | "debug_ped": "(Debug) Ped", 12 | "debug_vehicle": "(Debug) 车辆", 13 | "debug_object": "(Debug) 对象", 14 | "toggle_targeting": "交互菜单" 15 | } 16 | -------------------------------------------------------------------------------- /[ox]/ox_target/locales/zh-tw.json: -------------------------------------------------------------------------------- 1 | { 2 | "toggle_front_driver_door": "開關司機側前門", 3 | "toggle_front_passenger_door": "開關乘客側前門", 4 | "toggle_rear_driver_door": "開關駕駛側後門", 5 | "toggle_rear_passenger_door": "開關乘客側後門", 6 | "toggle_hood": "開關引擎蓋", 7 | "toggle_trunk": "開關車廂", 8 | "debug_box": "(Debug) Box", 9 | "debug_sphere": "(Debug) Sphere", 10 | "debug_police_car": "Police car", 11 | "debug_ped": "(Debug) Ped", 12 | "debug_vehicle": "(Debug) Vehicle", 13 | "debug_object": "(Debug) Object", 14 | "toggle_targeting": "開關目標選擇" 15 | } 16 | -------------------------------------------------------------------------------- /[ox]/ox_target/server/main.lua: -------------------------------------------------------------------------------- 1 | lib.versionCheck('overextended/ox_target') 2 | lib.checkDependency('ox_lib', '3.0.0', true) 3 | 4 | ---@type table 5 | local entityStates = {} 6 | 7 | ---@param netId number 8 | RegisterNetEvent('ox_target:setEntityHasOptions', function(netId) 9 | local entity = Entity(NetworkGetEntityFromNetworkId(netId)) 10 | entity.state.hasTargetOptions = true 11 | entityStates[netId] = entity 12 | end) 13 | 14 | CreateThread(function() 15 | local arr = {} 16 | local num = 0 17 | 18 | while true do 19 | Wait(10000) 20 | 21 | for netId, entity in pairs(entityStates) do 22 | if not DoesEntityExist(entity.__data) or not entity.state.hasTargetOptions then 23 | entityStates[netId] = nil 24 | num += 1 25 | 26 | arr[num] = netId 27 | end 28 | end 29 | 30 | if num > 0 then 31 | TriggerClientEvent('ox_target:removeEntity', -1, arr) 32 | table.wipe(arr) 33 | 34 | num = 0 35 | end 36 | end 37 | end) 38 | -------------------------------------------------------------------------------- /[ox]/ox_target/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 |
10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /[ox]/ox_target/web/js/createOptions.js: -------------------------------------------------------------------------------- 1 | import { fetchNui } from "./fetchNui.js"; 2 | 3 | const optionsWrapper = document.getElementById("options-wrapper"); 4 | 5 | function onClick() { 6 | // when nuifocus is disabled after a click, the hover event is never released 7 | this.style.pointerEvents = "none"; 8 | 9 | fetchNui("select", [this.targetType, this.targetId, this.zoneId]); 10 | // is there a better way to handle this? probably 11 | setTimeout(() => (this.style.pointerEvents = "auto"), 100); 12 | } 13 | 14 | export function createOptions(type, data, id, zoneId) { 15 | if (data.hide) return; 16 | 17 | const option = document.createElement("div"); 18 | const iconElement = ``; 21 | 22 | option.innerHTML = `${iconElement}

${data.label}

`; 23 | option.className = "option-container"; 24 | option.targetType = type; 25 | option.targetId = id; 26 | option.zoneId = zoneId; 27 | 28 | option.addEventListener("click", onClick); 29 | optionsWrapper.appendChild(option); 30 | } 31 | -------------------------------------------------------------------------------- /[ox]/ox_target/web/js/fetchNui.js: -------------------------------------------------------------------------------- 1 | const resource = GetParentResourceName(); 2 | 3 | export async function fetchNui(eventName, data) { 4 | const resp = await fetch(`https://${resource}/${eventName}`, { 5 | method: 'post', 6 | headers: { 7 | 'Content-Type': 'application/json; charset=UTF-8', 8 | }, 9 | body: JSON.stringify(data), 10 | }); 11 | 12 | return await resp.json(); 13 | } 14 | -------------------------------------------------------------------------------- /[ox]/ox_target/web/js/main.js: -------------------------------------------------------------------------------- 1 | import { createOptions } from "./createOptions.js"; 2 | 3 | const optionsWrapper = document.getElementById("options-wrapper"); 4 | const body = document.body; 5 | const eye = document.getElementById("eyeSvg"); 6 | 7 | window.addEventListener("message", (event) => { 8 | optionsWrapper.innerHTML = ""; 9 | 10 | switch (event.data.event) { 11 | case "visible": { 12 | body.style.visibility = event.data.state ? "visible" : "hidden"; 13 | return eye.classList.remove("eye-hover"); 14 | } 15 | 16 | case "leftTarget": { 17 | return eye.classList.remove("eye-hover"); 18 | } 19 | 20 | case "setTarget": { 21 | eye.classList.add("eye-hover"); 22 | 23 | if (event.data.options) { 24 | for (const type in event.data.options) { 25 | event.data.options[type].forEach((data, id) => { 26 | createOptions(type, data, id + 1); 27 | }); 28 | } 29 | } 30 | 31 | if (event.data.zones) { 32 | for (let i = 0; i < event.data.zones.length; i++) { 33 | event.data.zones[i].forEach((data, id) => { 34 | createOptions("zones", data, id + 1, i + 1); 35 | }); 36 | } 37 | } 38 | } 39 | } 40 | }); 41 | -------------------------------------------------------------------------------- /oxmysql/build.js: -------------------------------------------------------------------------------- 1 | const { build } = require('esbuild'); 2 | 3 | build({ 4 | entryPoints: ['./src/index.ts'], 5 | outfile: 'dist/build.js', 6 | bundle: true, 7 | platform: 'node', 8 | logLevel: 'info', 9 | }); 10 | -------------------------------------------------------------------------------- /oxmysql/fxmanifest.lua: -------------------------------------------------------------------------------- 1 | fx_version 'cerulean' 2 | game 'common' 3 | 4 | name 'oxmysql' 5 | description 'Database wrapper for FXServer utilising node-mysql2 offering improved performance and security.' 6 | version '2.7.4' 7 | url 'https://github.com/overextended/oxmysql' 8 | author 'overextended' 9 | 10 | dependencies { 11 | '/server:5104', 12 | } 13 | 14 | client_script 'ui.lua' 15 | server_script 'dist/build.js' 16 | 17 | files { 18 | 'web/build/index.html', 19 | 'web/build/**/*' 20 | } 21 | 22 | ui_page 'web/build/index.html' 23 | 24 | provide 'mysql-async' 25 | provide 'ghmattimysql' 26 | 27 | convar_category 'OxMySQL' { 28 | 'Configuration', 29 | { 30 | { 'Connection string', 'mysql_connection_string', 'CV_STRING', 'mysql://user:password@localhost/database' }, 31 | { 'Debug', 'mysql_debug', 'CV_BOOL', 'false' } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /oxmysql/lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": ["web"], 3 | "npmClient": "pnpm", 4 | "version": "0.0.0" 5 | } 6 | -------------------------------------------------------------------------------- /oxmysql/lib/README.md: -------------------------------------------------------------------------------- 1 | # OxMySQL exports wrapper for FiveM 2 | 3 | Types are fully supported and you will get intellisense on the `oxmysql` object when using it. 4 | 5 | ## Installation 6 | 7 | ```yaml 8 | # With pnpm 9 | pnpm add @overextended/oxmysql 10 | 11 | # With Yarn 12 | yarn add @overextended/oxmysql 13 | 14 | # With npm 15 | npm install @overextended/oxmysql 16 | ``` 17 | 18 | ## Usage 19 | 20 | Import as module: 21 | 22 | ```js 23 | import { oxmysql } from '@overextended/oxmysql'; 24 | ``` 25 | 26 | Import with require: 27 | 28 | ```js 29 | const { oxmysql } = require('@overextended/oxmysql'); 30 | ``` 31 | 32 | ## Documentation 33 | 34 | [View documentation](https://overextended.github.io/docs/oxmysql) 35 | 36 | ```js 37 | oxmysql.scalar('SELECT username FROM users', (result) => { 38 | console.log(result) 39 | }).catch(console.error) 40 | 41 | oxmysql.scalar('SELECT username FROM users').then((result) => { 42 | console.log(result) 43 | }).catch(console.error) 44 | 45 | const result = await oxmysql.scalar('SELECT username FROM users').catch(console.error) 46 | console.log(result) 47 | ``` 48 | 49 | ## License 50 | 51 | LGPL-3.0 52 | -------------------------------------------------------------------------------- /oxmysql/lib/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@overextended/oxmysql", 3 | "version": "1.3.0", 4 | "description": "Exports wrapper for oxmysql", 5 | "types": "MySQL.d.ts", 6 | "main": "MySQL.js", 7 | "scripts": { 8 | "prepublish": "tsc" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "git+https://github.com/overextended/oxmysql.git" 13 | }, 14 | "keywords": [ 15 | "fivem", 16 | "oxmysql", 17 | "sql" 18 | ], 19 | "author": "Overextended", 20 | "license": "LGPL-3.0", 21 | "bugs": { 22 | "url": "https://github.com/overextended/oxmysql/issues" 23 | }, 24 | "homepage": "https://github.com/overextended/oxmysql#readme" 25 | } 26 | -------------------------------------------------------------------------------- /oxmysql/lib/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "outDir": ".", 5 | "strict": true, 6 | "module": "CommonJS", 7 | "types": ["@citizenfx/server", "@types/node"], 8 | "declaration": true, 9 | "sourceMap": true, 10 | "target": "ESNext", 11 | "allowJs": true, 12 | "lib": ["ESNext"], 13 | "noEmitOnError": false, 14 | "resolveJsonModule": true, 15 | "esModuleInterop": true, 16 | "rootDir": ".", 17 | "moduleResolution": "node", 18 | "experimentalDecorators": true, 19 | "noImplicitAny": false, 20 | "noEmit": false 21 | }, 22 | "include": ["MySQL.ts"], 23 | "exclude": ["**/node_modules"] 24 | } 25 | -------------------------------------------------------------------------------- /oxmysql/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "oxmysql", 3 | "version": "2.3.4", 4 | "description": "FXServer to MySQL communication via node-mysql2", 5 | "repository": "git@github.com:overextended/oxmysql.git", 6 | "author": "dunak-debug <19434539+dunak-debug@users.noreply.github.com>", 7 | "license": "LGPL-3.0-or-later", 8 | "main": "lib/MySQL.js", 9 | "types": "lib/MySQL.d.ts", 10 | "files": [ 11 | "lib/MySQL.js", 12 | "lib/MySQL.d.ts" 13 | ], 14 | "scripts": { 15 | "build": "pnpm build:root && lerna run build", 16 | "build:root": "node build.js && cd lib && tsc", 17 | "watch": "esbuild --watch --bundle --platform=node --target=node16.9.1 src/index.ts --outfile=dist/build.js", 18 | "lib": "tsc --project lib/tsconfig.lib.json", 19 | "bootstrap": "lerna bootstrap", 20 | "postinstall": "patch-package && pnpm bootstrap" 21 | }, 22 | "dependencies": { 23 | "@citizenfx/server": "2.0.5132-1", 24 | "@milahu/patch-package": "^6.4.14", 25 | "@types/node": "^17.0.45", 26 | "mysql2": "^3.5.1", 27 | "named-placeholders": "^1.1.3", 28 | "node-fetch": "^3.3.1", 29 | "prettier": "^2.8.8" 30 | }, 31 | "devDependencies": { 32 | "esbuild": "^0.14.54", 33 | "lerna": "^4.0.0", 34 | "postinstall-postinstall": "^2.1.0", 35 | "pretty-quick": "^3.1.3", 36 | "typescript": "^4.9.5" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /oxmysql/src/database/index.ts: -------------------------------------------------------------------------------- 1 | import { createPool, Pool, RowDataPacket } from 'mysql2/promise'; 2 | import { connectionOptions, mysql_transaction_isolation_level, setDebug } from '../config'; 3 | 4 | let pool: Pool; 5 | let isServerConnected = false; 6 | let dbVersion = ''; 7 | 8 | export async function waitForConnection() { 9 | if (!isServerConnected) { 10 | return await new Promise((resolve) => { 11 | (function wait() { 12 | if (isServerConnected) { 13 | return resolve(true); 14 | } 15 | setTimeout(wait); 16 | })(); 17 | }); 18 | } 19 | } 20 | 21 | function setConnectionPool() { 22 | pool = createPool(connectionOptions); 23 | 24 | pool.on('connection', (connection) => { 25 | connection.query(mysql_transaction_isolation_level); 26 | }); 27 | } 28 | 29 | setInterval(() => { 30 | setDebug(); 31 | }, 1000); 32 | 33 | setTimeout(async () => { 34 | setDebug(); 35 | setConnectionPool(); 36 | 37 | try { 38 | const connection = await pool.getConnection(); 39 | const [result] = await > connection.query('SELECT VERSION() as version') 40 | dbVersion = `^5[${result[0].version}]` 41 | connection.release(); 42 | 43 | console.log(`${dbVersion} ^2Database server connection established!^0`); 44 | isServerConnected = true; 45 | } catch (err: any) { 46 | console.log( 47 | `^3Unable to establish a connection to the database (${err.code})!\n^1Error ${err.errno}: ${err.message}^0` 48 | ); 49 | } 50 | }); 51 | 52 | export { pool, isServerConnected, dbVersion }; 53 | -------------------------------------------------------------------------------- /oxmysql/src/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "lib": ["ESNext"], 5 | "module": "CommonJS", 6 | "target": "ESNext", 7 | "moduleResolution": "node", 8 | "types": ["@citizenfx/server", "@types/node"] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /oxmysql/src/types/index.ts: -------------------------------------------------------------------------------- 1 | import { RowDataPacket, ResultSetHeader, OkPacket } from 'mysql2'; 2 | 3 | type SQLResponse = RowDataPacket[][] | RowDataPacket[] | OkPacket | OkPacket[] | ResultSetHeader; 4 | 5 | export type QueryResponse = SQLResponse | SQLResponse[] | RowDataPacket; 6 | 7 | export type QueryType = 'execute' | 'insert' | 'update' | 'scalar' | 'single' | null; 8 | 9 | export type TransactionQuery = { 10 | query: string | string[]; 11 | parameters?: CFXParameters; 12 | values?: CFXParameters; 13 | }; 14 | 15 | // working with this type is impossible but at least we can pretend to be strictly typed 16 | export type CFXParameters = any[]; 17 | 18 | export type CFXCallback = (result: unknown, err?: string) => void; 19 | -------------------------------------------------------------------------------- /oxmysql/src/update/index.ts: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch'; 2 | 3 | (() => { 4 | if (GetConvarInt('mysql_versioncheck', 1) === 0) return; 5 | 6 | const resourceName = GetCurrentResourceName(); 7 | const currentVersion = GetResourceMetadata(resourceName, 'version', 0)?.match(/(\d)\.(\d)\.(\d)/); 8 | 9 | if (!currentVersion) return console.log(`^1Unable to determine current resource version for '${resourceName}'^0`); 10 | 11 | setTimeout(async () => { 12 | const response = await fetch(`https://api.github.com/repos/overextended/oxmysql/releases/latest`); 13 | if (response.status !== 200) return; 14 | 15 | const release = (await response.json()) as any; 16 | if (release.prerelease) return; 17 | 18 | const latestVersion = release.tag_name.match(/(\d)\.(\d)\.(\d)/); 19 | if (!latestVersion || latestVersion[0] === currentVersion[0]) return; 20 | 21 | for (let i = 1; i < currentVersion.length; i++) { 22 | const current = parseInt(currentVersion[i]); 23 | const latest = parseInt(latestVersion[i]); 24 | 25 | if (current !== latest) { 26 | if (current < latest) 27 | return console.log( 28 | `^3An update is available for ${resourceName} (current version: ${currentVersion[0]})\r\n${release.html_url}^0` 29 | ); 30 | else break; 31 | } 32 | } 33 | }, 1000); 34 | })(); 35 | -------------------------------------------------------------------------------- /oxmysql/src/utils/parseArguments.ts: -------------------------------------------------------------------------------- 1 | import type { CFXParameters } from '../types'; 2 | import { convertNamedPlaceholders } from '../config'; 3 | 4 | export const parseArguments = (query: string, parameters?: CFXParameters): [string, CFXParameters] => { 5 | if (typeof query !== 'string') throw new Error(`Expected query to be a string but received ${typeof query} instead.`); 6 | 7 | if (convertNamedPlaceholders && parameters && typeof parameters === 'object' && !Array.isArray(parameters)) 8 | if (query.includes(':') || query.includes('@')) { 9 | const placeholders = convertNamedPlaceholders(query, parameters); 10 | query = placeholders[0]; 11 | parameters = placeholders[1]; 12 | } 13 | 14 | if (!parameters || typeof parameters === 'function') parameters = []; 15 | 16 | if (parameters && !Array.isArray(parameters)) { 17 | let arr: unknown[] = []; 18 | Object.entries(parameters).forEach((entry) => (arr[parseInt(entry[0]) - 1] = entry[1])); 19 | parameters = arr; 20 | } else { 21 | const queryParams = query.match(/\?(?!\?)/g); 22 | 23 | if (queryParams !== null) { 24 | if (parameters.length === 0) { 25 | for (let i = 0; i < queryParams.length; i++) parameters[i] = null; 26 | return [query, parameters]; 27 | } 28 | const diff = queryParams.length - parameters.length; 29 | 30 | if (diff > 0) { 31 | for (let i = 0; i < diff; i++) parameters[queryParams.length + i] = null; 32 | } else if (diff < 0) { 33 | throw new Error(`Expected ${queryParams.length} parameters, but received ${parameters.length}.`); 34 | } 35 | } 36 | } 37 | 38 | return [query, parameters]; 39 | }; 40 | -------------------------------------------------------------------------------- /oxmysql/src/utils/parseResponse.ts: -------------------------------------------------------------------------------- 1 | import { OkPacket, RowDataPacket } from 'mysql2'; 2 | import type { QueryResponse, QueryType } from '../types'; 3 | 4 | const isOkPacket = (result: QueryResponse, insertId?: boolean): result is OkPacket => 5 | insertId ? (result as OkPacket).insertId !== undefined : (result as OkPacket).affectedRows !== undefined; 6 | 7 | const isRowDataPacket = (result: QueryResponse): result is RowDataPacket[] => 8 | (result as RowDataPacket[]).length !== undefined; 9 | 10 | const isRowDataPacketArray = (result: QueryResponse): result is RowDataPacket[][] => 11 | (result as RowDataPacket[][]).length !== undefined && 12 | (result as RowDataPacket[][])[0] !== undefined && 13 | Object.values((result as RowDataPacket[][])[0])[0] !== undefined; 14 | 15 | export const parseResponse = (type: QueryType, result: QueryResponse): any => { 16 | switch (type) { 17 | case 'insert': 18 | return isOkPacket(result) ? result.insertId : null; 19 | 20 | case 'update': 21 | return isOkPacket(result) ? result.affectedRows : null; 22 | 23 | case 'single': 24 | return isRowDataPacket(result) ? result[0] : null; 25 | 26 | case 'scalar': 27 | return isRowDataPacketArray(result) ? Object.values(result[0])[0] : null; 28 | 29 | default: 30 | return result || null; 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /oxmysql/src/utils/parseTransaction.ts: -------------------------------------------------------------------------------- 1 | import { CFXParameters, TransactionQuery } from '../types'; 2 | import { parseArguments } from './parseArguments'; 3 | 4 | const isTransactionQuery = (query: TransactionQuery | string): query is TransactionQuery => 5 | (query as TransactionQuery).query !== undefined; 6 | 7 | export const parseTransaction = (queries: TransactionQuery, parameters: CFXParameters) => { 8 | if (!Array.isArray(queries)) throw new Error(`Transaction queries must be array, received '${typeof queries}'.`); 9 | 10 | if (!parameters || typeof parameters === 'function') parameters = []; 11 | 12 | if (Array.isArray(queries[0])) { 13 | const transactions = queries.map((query) => { 14 | if (typeof query[1] !== 'object') 15 | throw new Error(`Transaction parameters must be array or object, received '${typeof query[1]}'.`); 16 | const [parsedQuery, parsedParameters] = parseArguments(query[0], query[1]); 17 | 18 | return { query: parsedQuery, params: parsedParameters }; 19 | }); 20 | 21 | return transactions; 22 | } 23 | 24 | const transactions = queries.map((query) => { 25 | if (!isTransactionQuery(query) && !(query.parameters || query.values)) { 26 | return { query: query }; 27 | } 28 | 29 | const [parsedQuery, parsedParameters] = parseArguments( 30 | isTransactionQuery(query) ? query.query : query, 31 | isTransactionQuery(query) ? query.parameters || query.values : parameters 32 | ); 33 | 34 | return { query: parsedQuery, params: parsedParameters }; 35 | }); 36 | 37 | return transactions; 38 | }; 39 | -------------------------------------------------------------------------------- /oxmysql/src/utils/scheduleTick.ts: -------------------------------------------------------------------------------- 1 | const resourceName = GetCurrentResourceName(); 2 | 3 | export async function scheduleTick() { 4 | ScheduleResourceTick(resourceName); 5 | } 6 | -------------------------------------------------------------------------------- /oxmysql/src/utils/setCallback.ts: -------------------------------------------------------------------------------- 1 | import type { CFXCallback, CFXParameters } from '../types'; 2 | 3 | export const setCallback = (parameters?: CFXParameters | CFXCallback, cb?: CFXCallback) => { 4 | if (cb && typeof cb === 'function') return cb; 5 | if (parameters && typeof parameters === 'function') return parameters; 6 | }; 7 | -------------------------------------------------------------------------------- /oxmysql/src/utils/typeCast.ts: -------------------------------------------------------------------------------- 1 | import { FieldPacket } from 'mysql2'; 2 | 3 | const BINARY_CHARSET = 63; 4 | 5 | type Field = { 6 | type: string; 7 | length: number; 8 | packet: FieldPacket; 9 | charset: number; 10 | string: () => string; 11 | buffer: () => number[]; 12 | }; 13 | 14 | export const typeCast = (field: Field, next: () => void) => { 15 | switch (field.type) { 16 | case 'DATETIME': 17 | case 'DATETIME2': 18 | case 'TIMESTAMP': 19 | case 'TIMESTAMP2': 20 | case 'NEWDATE': 21 | return new Date(field.string()).getTime(); 22 | case 'DATE': 23 | return new Date(field.string() + ' 00:00:00').getTime(); 24 | case 'TINY': 25 | return field.length === 1 ? field.string() === '1' : next(); 26 | case 'BIT': 27 | return field.length === 1 ? field.buffer()[0] === 1 : field.buffer()[0]; 28 | case 'TINY_BLOB': 29 | case 'MEDIUM_BLOB': 30 | case 'LONG_BLOB': 31 | case 'BLOB': 32 | if (field.charset === BINARY_CHARSET) { 33 | const value = field.buffer(); 34 | if (value === null) return [value] 35 | return [...value]; 36 | } 37 | return field.string(); 38 | default: 39 | return next(); 40 | } 41 | }; 42 | -------------------------------------------------------------------------------- /oxmysql/ui.lua: -------------------------------------------------------------------------------- 1 | RegisterNetEvent('oxmysql:openUi', function(data) 2 | SendNUIMessage({ 3 | action = 'openUI', 4 | data = data 5 | }) 6 | SetNuiFocus(true, true) 7 | end) 8 | 9 | RegisterNUICallback('exit', function(_, cb) 10 | cb(true) 11 | SetNuiFocus(false, false) 12 | end) 13 | 14 | RegisterNUICallback('fetchResource', function(data, cb) 15 | TriggerServerEvent('oxmysql:fetchResource', data) 16 | cb(true) 17 | end) 18 | 19 | RegisterNetEvent('oxmysql:loadResource', function(data) 20 | SendNUIMessage({ 21 | action = 'loadResource', 22 | data = data 23 | }) 24 | end) -------------------------------------------------------------------------------- /oxmysql/web/build/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite + Svelte + TS 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /oxmysql/web/build/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /oxmysql/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite + Svelte + TS 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /oxmysql/web/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "oxmysql", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "start": "vite", 8 | "start:game": "vite build --watch", 9 | "build": "vite build", 10 | "preview": "vite preview", 11 | "check": "svelte-check --tsconfig ./tsconfig.json" 12 | }, 13 | "devDependencies": { 14 | "@sveltejs/vite-plugin-svelte": "^2.0.3", 15 | "@tsconfig/svelte": "^3.0.0", 16 | "svelte": "^3.55.1", 17 | "svelte-check": "^2.10.3", 18 | "tslib": "^2.5.0", 19 | "typescript": "^4.9.3", 20 | "vite": "^4.2.0" 21 | }, 22 | "dependencies": { 23 | "@tabler/icons-svelte": "^2.10.0", 24 | "@tanstack/svelte-table": "^8.8.0", 25 | "autoprefixer": "^10.4.14", 26 | "chart.js": "^4.2.1", 27 | "postcss": "^8.4.21", 28 | "prettier": "^2.8.4", 29 | "prettier-plugin-svelte": "^2.9.0", 30 | "prettier-plugin-tailwindcss": "^0.2.5", 31 | "svelte-chartjs": "^3.1.2", 32 | "svelte-floating-ui": "^1.5.2", 33 | "svelte-portal": "^2.2.0", 34 | "tailwindcss": "^3.2.7", 35 | "tinro": "^0.6.12" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /oxmysql/web/postcss.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /oxmysql/web/public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /oxmysql/web/src/index.css: -------------------------------------------------------------------------------- 1 | @import url(https://use.typekit.net/wxh5ury.css); 2 | 3 | @tailwind base; 4 | @tailwind components; 5 | @tailwind utilities; 6 | 7 | * { 8 | margin: 0; 9 | padding: 0; 10 | } 11 | 12 | #app { 13 | width: 100vw; 14 | height: 100vh; 15 | } 16 | 17 | ::-webkit-scrollbar { 18 | width: 2px; 19 | } 20 | 21 | ::-webkit-scrollbar-track { 22 | background: #25262b; 23 | } 24 | 25 | ::-webkit-scrollbar-thumb { 26 | background: #909296; 27 | } 28 | 29 | ::-webkit-scrollbar-thumb:hover { 30 | background: #a6a7ab; 31 | } 32 | -------------------------------------------------------------------------------- /oxmysql/web/src/main.ts: -------------------------------------------------------------------------------- 1 | import './index.css'; 2 | import App from './App.svelte'; 3 | import { isEnvBrowser } from './utils/misc'; 4 | 5 | const app = new App({ 6 | target: document.getElementById('app'), 7 | }); 8 | 9 | if (isEnvBrowser()) { 10 | const root = document.getElementById('app'); 11 | 12 | // https://i.imgur.com/iPTAdYV.png - Night time img 13 | root!.style.backgroundImage = 'url("https://i.imgur.com/3pzRj9n.png")'; 14 | root!.style.backgroundSize = 'cover'; 15 | root!.style.backgroundRepeat = 'no-repeat'; 16 | root!.style.backgroundPosition = 'center'; 17 | } 18 | 19 | export default app; 20 | -------------------------------------------------------------------------------- /oxmysql/web/src/pages/resource/components/QueryTooltip.svelte: -------------------------------------------------------------------------------- 1 | 34 | 35 | 36 | {#if display && !disabled} 37 | 38 |
43 | {content} 44 |
45 |
46 | {/if} 47 | -------------------------------------------------------------------------------- /oxmysql/web/src/pages/resource/components/ResourceHeader.svelte: -------------------------------------------------------------------------------- 1 | 9 | 10 |
11 | 17 |

{route.params.resource}

18 |
19 |

Queries: {$resourceData.resourceQueriesCount}

20 |

Time: {$resourceData.resourceTime.toFixed(4)} ms

21 |

Slow queries: {$resourceData.resourceSlowQueries}

22 |
23 |
24 | -------------------------------------------------------------------------------- /oxmysql/web/src/pages/root/components/Chart.svelte: -------------------------------------------------------------------------------- 1 | 8 | 9 | { 33 | // @ts-ignore 34 | return `Queries: ${context.raw.queries}, Time: ${context.raw.time.toFixed(4)} ms`; 35 | }, 36 | }, 37 | }, 38 | }, 39 | }} 40 | /> 41 | -------------------------------------------------------------------------------- /oxmysql/web/src/pages/root/components/Search.svelte: -------------------------------------------------------------------------------- 1 | 5 | 6 |
9 |
10 | 11 |
12 | 13 |
14 | -------------------------------------------------------------------------------- /oxmysql/web/src/store/general.ts: -------------------------------------------------------------------------------- 1 | import { derived, writable } from 'svelte/store'; 2 | 3 | export const visible = writable(false); 4 | 5 | export const search = writable(''); 6 | let timeout: NodeJS.Timeout; 7 | export const debouncedSearch = derived(search, (value, set: (value: string) => void) => { 8 | timeout = setTimeout(() => set(value), 500); 9 | return () => clearTimeout(timeout); 10 | }); 11 | 12 | export const resources = writable([]); 13 | 14 | export const filteredResources = derived( 15 | [resources, debouncedSearch], 16 | ([$resources, $debouncedSearch], set: (value: string[]) => void) => { 17 | if ($debouncedSearch === '' || !$debouncedSearch) return set($resources); 18 | 19 | const query = $debouncedSearch.toLowerCase(); 20 | 21 | return set($resources.filter((resource) => resource.toLowerCase().includes(query))); 22 | } 23 | ); 24 | 25 | export const generalData = writable({ 26 | queries: 0, 27 | timeQuerying: 0, 28 | slowQueries: 0, 29 | }); 30 | 31 | export const chartData = writable<{ labels: string[]; data: { queries: number; time: number }[] }>({ 32 | labels: [], 33 | data: [], 34 | }); 35 | -------------------------------------------------------------------------------- /oxmysql/web/src/store/index.ts: -------------------------------------------------------------------------------- 1 | export * from './general'; 2 | export * from './resource'; 3 | -------------------------------------------------------------------------------- /oxmysql/web/src/store/resource.ts: -------------------------------------------------------------------------------- 1 | import { derived, writable } from 'svelte/store'; 2 | 3 | export interface QueryData { 4 | date: number; 5 | query: string; 6 | executionTime: number; 7 | slow?: boolean; 8 | } 9 | 10 | export const queries = writable([]); 11 | 12 | export const resourceData = writable<{ 13 | resourceQueriesCount: number; 14 | resourceSlowQueries: number; 15 | resourceTime: number; 16 | }>({ 17 | resourceQueriesCount: 0, 18 | resourceSlowQueries: 0, 19 | resourceTime: 0, 20 | }); 21 | 22 | export const tablePage = writable(0); 23 | 24 | let timer: NodeJS.Timer; 25 | export const debouncedTablePage = derived(tablePage, ($tablePage, set) => { 26 | clearTimeout(timer); 27 | timer = setTimeout(() => { 28 | set($tablePage); 29 | }, 300); 30 | }); 31 | -------------------------------------------------------------------------------- /oxmysql/web/src/utils/debugData.ts: -------------------------------------------------------------------------------- 1 | import { isEnvBrowser } from './misc'; 2 | 3 | interface DebugEvent { 4 | action: string; 5 | data: T; 6 | } 7 | 8 | /** 9 | * Emulates dispatching an event using SendNuiMessage in the lua scripts. 10 | * This is used when developing in browser 11 | * 12 | * @param events - The event you want to cover 13 | * @param timer - How long until it should trigger (ms) 14 | */ 15 | export const debugData =

(events: DebugEvent

[], timer = 1000): void => { 16 | if (isEnvBrowser()) { 17 | for (const event of events) { 18 | setTimeout(() => { 19 | window.dispatchEvent( 20 | new MessageEvent('message', { 21 | data: { 22 | action: event.action, 23 | data: event.data, 24 | }, 25 | }) 26 | ); 27 | }, timer); 28 | } 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /oxmysql/web/src/utils/fetchNui.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @param eventName - The endpoint eventname to target 3 | * @param data - Data you wish to send in the NUI Callback 4 | * 5 | * @return returnData - A promise for the data sent back by the NuiCallbacks CB argument 6 | */ 7 | 8 | export async function fetchNui(eventName: string, data: unknown = {}): Promise { 9 | const options = { 10 | method: 'post', 11 | headers: { 12 | 'Content-Type': 'application/json; charset=UTF-8', 13 | }, 14 | body: JSON.stringify(data), 15 | }; 16 | 17 | const resourceName = (window as any).GetParentResourceName 18 | ? (window as any).GetParentResourceName() 19 | : 'nui-frame-app'; 20 | 21 | const resp = await fetch(`https://${resourceName}/${eventName}`, options); 22 | 23 | return await resp.json(); 24 | } 25 | -------------------------------------------------------------------------------- /oxmysql/web/src/utils/misc.ts: -------------------------------------------------------------------------------- 1 | export const isEnvBrowser = (): boolean => !(window as any).invokeNative; 2 | -------------------------------------------------------------------------------- /oxmysql/web/src/utils/useNuiEvent.ts: -------------------------------------------------------------------------------- 1 | import { onMount, onDestroy } from 'svelte'; 2 | 3 | interface NuiMessage { 4 | action: string; 5 | data: T; 6 | } 7 | 8 | /** 9 | * A function that manage events listeners for receiving data from the client scripts 10 | * @param action The specific `action` that should be listened for. 11 | * @param handler The callback function that will handle data relayed by this function 12 | * 13 | * @example 14 | * useNuiEvent<{visibility: true, wasVisible: 'something'}>('setVisible', (data) => { 15 | * // whatever logic you want 16 | * }) 17 | * 18 | **/ 19 | 20 | export function useNuiEvent(action: string, handler: (data: T) => void) { 21 | const eventListener = (event: MessageEvent>) => { 22 | const { action: eventAction, data } = event.data; 23 | 24 | eventAction === action && handler(data); 25 | }; 26 | onMount(() => window.addEventListener('message', eventListener)); 27 | onDestroy(() => window.removeEventListener('message', eventListener)); 28 | } 29 | -------------------------------------------------------------------------------- /oxmysql/web/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | -------------------------------------------------------------------------------- /oxmysql/web/svelte.config.js: -------------------------------------------------------------------------------- 1 | import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; 2 | 3 | export default { 4 | // Consult https://svelte.dev/docs#compile-time-svelte-preprocess 5 | // for more information about preprocessors 6 | preprocess: vitePreprocess(), 7 | }; 8 | -------------------------------------------------------------------------------- /oxmysql/web/tailwind.config.cjs: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | content: ['./index.html', './src/**/*.{js,ts,svelte}'], 4 | theme: { 5 | extend: { 6 | fontFamily: { 7 | main: 'Roboto', 8 | }, 9 | colors: { 10 | // Mantine dark colours 11 | dark: { 12 | 50: '#C1C2C5', 13 | 100: '#A6A7AB', 14 | 200: '#909296', 15 | 300: '#5C5F66', 16 | 400: '#373A40', 17 | 500: '#2C2E33', 18 | 600: '#25262B', 19 | 700: '#1A1B1E', 20 | 800: '#141517', 21 | 900: '#101113', 22 | }, 23 | }, 24 | }, 25 | }, 26 | plugins: [], 27 | }; 28 | -------------------------------------------------------------------------------- /oxmysql/web/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@tsconfig/svelte/tsconfig.json", 3 | "compilerOptions": { 4 | "target": "ESNext", 5 | "useDefineForClassFields": true, 6 | "module": "ESNext", 7 | "resolveJsonModule": true, 8 | /** 9 | * Typecheck JS in `.svelte` and `.js` files by default. 10 | * Disable checkJs if you'd like to use dynamic types in JS. 11 | * Note that setting allowJs false does not prevent the use 12 | * of JS in `.svelte` files. 13 | */ 14 | "allowJs": true, 15 | "checkJs": true, 16 | "isolatedModules": true 17 | }, 18 | "include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.js", "src/**/*.svelte"], 19 | "references": [{ "path": "./tsconfig.node.json" }] 20 | } 21 | -------------------------------------------------------------------------------- /oxmysql/web/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "module": "ESNext", 5 | "moduleResolution": "Node" 6 | }, 7 | "include": ["vite.config.ts"] 8 | } 9 | -------------------------------------------------------------------------------- /oxmysql/web/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import { svelte } from '@sveltejs/vite-plugin-svelte'; 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [svelte()], 7 | base: './', 8 | server: { 9 | port: 3000, 10 | }, 11 | build: { 12 | outDir: 'build', 13 | }, 14 | }); 15 | -------------------------------------------------------------------------------- /resources.cfg: -------------------------------------------------------------------------------- 1 | ensure MP-Loading 2 | ensure oxmysql 3 | set mysql_connection_string "user=root;password=;host=localhost;port=3306;database=mp-framework;charset=utf8mb4" 4 | add_ace resource.MP-Base command allow #allows admin commands 5 | 6 | 7 | 8 | ensure MP-Base 9 | ensure PolyZone 10 | ensure MP-Logs 11 | ensure MP-Commands 12 | ensure MP-Spawn 13 | ensure MP-Elements 14 | ensure [ox] 15 | ensure qb-clothing 16 | 17 | ensure mapmanager 18 | ensure chat 19 | ensure sessionmanager 20 | ensure hardcap 21 | ensure rconlog --------------------------------------------------------------------------------