From 39e49f88b377b55ee7265e68d92cd113f80ae528 Mon Sep 17 00:00:00 2001 From: Swellington Soares Date: Sun, 29 Sep 2024 01:16:16 -0300 Subject: [PATCH 1/3] added origin --- .editorconfig | 9 + .github/CODE_OF_CONDUCT.md | 73 +++ .github/ISSUE_TEMPLATE/bug_report.yml | 63 ++ .github/ISSUE_TEMPLATE/config.yml | 5 + .github/ISSUE_TEMPLATE/feature_request.yml | 36 ++ .github/actions/bump-manifest-version.js | 15 + .github/contributing.md | 99 +++ .github/pull_request_template.md | 10 + .github/workflows/discord-commit.yml | 16 + .github/workflows/discord-release.yml | 21 + .github/workflows/issues-project.yml | 22 + .github/workflows/lint.yml | 31 + .github/workflows/release-action.yml | 57 ++ .github/workflows/release.yml | 42 ++ .vscode/extensions.json | 8 + .vscode/settings.json | 12 + LICENSE | 674 +++++++++++++++++++++ README.md | 1 + client/admin.lua | 528 ++++++++++++++++ client/dev.lua | 84 +++ client/main.lua | 54 ++ client/player.lua | 308 ++++++++++ client/reports.lua | 89 +++ client/server.lua | 49 ++ client/vectors.lua | 30 + client/vehicle.lua | 160 +++++ config/server.lua | 108 ++++ fxmanifest.lua | 29 + locales/cs.json | 155 +++++ locales/da.json | 169 ++++++ locales/de.json | 169 ++++++ locales/en.json | 169 ++++++ locales/es.json | 155 +++++ locales/fr.json | 153 +++++ locales/it.json | 151 +++++ locales/pt-br.json | 155 +++++ locales/pt.json | 165 +++++ locales/sv.json | 153 +++++ server/commands.lua | 119 ++++ server/main.lua | 306 ++++++++++ 40 files changed, 4652 insertions(+) create mode 100644 .editorconfig create mode 100644 .github/CODE_OF_CONDUCT.md create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml create mode 100644 .github/actions/bump-manifest-version.js create mode 100644 .github/contributing.md create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/discord-commit.yml create mode 100644 .github/workflows/discord-release.yml create mode 100644 .github/workflows/issues-project.yml create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/release-action.yml create mode 100644 .github/workflows/release.yml create mode 100644 .vscode/extensions.json create mode 100644 .vscode/settings.json create mode 100644 LICENSE create mode 100644 README.md create mode 100644 client/admin.lua create mode 100644 client/dev.lua create mode 100644 client/main.lua create mode 100644 client/player.lua create mode 100644 client/reports.lua create mode 100644 client/server.lua create mode 100644 client/vectors.lua create mode 100644 client/vehicle.lua create mode 100644 config/server.lua create mode 100644 fxmanifest.lua create mode 100644 locales/cs.json create mode 100644 locales/da.json create mode 100644 locales/de.json create mode 100644 locales/en.json create mode 100644 locales/es.json create mode 100644 locales/fr.json create mode 100644 locales/it.json create mode 100644 locales/pt-br.json create mode 100644 locales/pt.json create mode 100644 locales/sv.json create mode 100644 server/commands.lua create mode 100644 server/main.lua diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..9c97eb2 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = false +indent_style = space +charset = utf-8 +trim_trailing_whitespace = true +indent_size = 4 diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..7d53132 --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,73 @@ +# Contributor Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +education, socio-economic status, nationality, personal appearance, race, +religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team in the discord at https://discord.gg/Z6Whda5hHA. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..7605230 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,63 @@ +name: Bug report +description: Create a report to help us improve or fix something +labels: ['bug', 'need repro'] +body: + - type: markdown + attributes: + value: | + Thank you for taking the time to fill out a bug report! + Please use our Discord Server to ask questions and receive support: https://discord.gg/Z6Whda5hHA + - type: input + id: summary + attributes: + label: Summary + description: Write a short and concise description of your bug. + validations: + required: true + - type: textarea + id: repro + attributes: + label: Reproduction + description: What did you do to make this happen? + placeholder: | + 1. Using ... + 2. Do ... + 3. Then use ... + 4. See error + validations: + required: true + - type: textarea + id: expected + attributes: + label: Expected behavior + description: What did you expect to happen? + validations: + required: true + - type: textarea + id: actual + attributes: + label: Actual behavior + description: What actually happened? + validations: + required: true + - type: textarea + id: additional + attributes: + label: Additional context + description: If you have any other context about the problem such as screenshots or videos, add them here. + - type: input + id: updated + attributes: + label: Current Version + description: What version of the resource are you currently using? + placeholder: e.g. v1.3.0, v1.4.0 + validations: + required: true + - type: input + id: custom + attributes: + label: Custom Resources + description: Are you using custom resources? Which ones? + placeholder: e.g. zdiscord, qb-target + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..e4ba2fd --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Qbox Discord Server + url: https://discord.gg/Z6Whda5hHA + about: Ask questions, receive support, and discuss with the community in our Discord server. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..183d114 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,36 @@ +name: Feature request +description: Suggest an idea for Qbox +labels: enhancement +body: + - type: markdown + attributes: + value: | + Please use our Discord Server to ask questions and receive support: https://discord.gg/Z6Whda5hHA + - type: textarea + id: problem + attributes: + label: The problem + description: A clear and concise description of what the problem is, or what feature you want to be implemented. + placeholder: | + Some examples: + I'm frustrated that ... + It would be nice if ... + validations: + required: true + - type: textarea + id: solution + attributes: + label: Ideal solution + description: A clear and concise description of what you want to happen, with as much detail as possible. + validations: + required: true + - type: textarea + id: alternatives + attributes: + label: Alternative solutions + description: A clear and concise description of any alternative solutions or features you've considered. + - type: textarea + id: additional + attributes: + label: Additional context + description: If you have any other context about the problem such as screenshots or videos, add them here. diff --git a/.github/actions/bump-manifest-version.js b/.github/actions/bump-manifest-version.js new file mode 100644 index 0000000..2980cfc --- /dev/null +++ b/.github/actions/bump-manifest-version.js @@ -0,0 +1,15 @@ +const fs = require('fs') + +const version = process.env.TGT_RELEASE_VERSION +const newVersion = version.replace('v', '') + +const manifestFile = fs.readFileSync('fxmanifest.lua', {encoding: 'utf8'}) + +const versionStr = `version '${newVersion}'` +let newFileContent = manifestFile.replace(/\bversion\s+(.*)$/gm, versionStr) + +if (!newFileContent.includes(versionStr)) { + newFileContent = manifestFile.replace(/\bgame\s+(.*)$/gm, `game 'gta5'\n${versionStr}`); +} + +fs.writeFileSync('fxmanifest.lua', newFileContent) \ No newline at end of file diff --git a/.github/contributing.md b/.github/contributing.md new file mode 100644 index 0000000..741ad62 --- /dev/null +++ b/.github/contributing.md @@ -0,0 +1,99 @@ +# Contributing to Qbox + +Thank you for taking the time to contribute! + +These guidelines will help you help us in the best way possible regardless of your skill level. We ask that you try to read everything related to the way you'd like to contribute and try and use your best judgement for anything not covered. + +Make sure to also read our [Contributor Code of Conduct](./CODE_OF_CONDUCT.md). + +If you still have further questions after reading be sure to join the [Qbox Discord server][discord link]. + +## Issues + +Open a new issue to report a bug or request a new feature or improvement. + +If you want to ask a question, issues are not the place to do so. Please join our [Discord server][discord link] and ask over there instead. + +Before opening a new issue: + +- [Search](https://github.com/issues?q=is%3Aissue+org%3AQbox-Project) for existing issues; maybe someone else already experienced the same problem that you're having! Duplicate issues will be closed. +- Download the latest release of the resource you are opening the issue for to make sure that it wasn't already fixed. Issues that are already fixed are considered invalid and will be closed. + +When opening a new issue, make sure to pick the right type of form and fill it out. The more information you provide, the easier it will be for us to work on your new issue. Issues that are invalid or do not follow the correct form may be ignored or even closed. + +## Pull Requests + +Open a new pull request to contribute code. + +You can use your own editor of choice, but we recommend using [VSCode](https://code.visualstudio.com/) with these extensions: + +- [GitLens](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens) +- [Lua Language Server](https://marketplace.visualstudio.com/items?itemName=sumneko.lua) +- [EditorConfig](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig) +- [CfxLua IntelliSense](https://marketplace.visualstudio.com/items?itemName=overextended.cfxlua-vscode) + +If you are new to contributing code, you can check out and try to fix issues marked with [`good first issue`](https://github.com/issues?q=is%3Aissue+is%3Aopen+org%3AQbox-Project+label%3A%22good+first+issue%22). + +If you want to contribute code but don't know what to do, please check out issues marked with [`help wanted`](https://github.com/issues?q=is%3Aissue+is%3Aopen+org%3AQbox-Project+label%3A%22help+wanted%22) as those are issues that we actually *need* help with. + +If you want to contribute code unrelated to an existing issue, you should open an issue yourself or ask over on the [Discord server][discord link] to discuss it with our team and ask whether your change is wanted, especially if you are planning on adding new features or large designs. + +Before opening a pull request: + +- Make sure that your contribution fits our [code conventions](#code-conventions) described below. After opening a pull request your code will be checked according to them. +- Make sure that your pull request is small and focused. Break it into multiple smaller pull requests if not (see [Small Pull Request Manifesto](https://github.com/PlaytikaOSS/small-pull-request-manifesto)). +- It is recommended to test your changes to make sure they work and don't break existing functionality. + +When opening a pull request, make sure to follow the template and explain your changes. If you are trying to contribute something related to a GitHub issue, make sure to mention it as well. + +## Code Conventions + +Below are conventions that you must follow when contributing code. + +### Commit Message Conventions + +- The first line of a commit message must be 72 characters at most. +- Commit messages and pull request titles must follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). + - Use `fix:` when patching a bug. + - Use `feat:` when introducing a new feature. + - Use `refactor:` when altering code without changing functionality. + - Use `chore:` when your changes don't alter production code. + - Append a `!` after the type/scope of the feature when you change code and introduce a breaking API change. Optionally add a footer to the bottom of your commit message separated by 2 newlines, starting with `BREAKING CHANGE:`, and explaining the breaking change. + +### Lua Conventions + +#### General Style + +- Use 4 space indentation. +- Prefer creating local variables over global ones. +- Don't repeat yourself. If you're using the same operations in multiple different places convert them into a flexible function. +- Exported functions must be properly annotated (see [LuaLS Annotations](https://luals.github.io/wiki/annotations/)). +- Utilize [ox_lib](https://overextended.dev/ox_lib) to make your life easier. Prefer lib calls over native ones. +- Make use of config options where it makes sense to make features optional and/or customizable. Configs should not be modified by other code. + +#### Optimization & Security + +- Consider [this Lua Performance guide](https://springrts.com/wiki/Lua_Performance). +- Don't create unnecessary threads. Always try to find a better method of triggering events. +- Set longer `Wait` calls in distance checking loops when the player is out of range. +- Don't waste cycles; job specific loops should only run for players with that job. +- When possible don't trust the client, *especially* with transactions. +- Balance security and optimizations. +- Use `#(vector3 - vector3)` instead of `GetDistanceBetweenCoords()`. +- Use `myTable[#myTable + 1] = 'value'` instead of `table.insert(myTable, 'value')`. +- Use `myTable['key'] = 'value'` instead of `table.insert(myTable, 'key', 'value')`. + +#### Naming + +- Use `camelCase` for local variables and functions. +- Use `PascalCase` for global variables and functions. +- Avoid acronyms as they can be confusing and context dependant. +- Be descriptive; make it easy for the reader. + - Booleans may be prefixed with `is`, `has`, `are`, etc. + - Arrays should have plural names. + +### JavaScript/TypeScript Conventions + +Consider following the [Google JavaScript Style Guide](https://google.github.io/styleguide/jsguide.html) and the [Google TypeScript Style Guide](https://google.github.io/styleguide/tsguide.html). + +[discord link]: https://discord.gg/Z6Whda5hHA diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..786cbf9 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,10 @@ +## Description + + + +## Checklist + + + +- [ ] I have personally loaded this code into an updated Qbox project and checked all of its functionality. +- [ ] My pull request fits the contribution guidelines & code conventions. diff --git a/.github/workflows/discord-commit.yml b/.github/workflows/discord-commit.yml new file mode 100644 index 0000000..3de7c75 --- /dev/null +++ b/.github/workflows/discord-commit.yml @@ -0,0 +1,16 @@ +name: "Discord Commit" + +on: [push] + +jobs: + report-status: + if: github.event.repository.default_branch == github.ref_name + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Discord Webhook + uses: ChatDisabled/discord-commits@main + with: + id: ${{ secrets.WEBHOOK_ID }} + token: ${{ secrets.WEBHOOK_TOKEN }} diff --git a/.github/workflows/discord-release.yml b/.github/workflows/discord-release.yml new file mode 100644 index 0000000..00b4047 --- /dev/null +++ b/.github/workflows/discord-release.yml @@ -0,0 +1,21 @@ +name: "Discord Releases" + +on: + release: + types: [published] + +jobs: + github-releases-to-discord: + name: Discord Releases Changelog + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Github Releases To Discord + uses: SethCohen/github-releases-to-discord@v1.15.0 + with: + webhook_url: ${{ secrets.WEBHOOK_URL }} + color: "15852866" + username: ${{ github.event.repository.name }} + avatar_url: "https://i.imgur.com/Eh1yiLI.png" + footer_timestamp: true diff --git a/.github/workflows/issues-project.yml b/.github/workflows/issues-project.yml new file mode 100644 index 0000000..4e5ed18 --- /dev/null +++ b/.github/workflows/issues-project.yml @@ -0,0 +1,22 @@ +name: Issues Project Management + +on: + issues: + types: + - opened + +jobs: + add-to-project: + name: Add issue to project + runs-on: ubuntu-latest + steps: + - name: Get App Token + uses: actions/create-github-app-token@v1 + id: generate_token + with: + app-id: ${{ secrets.APP_ID }} + private-key: ${{ secrets.PRIVATE_KEY }} + - uses: actions/add-to-project@v0.5.0 + with: + project-url: https://github.com/orgs/Qbox-project/projects/4 + github-token: ${{ steps.generate_token.outputs.token }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..bdd0da1 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,31 @@ +name: Lint +on: + push: + paths: + - '**.lua' + - '.github/workflows/lint.yml' + pull_request_target: + paths: + - '**.lua' + - '.github/workflows/lint.yml' +jobs: + lint: + name: Lint Resource + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + - name: Lint + uses: iLLeniumStudios/fivem-lua-lint-action@v2 + with: + capture: "junit.xml" + args: "-t --formatter JUnit" + extra_libs: ox_lib+mysql+qblocales+qbox+qbox_playerdata+qbox_lib + - name: Generate Lint Report + if: always() + uses: mikepenz/action-junit-report@v4 + with: + report_paths: "**/junit.xml" + check_name: Linting Report + fail_on_failure: false diff --git a/.github/workflows/release-action.yml b/.github/workflows/release-action.yml new file mode 100644 index 0000000..b1e3196 --- /dev/null +++ b/.github/workflows/release-action.yml @@ -0,0 +1,57 @@ +name: "release-action" + +on: + push: + tags: + - "v*" + +jobs: + release-action: + name: "Create Release" + runs-on: "ubuntu-latest" + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.event.repository.default_branch }} + + - name: Install ZIP + run: sudo apt install zip + + - name: Bundle files + run: | + rm -rf ./.github ./.vscode ./.git + shopt -s extglob + mkdir ./${{ github.event.repository.name }} + cp -r !(${{ github.event.repository.name }}) ${{ github.event.repository.name }} + zip -r ./${{ github.event.repository.name }}.zip ./${{ github.event.repository.name }} + + - name: Get App Token + uses: actions/create-github-app-token@v1 + id: generate_token + with: + app-id: ${{ secrets.APP_ID }} + private-key: ${{ secrets.PRIVATE_KEY }} + + - name: Update CHANGELOG + id: changelog + uses: requarks/changelog-action@v1 + with: + token: ${{ steps.generate_token.outputs.token }} + tag: ${{ github.ref_name }} + includeInvalidCommits: true + useGitmojis: false + writeToFile: false + + - name: Create Release + uses: ncipollo/release-action@v1.14.0 + with: + allowUpdates: true + draft: false + makeLatest: true + name: ${{ github.ref_name }} + tag: ${{ github.ref_name }} + body: ${{ steps.changelog.outputs.changes }} + artifacts: ${{ github.event.repository.name }}.zip + token: ${{ steps.generate_token.outputs.token }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f5cc276 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +name: Create New Release + +on: + workflow_dispatch: + inputs: + version: + required: true + +jobs: + create-release: + name: Create New Release + runs-on: ubuntu-latest + steps: + - name: Get App Token + uses: actions/create-github-app-token@v1 + id: generate_token + with: + app-id: ${{ secrets.APP_ID }} + private-key: ${{ secrets.PRIVATE_KEY }} + + - name: Checkout Repository + uses: actions/checkout@v4 + with: + token: ${{ steps.generate_token.outputs.token }} + + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: 20.x + + - name: Bump manifest version + run: node .github/actions/bump-manifest-version.js + env: + TGT_RELEASE_VERSION: ${{ inputs.version }} + + - name: Push manifest change + uses: EndBug/add-and-commit@v9 + with: + add: fxmanifest.lua + push: true + message: 'chore: bump manifest version to ${{ inputs.version }}' + tag: ${{ inputs.version }} diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..5de9729 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,8 @@ +{ + "recommendations": [ + "sumneko.lua", + "overextended.cfxlua-vscode", + "ihyajb.qbcore-code-snippets", + "EditorConfig.EditorConfig", + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..f56fbb6 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,12 @@ +{ + "Lua.runtime.nonstandardSymbol": ["/**/", "`", "+=", "-=", "*=", "/="], + "Lua.runtime.version": "Lua 5.4", + "Lua.diagnostics.globals": [ + "lib", + "cache", + "locale", + "MySQL", + "QBX", + "qbx" + ] +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.md b/README.md new file mode 100644 index 0000000..e11ba7a --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# qbx_adminmenu diff --git a/client/admin.lua b/client/admin.lua new file mode 100644 index 0000000..7137f05 --- /dev/null +++ b/client/admin.lua @@ -0,0 +1,528 @@ +local VEHICLES_HASH = exports.qbx_core:GetVehiclesByHash() +local optionInvisible = false +local godmode = false +local infiniteAmmo = false +local vehicleGodmode = false + +local noclipEnabled = false +local ent +local invisible = nil +local noclipCam = nil +local speed = 1.0 +local maxSpeed = 32.0 +local minY, maxY = -150.0, 160.0 +local inputRotEnabled = false +local disableControls = { 32, 33, 34, 35, 36, 12, 13, 14, 15, 16, 17 } + +local function toggleNoclip() + CreateThread(function() + local inVehicle = false + + if cache.vehicle then + inVehicle = true + ent = cache.vehicle + else + ent = cache.ped + end + + local pos = GetEntityCoords(ent) + local rot = GetEntityRotation(ent) + noclipCam = CreateCamWithParams('DEFAULT_SCRIPTED_CAMERA', pos.x, pos.y, pos.z, 0.0, 0.0, rot.z, 75.0, true, 2) + AttachCamToEntity(noclipCam, ent, 0.0, 0.0, 0.0, true) + RenderScriptCams(true, false, 3000, true, false) + FreezeEntityPosition(ent, true) + SetEntityCollision(ent, false, false) + SetEntityAlpha(ent, 0, false) + SetPedCanRagdoll(cache.ped, false) + SetEntityVisible(ent, false, false) + + if not inVehicle then + ClearPedTasksImmediately(cache.ped) + end + + if inVehicle then + FreezeEntityPosition(cache.ped, true) + SetEntityCollision(cache.ped, false, false) + SetEntityAlpha(cache.ped, 0, false) + SetEntityVisible(cache.ped, false, false) + end + + while noclipEnabled do + Wait(0) + local _, fv = GetCamMatrix(noclipCam) + if IsDisabledControlPressed(2, 17) then -- Scroll Wheel Up + speed = math.min(speed + 0.1, maxSpeed) + elseif IsDisabledControlPressed(2, 16) then -- Scroll Wheel Down + speed = math.max(0.1, speed - 0.1) + end + + local multiplier = 1.0 + if IsDisabledControlPressed(2, 209) then -- Left Shift + multiplier = 2.0 + elseif IsDisabledControlPressed(2, 19) then -- Left Alt + multiplier = 4.0 + elseif IsDisabledControlPressed(2, 36) then -- Left CTRL + multiplier = 0.25 + end + + if IsDisabledControlPressed(2, 32) then -- W + local setPos = GetEntityCoords(ent) + fv * (speed * multiplier) + SetEntityCoordsNoOffset(ent, setPos.x, setPos.y, setPos.z, false, false, false) + if not inVehicle then + SetEntityCoordsNoOffset(cache.ped, setPos.x, setPos.y, setPos.z, false, false, false) + end + elseif IsDisabledControlPressed(2, 33) then -- S + local setPos = GetEntityCoords(ent) - fv * (speed * multiplier) + SetEntityCoordsNoOffset(ent, setPos.x, setPos.y, setPos.z, false, false, false) + if not inVehicle then + SetEntityCoordsNoOffset(cache.ped, setPos.x, setPos.y, setPos.z, false, false, false) + end + end + + if IsDisabledControlPressed(2, 34) then -- A + local setPos = GetOffsetFromEntityInWorldCoords(ent, -speed * multiplier, 0.0, 0.0) + SetEntityCoordsNoOffset(ent, setPos.x, setPos.y, setPos.z, false, false, false) + if not inVehicle then + SetEntityCoordsNoOffset(cache.ped, setPos.x, setPos.y, setPos.z, false, false, false) + end + elseif IsDisabledControlPressed(2, 35) then -- D + local setPos = GetOffsetFromEntityInWorldCoords(ent, speed * multiplier, 0.0, 0.0) + SetEntityCoordsNoOffset(ent, setPos.x, setPos.y, setPos.z, false, false, false) + if not inVehicle then + SetEntityCoordsNoOffset(cache.ped, setPos.x, setPos.y, setPos.z, false, false, false) + end + end + + if IsDisabledControlPressed(2, 51) then -- E + local setPos = GetOffsetFromEntityInWorldCoords(ent, 0.0, 0.0, multiplier * speed / 2) + SetEntityCoordsNoOffset(ent, setPos.x, setPos.y, setPos.z, false, false, false) + if not inVehicle then + SetEntityCoordsNoOffset(cache.ped, setPos.x, setPos.y, setPos.z, false, false, false) + end + elseif IsDisabledControlPressed(2, 52) then -- Q + local setPos = GetOffsetFromEntityInWorldCoords(ent, 0.0, 0.0, multiplier * -speed / 2) + SetEntityCoordsNoOffset(ent, setPos.x, setPos.y, setPos.z, false, false, false) + if not inVehicle then + SetEntityCoordsNoOffset(cache.ped, setPos.x, setPos.y, setPos.z, false, false, false) + end + end + + local camRot = GetCamRot(noclipCam, 2) + SetEntityHeading(ent, (360 + camRot.z) % 360) + SetEntityVisible(ent, false, false) + + if inVehicle then + SetEntityVisible(cache.ped, false, false) + end + + for i = 1, #disableControls do + DisableControlAction(2, disableControls[i], true) + end + + DisablePlayerFiring(cache.playerId, true) + end + + DestroyCam(noclipCam, false) + noclipCam = nil + RenderScriptCams(false, false, 3000, true, false) + FreezeEntityPosition(ent, false) + SetEntityCollision(ent, true, true) + ResetEntityAlpha(ent) + SetPedCanRagdoll(cache.ped, true) + SetEntityVisible(ent, not invisible, false) + ClearPedTasksImmediately(cache.ped) + if inVehicle then + FreezeEntityPosition(cache.ped, false) + SetEntityCollision(cache.ped, true, true) + ResetEntityAlpha(cache.ped) + SetEntityVisible(cache.ped, true, false) + SetPedIntoVehicle(cache.ped, ent, -1) + end + end) +end + +local function checkInputRotation() + CreateThread(function() + while inputRotEnabled do + while not noclipCam or IsPauseMenuActive() do Wait(0) end + local axisX = GetDisabledControlNormal(0, 1) + local axisY = GetDisabledControlNormal(0, 2) + local sensitivity = GetProfileSetting(14) * 2 + + if GetProfileSetting(15) == 0 then -- Invert controls + sensitivity = -sensitivity + end + + if math.abs(axisX) > 0 or math.abs(axisY) > 0 then + local rotation = GetCamRot(noclipCam, 2) + local rotz = rotation.z + (axisX * sensitivity) + local yValue = axisY * sensitivity + local rotx = rotation.x + if rotx + yValue > minY and rotx + yValue < maxY then + rotx = rotation.x + yValue + end + + SetCamRot(noclipCam, rotx, rotation.y, rotz, 2) + end + Wait(0) + end + end) +end + +local function toggleNoClipMode(forceMode) + if forceMode ~= nil then + noclipEnabled = forceMode + inputRotEnabled = noclipEnabled + else + noclipEnabled = not noclipEnabled + inputRotEnabled = noclipEnabled + end + + if noclipEnabled and inputRotEnabled then + toggleNoclip() + checkInputRotation() + end +end + +local options = { + function() toggleNoClipMode() end, + function() TriggerEvent('qbx_medical:client:playerRevived') end, + function() + optionInvisible = not optionInvisible + if not optionInvisible then return end + while optionInvisible do Wait(0) + SetEntityVisible(cache.ped, false, false) + end + + SetEntityVisible(cache.ped, true, false) + end, + function() + godmode = not godmode + if godmode then SetPlayerInvincible(cache.playerId, true) else SetPlayerInvincible(cache.playerId, false) end + end, + function() ExecuteCommand('names') end, + function() ExecuteCommand('blips') end, + function() + vehicleGodmode = not vehicleGodmode + if vehicleGodmode then + while vehicleGodmode do + SetEntityInvincible(cache.vehicle, true) + SetEntityCanBeDamaged(cache.vehicle, false) + SetVehicleBodyHealth(cache.vehicle, 1000.0) + SetVehicleFixed(cache.vehicle) + SetVehicleEngineHealth(cache.vehicle, 1000.0) + Wait(250) + end + else + SetEntityInvincible(cache.vehicle, false) + SetEntityCanBeDamaged(cache.vehicle, true) + end + end, + function(switch) + if switch == 1 then + local input = lib.inputDialog(locale('admin_options.value8_1'), {locale('admin_options.input8label')}) + if not input then return end + ExecuteCommand('setmodel ' .. input) + else + ExecuteCommand('refreshskin') + end + end, + function() + infiniteAmmo = not infiniteAmmo + local weapon = GetSelectedPedWeapon(cache.ped) + if infiniteAmmo then + if GetAmmoInPedWeapon(cache.ped, weapon) < 6 then SetAmmoInClip(cache.ped, weapon, 10) Wait(50) end + while infiniteAmmo do + weapon = GetSelectedPedWeapon(cache.ped) + SetPedInfiniteAmmo(cache.ped, true, weapon) + RefillAmmoInstantly(cache.ped) + Wait(250) + end + else + SetPedInfiniteAmmo(cache.ped, false, weapon) + end + end, + function(weaponType) TriggerServerEvent('qbx_admin:server:giveAllWeapons', weaponType) end, + function() TriggerEvent('police:client:GetCuffed', cache.serverId, true) end, +} + +lib.registerMenu({ + id = 'qbx_adminmenu_admin_menu', + title = locale('title.admin_menu'), + position = 'top-right', + onClose = function(keyPressed) + CloseMenu(false, keyPressed, 'qbx_adminmenu_main_menu') + end, + onSelected = function(selected) + MenuIndexes.qbx_adminmenu_admin_menu = selected + end, + options = { + {label = locale('admin_options.label1'), description = locale('admin_options.desc1'), icon = 'fab fa-fly', close = false}, + {label = locale('admin_options.label2'), description = locale('admin_options.desc2'), icon = 'fas fa-hospital', close = false}, + {label = locale('admin_options.label3'), description = locale('admin_options.desc3'), icon = 'fas fa-ghost', close = false}, + {label = locale('admin_options.label4'), description = locale('admin_options.desc4'), icon = 'fas fa-bolt', close = false}, + {label = locale('admin_options.label5'), description = locale('admin_options.desc5'), icon = 'fas fa-clipboard-list', close = false}, + {label = locale('admin_options.label6'), description = locale('admin_options.desc6'), icon = 'fas fa-map-pin', close = false}, + {label = locale('admin_options.label7'), description = locale('admin_options.desc7'), icon = 'fas fa-car-on', close = false}, + {label = locale('admin_options.label8'), description = locale('admin_options.desc8'), icon = 'fas fa-person-half-dress', values = {locale('admin_options.value8_1'), locale('admin_options.value8_2')}}, + {label = locale('admin_options.label9'), description = locale('admin_options.desc9'), icon = 'fas fa-bullseye', close = false}, + {label = locale('admin_options.label10'), description = locale('admin_options.desc10'), icon = 'fas fa-gun', values = {locale('admin_options.value10_1'), locale('admin_options.value10_2'), locale('admin_options.value10_3'), locale('admin_options.value10_4'), locale('admin_options.value10_5'), locale('admin_options.value10_6'), locale('admin_options.value10_7')}, args = {'pistol', 'smg', 'shotgun', 'assault', 'lmg', 'sniper', 'heavy'}, close = false}, + {label = locale('admin_options.label11'), description = locale('admin_options.desc11'), icon = 'fas fa-handcuffs', close = false}, + } +}, function(selected, scrollIndex, args) + if selected == 10 then + ---@diagnostic disable-next-line: redundant-parameter + options[selected](args[scrollIndex]) + else + ---@diagnostic disable-next-line: redundant-parameter + options[selected](scrollIndex) + end +end) + +RegisterNetEvent('qbx_admin:client:ToggleNoClip', function() + if GetInvokingResource() then return end + toggleNoClipMode() +end) + +local showBlips = false +local showNames = false +local netCheck1 = false +local netCheck2 = false + +RegisterNetEvent('qbx_admin:client:blips', function() + if not showBlips then + showBlips = true + netCheck1 = true + exports.qbx_core:Notify(locale('success.blips_activated'), 'success') + else + showBlips = false + exports.qbx_core:Notify(locale('error.blips_deactivated'), 'error') + end +end) + +RegisterNetEvent('qbx_admin:client:names', function() + if not showNames then + showNames = true + netCheck2 = true + exports.qbx_core:Notify(locale('success.names_activated'), 'success') + else + showNames = false + exports.qbx_core:Notify(locale('error.names_deactivated'), 'error') + end +end) + +RegisterNetEvent('qbx_admin:client:Show', function() + local players = lib.callback.await('qbx_admin:server:getPlayers', false) + for _, player in pairs(players) do + local playerId = GetPlayerFromServerId(player.id) + local ped = GetPlayerPed(playerId) + local blip = GetBlipFromEntity(ped) + local name = 'ID: '..player.id..' | '..player.name + + local tag = CreateFakeMpGamerTag(ped, name, false, false, '', 0) + SetMpGamerTagAlpha(tag, 0, 255) -- Sets 'MP_TAG_GAMER_NAME' bar alpha to 100% (not needed just as a fail safe) + SetMpGamerTagAlpha(tag, 2, 255) -- Sets 'MP_TAG_HEALTH_ARMOUR' bar alpha to 100% + SetMpGamerTagAlpha(tag, 4, 255) -- Sets 'MP_TAG_AUDIO_ICON' bar alpha to 100% + SetMpGamerTagAlpha(tag, 6, 255) -- Sets 'MP_TAG_PASSIVE_MODE' bar alpha to 100% + SetMpGamerTagHealthBarColour(tag, 25) --https://wiki.rage.mp/index.php?title=Fonts_and_Colors + + if showNames then + SetMpGamerTagVisibility(tag, 0, true) -- Activates the player ID Char name and FiveM name + SetMpGamerTagVisibility(tag, 2, true) -- Activates the health (and armor if they have it on) bar below the player names + if NetworkIsPlayerTalking(playerId) then + SetMpGamerTagVisibility(tag, 4, true) -- If player is talking a voice icon will show up on the left side of the name + else + SetMpGamerTagVisibility(tag, 4, false) + end + if GetPlayerInvincible(playerId) then + SetMpGamerTagVisibility(tag, 6, true) -- If player is in godmode a circle with a line through it will show up + else + SetMpGamerTagVisibility(tag, 6, false) + end + else + SetMpGamerTagVisibility(tag, 0, false) + SetMpGamerTagVisibility(tag, 2, false) + SetMpGamerTagVisibility(tag, 4, false) + SetMpGamerTagVisibility(tag, 6, false) + RemoveMpGamerTag(tag) -- Unloads the tags till you activate it again + netCheck2 = false + end + + -- Blips Logic + if showBlips then + if not DoesBlipExist(blip) then + blip = AddBlipForEntity(ped) + SetBlipSprite(blip, 1) + ShowHeadingIndicatorOnBlip(blip, true) + else + local blipSprite = GetBlipSprite(blip) + --Payer Death + if not GetEntityHealth(ped) then + if blipSprite ~= 274 then + SetBlipSprite(blip, 274) --Dead icon + ShowHeadingIndicatorOnBlip(blip, false) + end + --Player in Vehicle + elseif cache.vehicle ~= 0 then + local classVeh = GetVehicleClass(cache.vehicle) + local modelVeh = GetEntityModel(cache.vehicle) + --MotorCycles (8) or Cycles (13) + if classVeh == 8 or classVeh == 13 then + if blipSprite ~= 226 then + SetBlipSprite(blip, 226) --Motorcycle icon + ShowHeadingIndicatorOnBlip(blip, false) + end + --OffRoad (9) + elseif classVeh == 9 then + if blipSprite ~= 757 then + SetBlipSprite(blip, 757) --OffRoad icon + ShowHeadingIndicatorOnBlip(blip, false) + end + --Industrial (10) + elseif classVeh == 10 then + if blipSprite ~= 477 then + SetBlipSprite(blip, 477) --Truck icon + ShowHeadingIndicatorOnBlip(blip, false) + end + --Utility (11) + elseif classVeh == 11 then + if blipSprite ~= 477 then + SetBlipSprite(blip, 477) --Truck icon despite finding better one + ShowHeadingIndicatorOnBlip(blip, false) + end + --Vans (12) + elseif classVeh == 12 then + if blipSprite ~= 67 then + SetBlipSprite(blip, 67) --Van icon + ShowHeadingIndicatorOnBlip(blip, false) + end + --Boats (14) + elseif classVeh == 14 then + if blipSprite ~= 427 then + SetBlipSprite(blip, 427) --Boat icon + ShowHeadingIndicatorOnBlip(blip, false) + end + --Helicopters (15) + elseif classVeh == 15 then + if blipSprite ~= 422 then + SetBlipSprite(blip, 422) --Moving helicopter icon + ShowHeadingIndicatorOnBlip(blip, false) + end + --Planes (16) + elseif classVeh == 16 then + if modelVeh == 'besra' or modelVeh == 'hydra' or modelVeh == 'lazer' then + if blipSprite ~= 424 then + SetBlipSprite(blip, 424) --Jet icon + ShowHeadingIndicatorOnBlip(blip, false) + end + elseif blipSprite ~= 423 then + SetBlipSprite(blip, 423) --Plane icon + ShowHeadingIndicatorOnBlip(blip, false) + end + --Service (17) + elseif classVeh == 17 then + if blipSprite ~= 198 then + SetBlipSprite(blip, 198) --Taxi icon + ShowHeadingIndicatorOnBlip(blip, false) + end + --Emergency (18) + elseif classVeh == 18 then + if blipSprite ~= 56 then + SetBlipSprite(blip, 56) --Cop icon + ShowHeadingIndicatorOnBlip(blip, false) + end + --Military (19) + elseif classVeh == 19 then + if modelVeh == 'rhino' then + if blipSprite ~= 421 then + SetBlipSprite(blip, 421) --Tank icon + ShowHeadingIndicatorOnBlip(blip, false) + end + elseif blipSprite ~= 750 then + SetBlipSprite(blip, 750) --Military truck icon + ShowHeadingIndicatorOnBlip(blip, false) + end + --Commercial (20) + elseif classVeh == 20 then + if blipSprite ~= 477 then + SetBlipSprite(blip, 477) --Truck icon + ShowHeadingIndicatorOnBlip(blip, false) + end + --Every car (0, 1, 2, 3, 4, 5, 6, 7) + else + if modelVeh == 'insurgent' or modelVeh == 'insurgent2' or modelVeh == 'limo2' then + if blipSprite ~= 426 then + SetBlipSprite(blip, 426) --Armed car icon + ShowHeadingIndicatorOnBlip(blip, false) + end + elseif blipSprite ~= 225 then + SetBlipSprite(blip, 225) --Car icon + ShowHeadingIndicatorOnBlip(blip, true) + end + end + -- Show number in case of passangers + local passengers = GetVehicleNumberOfPassengers(cache.vehicle) + if passengers then + if not IsVehicleSeatFree(cache.vehicle, -1) then + passengers = passengers + 1 + end + ShowNumberOnBlip(blip, passengers) + else + HideNumberOnBlip(blip) + end + --Player on Foot + else + HideNumberOnBlip(blip) + if blipSprite ~= 1 then + SetBlipSprite(blip, 1) + ShowHeadingIndicatorOnBlip(blip, true) + end + end + + SetBlipRotation(blip, math.ceil(GetEntityHeading(cache.vehicle))) + SetBlipNameToPlayerName(blip, playerId) + SetBlipScale(blip, 0.85) + + if IsPauseMenuActive() then + SetBlipAlpha(blip, 255) + else + local x1, y1 = table.unpack(GetEntityCoords(cache.ped, true)) + local x2, y2 = table.unpack(GetEntityCoords(ped, true)) + local distance = (math.floor(math.abs(math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2))) / -1)) + 900 + distance = distance < 0 and 0 or distance > 255 and 255 or distance + SetBlipAlpha(blip, distance) + end + end + else + RemoveBlip(blip) + netCheck1 = false + end + end +end) + +lib.callback.register('qbx_admin:client:SaveCarDialog', function() + local response = lib.alertDialog({ + header = 'Save Car', + content = 'This vehicle is already owned, do you want to override the current owner?', + centered = true, + cancel = true, + labels = { + confirm = 'Yes', + cancel = 'No' + } + }) + return response == 'confirm' +end) + +lib.callback.register('qbx_admin:client:GetVehicleInfo', function() + return VEHICLES_HASH[GetEntityModel(cache.vehicle)].model, lib.getVehicleProperties(cache.vehicle) +end) + +CreateThread(function() + while true do + Wait(1000) + if netCheck1 or netCheck2 then + TriggerEvent('qbx_admin:client:Show') + end + end +end) \ No newline at end of file diff --git a/client/dev.lua b/client/dev.lua new file mode 100644 index 0000000..6e6d8e1 --- /dev/null +++ b/client/dev.lua @@ -0,0 +1,84 @@ +local showCoords = false +local vehicleDev = false +local vehicleTypes = {'Compacts', 'Sedans', 'SUVs', 'Coupes', 'Muscle', 'Sports Classics', 'Sports', 'Super', 'Motorcycles', 'Off-road', 'Industrial', 'Utility', 'Vans', 'Cycles', 'Boats', 'Helicopters', 'Planes', 'Service', 'Emergency', 'Military', 'Commercial', 'Trains', 'Open Wheel'} +local options = { + function() CopyToClipboard('coords2') lib.showMenu('qbx_adminmenu_dev_menu', MenuIndexes.qbx_adminmenu_dev_menu) end, + function() CopyToClipboard('coords3') lib.showMenu('qbx_adminmenu_dev_menu', MenuIndexes.qbx_adminmenu_dev_menu) end, + function() CopyToClipboard('coords4') lib.showMenu('qbx_adminmenu_dev_menu', MenuIndexes.qbx_adminmenu_dev_menu) end, + function() CopyToClipboard('heading') lib.showMenu('qbx_adminmenu_dev_menu', MenuIndexes.qbx_adminmenu_dev_menu) end, + function() + showCoords = not showCoords + while showCoords do + local coords, heading = GetEntityCoords(cache.ped), GetEntityHeading(cache.ped) + + qbx.drawText2d({ + text = ('~o~vector4~w~(%s, %s, %s, %s)'):format(qbx.math.round(coords.x, 2), qbx.math.round(coords.y, 2), qbx.math.round(coords.z, 2), qbx.math.round(heading, 2)), + coords = vec2(1.0, 0.5), + scale = 0.5, + font = 6 + }) + + Wait(0) + end + end, + function() + vehicleDev = not vehicleDev + while vehicleDev do + if cache.vehicle then + local clutch, gear, rpm, temperature = GetVehicleClutch(cache.vehicle), GetVehicleCurrentGear(cache.vehicle), GetVehicleCurrentRpm(cache.vehicle), GetVehicleEngineTemperature(cache.vehicle) + local oil, angle, body, class = GetVehicleOilLevel(cache.vehicle), GetVehicleSteeringAngle(cache.vehicle), GetVehicleBodyHealth(cache.vehicle), vehicleTypes[GetVehicleClass(cache.vehicle)] + local dirt, maxSpeed, netId, hash = GetVehicleDirtLevel(cache.vehicle), GetVehicleEstimatedMaxSpeed(cache.vehicle), VehToNet(cache.vehicle), GetEntityModel(cache.vehicle) + local name = GetLabelText(GetDisplayNameFromVehicleModel(hash)) + qbx.drawText2d({ + text = ('~o~Clutch: ~w~ %s | ~o~Gear: ~w~ %s | ~o~Rpm: ~w~ %s | ~o~Temperature: ~w~ %s'):format(qbx.math.round(clutch, 4), gear, qbx.math.round(rpm, 4), temperature), + coords = vec2(1.0, 0.575), + scale = 0.45, + font = 6 + }) + qbx.drawText2d({ + text = ('~o~Oil: ~w~ %s | ~o~Steering Angle: ~w~ %s | ~o~Body: ~w~ %s | ~o~Class: ~w~ %s'):format(qbx.math.round(oil, 4), qbx.math.round(angle, 4), qbx.math.round(body, 4), class), + coords = vec2(1.0, 0.600), + scale = 0.45, + font = 6 + }) + qbx.drawText2d({ + text = ('~o~Dirt: ~w~ %s | ~o~Est Max Speed: ~w~ %s | ~o~Net ID: ~w~ %s | ~o~Hash: ~w~ %s'):format(qbx.math.round(dirt, 4), qbx.math.round(maxSpeed, 4) * 3.6, netId, hash), + coords = vec2(1.0, 0.625), + scale = 0.45, + font = 6 + }) + qbx.drawText2d({ + text = ('~o~Vehicle Name: ~w~ %s'):format(name), + coords = vec2(1.0, 0.650), + scale = 0.45, + font = 6 + }) + Wait(0) + else + Wait(800) + end + end + end, +} + +lib.registerMenu({ + id = 'qbx_adminmenu_dev_menu', + title = locale('title.dev_menu'), + position = 'top-right', + onClose = function(keyPressed) + CloseMenu(false, keyPressed, 'qbx_adminmenu_main_menu') + end, + onSelected = function(selected) + MenuIndexes.qbx_adminmenu_dev_menu = selected + end, + options = { + {label = locale('dev_options.label1'), description = locale('dev_options.desc1'), icon = 'fas fa-compass'}, + {label = locale('dev_options.label2'), description = locale('dev_options.desc2'), icon = 'fas fa-compass'}, + {label = locale('dev_options.label3'), description = locale('dev_options.desc3'), icon = 'fas fa-compass'}, + {label = locale('dev_options.label4'), description = locale('dev_options.desc4'), icon = 'fas fa-compass'}, + {label = locale('dev_options.label5'), description = locale('dev_options.desc5'), icon = 'fas fa-compass-drafting', close = false}, + {label = locale('dev_options.label6'), description = locale('dev_options.desc6'), icon = 'fas fa-car-side', close = false} + } +}, function(selected) + options[selected]() +end) diff --git a/client/main.lua b/client/main.lua new file mode 100644 index 0000000..5240fa5 --- /dev/null +++ b/client/main.lua @@ -0,0 +1,54 @@ +MenuIndexes = {} + +lib.registerMenu({ + id = 'qbx_adminmenu_main_menu', + title = locale('title.main_menu'), + position = 'top-right', + onClose = function() + CloseMenu(true) + end, + onSelected = function(selected) + MenuIndexes.qbx_adminmenu_main_menu = selected + end, + options = { + {label = locale('main_options.label1'), description = locale('main_options.desc1'), icon = 'fas fa-hammer', args = {'qbx_adminmenu_admin_menu'}}, + {label = locale('main_options.label2'), description = locale('main_options.desc2'), icon = 'fas fa-user', args = {'qbx_adminmenu_players_menu'}}, + {label = locale('main_options.label3'), description = locale('main_options.desc3'), icon = 'fas fa-server', args = {'qbx_adminmenu_server_menu'}}, + {label = locale('main_options.label4'), description = locale('main_options.desc4'), icon = 'fas fa-car', args = {'qbx_adminmenu_vehicles_menu'}}, + {label = locale('main_options.label5'), description = locale('main_options.desc5'), icon = 'fas fa-toolbox', args = {'qbx_adminmenu_dev_menu'}}, + {label = locale('main_options.label6'), description = locale('main_options.desc6'), icon = 'fas fa-list', args = {'qbx_adminmenu_reports_menu'}} + } +}, function(_, _, args) + if args[1] == 'qbx_adminmenu_players_menu' then + GeneratePlayersMenu() + elseif args[1] == 'qbx_adminmenu_reports_menu' then + GenerateReportMenu() + else + lib.showMenu(args[1], MenuIndexes[args[1]]) + end +end) + +function CloseMenu(isFullMenuClose, keyPressed, previousMenu) + if isFullMenuClose or not keyPressed or keyPressed == 'Escape' then + lib.hideMenu(false) + return + end + + lib.showMenu(previousMenu, MenuIndexes[previousMenu]) +end + +RegisterNetEvent('qbx_admin:client:openMenu', function() + lib.showMenu('qbx_adminmenu_main_menu', MenuIndexes.qbx_adminmenu_main_menu) +end) + +RegisterNetEvent('qbx_admin:client:setModel', function(skin) + local model = joaat(skin) + SetEntityInvincible(cache.ped, true) + if IsModelInCdimage(model) and IsModelValid(model) then + lib.requestModel(model) + SetPlayerModel(cache.playerId, model) + SetPedRandomComponentVariation(cache.ped, 1) + SetModelAsNoLongerNeeded(model) + end + SetEntityInvincible(cache.ped, false) +end) diff --git a/client/player.lua b/client/player.lua new file mode 100644 index 0000000..a39f5de --- /dev/null +++ b/client/player.lua @@ -0,0 +1,308 @@ +local selectedPlayer +local playerOptions = { + function() + lib.showMenu('qbx_adminmenu_player_general_menu', MenuIndexes.qbx_adminmenu_player_general_menu) + end, + function() + lib.showMenu('qbx_adminmenu_player_administration_menu', MenuIndexes.qbx_adminmenu_player_administration_menu) + end, + function() + lib.showMenu('qbx_adminmenu_player_extra_menu', MenuIndexes.qbx_adminmenu_player_extra_menu) + end, + function() + local input = lib.inputDialog('Name Change', {'Firstname', 'Lastname'}) + if not input then GeneratePlayersMenu() return end + TriggerServerEvent('qbx_admin:server:changePlayerData', 'name', selectedPlayer, input) + GeneratePlayersMenu() + end, + function() + local input = lib.inputDialog('Food', { + {type = 'number', label = 'Percentage', min = 0, max = 100} + }) + if not input then GeneratePlayersMenu() return end + TriggerServerEvent('qbx_admin:server:changePlayerData', 'food', selectedPlayer, input) + GeneratePlayersMenu() + end, + function() + local input = lib.inputDialog('Thirst', { + {type = 'number', label = 'Percentage', min = 0, max = 100} + }) + if not input then GeneratePlayersMenu() return end + TriggerServerEvent('qbx_admin:server:changePlayerData', 'thirst', selectedPlayer, input) + GeneratePlayersMenu() + end, + function() + local input = lib.inputDialog('Stress', { + {type = 'number', label = 'Percentage', min = 0, max = 100} + }) + if not input then GeneratePlayersMenu() return end + TriggerServerEvent('qbx_admin:server:changePlayerData', 'stress', selectedPlayer, input) + GeneratePlayersMenu() + end, + function() + local input = lib.inputDialog('Armor', { + {type = 'number', label = 'Percentage', min = 0, max = 100} + }) + if not input then GeneratePlayersMenu() return end + TriggerServerEvent('qbx_admin:server:changePlayerData', 'armor', selectedPlayer, input) + GeneratePlayersMenu() + end, + function() + local input = lib.inputDialog('Phone', {'Number'}) + if not input then GeneratePlayersMenu() return end + TriggerServerEvent('qbx_admin:server:changePlayerData', 'phone', selectedPlayer, input) + GeneratePlayersMenu() + end, + function() + local input = lib.inputDialog('Crafting', { + {type = 'number', label = 'Reputation'} + }) + if not input then GeneratePlayersMenu() return end + TriggerServerEvent('qbx_admin:server:changePlayerData', 'crafting', selectedPlayer, input) + GeneratePlayersMenu() + end, + function() + local input = lib.inputDialog('Dealer', { + {type = 'number', label = 'Reputation'} + }) + if not input then GeneratePlayersMenu() return end + TriggerServerEvent('qbx_admin:server:changePlayerData', 'dealer', selectedPlayer, input) + GeneratePlayersMenu() + end, + function() + local input = lib.inputDialog('Money', { + {type = 'number', label = 'Cash'} + }) + if not input then GeneratePlayersMenu() return end + TriggerServerEvent('qbx_admin:server:changePlayerData', 'cash', selectedPlayer, input) + GeneratePlayersMenu() + end, + function() + local input = lib.inputDialog('Money', { + {type = 'number', label = 'Bank'} + }) + if not input then GeneratePlayersMenu() return end + TriggerServerEvent('qbx_admin:server:changePlayerData', 'bank', selectedPlayer, input) + GeneratePlayersMenu() + end, + function() + local input = lib.inputDialog('Job', { + {type = 'input', label = 'Name'}, + {type = 'number', label = 'Grade'} + }) + if not input then GeneratePlayersMenu() return end + TriggerServerEvent('qbx_admin:server:changePlayerData', 'job', selectedPlayer, input) + GeneratePlayersMenu() + end, + function() + local input = lib.inputDialog('Gang', { + {type = 'input', label = 'Name'}, + {type = 'number', label = 'Grade'} + }) + if not input then GeneratePlayersMenu() return end + TriggerServerEvent('qbx_admin:server:changePlayerData', 'gang', selectedPlayer, input) + GeneratePlayersMenu() + end, + function() + local input = lib.inputDialog('Radio', { + {type = 'number', label = 'Frequency'} + }) + if not input then GeneratePlayersMenu() return end + TriggerServerEvent('qbx_admin:server:changePlayerData', 'radio', selectedPlayer, input) + GeneratePlayersMenu() + end, + function() + local license = selectedPlayer.license:gsub('license:', '') + lib.setClipboard(license) + lib.showMenu(('qbx_adminmenu_player_menu_%s'):format(selectedPlayer.id), MenuIndexes[('qbx_adminmenu_player_menu_%s'):format(selectedPlayer.id)]) + end, + function() + local discord = selectedPlayer.discord:gsub('discord:', '') + lib.setClipboard(discord) + lib.showMenu(('qbx_adminmenu_player_menu_%s'):format(selectedPlayer.id), MenuIndexes[('qbx_adminmenu_player_menu_%s'):format(selectedPlayer.id)]) + end, + function() + local steam = selectedPlayer.steam:gsub('steam:', '') + lib.setClipboard(steam) + lib.showMenu(('qbx_adminmenu_player_menu_%s'):format(selectedPlayer.id), MenuIndexes[('qbx_adminmenu_player_menu_%s'):format(selectedPlayer.id)]) + end, +} + +function GeneratePlayersMenu() + local players = lib.callback.await('qbx_admin:server:getPlayers', false) + if not players then + lib.showMenu('qbx_adminmenu_main_menu', MenuIndexes.qbx_adminmenu_main_menu) + return + end + local optionsList = {} + for i = 1, #players do + optionsList[#optionsList + 1] = {label = string.format('ID: %s | Name: %s', players[i].id, players[i].name), description = string.format('CID: %s', players[i].cid), args = {players[i]}} + end + lib.registerMenu({ + id = 'qbx_adminmenu_players_menu', + title = locale('title.players_menu'), + position = 'top-right', + onClose = function(keyPressed) + CloseMenu(false, keyPressed, 'qbx_adminmenu_main_menu') + end, + onSelected = function(selected) + MenuIndexes.qbx_adminmenu_players_menu = selected + end, + options = optionsList + }, function(_, _, args) + local player = lib.callback.await('qbx_admin:server:getPlayer', false, args[1].id) + if not player then + lib.showMenu('qbx_adminmenu_main_menu', MenuIndexes.qbx_adminmenu_main_menu) + return + end + lib.registerMenu({ + id = ('qbx_adminmenu_player_menu_%s'):format(args[1].id), + title = player.name, + position = 'top-right', + onClose = function(keyPressed) + CloseMenu(false, keyPressed, 'qbx_adminmenu_players_menu') + end, + onSelected = function(selected) + MenuIndexes[('qbx_adminmenu_player_menu_%s'):format(args[1].id)] = selected + end, + options = { + {label = locale('player_options.label1'), description = locale('player_options.desc1'), icon = 'fas fa-wrench'}, + {label = locale('player_options.label2'), description = locale('player_options.desc2'), icon = 'fas fa-file-invoice'}, + {label = locale('player_options.label3'), description = locale('player_options.desc3'), icon = 'fas fa-gamepad'}, + {label = string.format('Name: %s', player.name)}, + {label = string.format('Food: %s', player.food)}, + {label = string.format('Water: %s', player.water)}, + {label = string.format('Stress: %s', player.stress)}, + {label = string.format('Armor: %s', player.armor)}, + {label = string.format('Phone: %s', player.phone)}, + {label = string.format('Crafting Rep: %s', player.craftingrep)}, + {label = string.format('Dealer Rep: %s', player.dealerrep)}, + {label = string.format('Cash: %s', lib.math.groupdigits(player.cash))}, + {label = string.format('Bank: %s', lib.math.groupdigits(player.bank))}, + {label = string.format('Job: %s', player.job)}, + {label = string.format('Gang: %s', player.gang)}, + {label = string.format('Radio: %s', Player(args[1].id).state.radioChannel)}, + {label = string.format('%s', player.license), description = 'License'}, + {label = string.format('%s', player.discord), description = 'Discord'}, + {label = string.format('%s', player.steam), description = 'Steam'} + } + }, function(selected) + playerOptions[selected]() + end) + selectedPlayer = player + lib.showMenu(('qbx_adminmenu_player_menu_%s'):format(args[1].id), MenuIndexes[('qbx_adminmenu_player_menu_%s'):format(args[1].id)]) + end) + lib.showMenu('qbx_adminmenu_players_menu', MenuIndexes.qbx_adminmenu_players_menu) +end + +lib.registerMenu({ + id = 'qbx_adminmenu_player_general_menu', + title = locale('player_options.label1'), + position = 'top-right', + onClose = function(keyPressed) + CloseMenu(false, keyPressed, ('qbx_adminmenu_player_menu_%s'):format(selectedPlayer?.id)) + end, + onSelected = function(selected) + MenuIndexes.qbx_adminmenu_player_general_menu = selected + end, + options = { + {label = locale('player_options.general.labelkill'), description = locale('player_options.general.desckill'), icon = 'fas fa-skull', close = false}, + {label = locale('player_options.general.labelrevive'), description = locale('player_options.general.descrevive'), icon = 'fas fa-cross', close = false}, + {label = locale('player_options.general.labelfreeze'), description = locale('player_options.general.descfreeze'), icon = 'fas fa-icicles', close = false}, + {label = locale('player_options.general.labelgoto'), description = locale('player_options.general.descgoto'), icon = 'fas fa-arrow-right-long', close = false}, + {label = locale('player_options.general.labelbring'), description = locale('player_options.general.descbring'), icon = 'fas fa-arrow-left-long', close = false}, + {label = locale('player_options.general.labelsitinveh'), description = locale('player_options.general.descsitinveh'), icon = 'fas fa-chair', close = false}, + {label = locale('player_options.general.labelrouting'), description = locale('player_options.general.descrouting'), icon = 'fas fa-bucket'}, + } +}, function(selected) + if selected == 7 then + local input = lib.inputDialog(selectedPlayer.name, { + {type = 'number', label = locale('player_options.general.labelrouting'), placeholder = '25'} + }) + if not input then return end if not input[1] then return end + TriggerServerEvent('qbx_admin:server:playerOptionsGeneral', selected, selectedPlayer, input[1]) + lib.showMenu(('qbx_adminmenu_player_menu_%s'):format(selectedPlayer?.id), MenuIndexes[('qbx_adminmenu_player_menu_%s'):format(selectedPlayer?.id)]) + else + TriggerServerEvent('qbx_admin:server:playerOptionsGeneral', selected, selectedPlayer) + end +end) + +lib.registerMenu({ + id = 'qbx_adminmenu_player_administration_menu', + title = locale('player_options.label2'), + position = 'top-right', + onClose = function(keyPressed) + CloseMenu(false, keyPressed, ('qbx_adminmenu_player_menu_%s'):format(selectedPlayer?.id)) + end, + onSelected = function(selected) + MenuIndexes.qbx_adminmenu_player_administration_menu = selected + end, + options = { + {label = locale('player_options.administration.labelkick'), description = locale('player_options.administration.desckick'), icon = 'fas fa-plane-departure'}, + {label = locale('player_options.administration.labelban'), description = locale('player_options.administration.descban'), icon = 'fas fa-gavel'}, + {label = locale('player_options.administration.labelperm'), description = locale('player_options.administration.descperm'), values = {locale('player_options.administration.permvalue1'), + locale('player_options.administration.permvalue2'), locale('player_options.administration.permvalue3'), locale('player_options.administration.permvalue4')}, args = {'remove', 'mod', 'admin', 'god'}, icon = 'fas fa-book-bookmark'}, + } +}, function(selected, scrollIndex, args) + if selected == 1 then + local input = lib.inputDialog(selectedPlayer.name, {locale('player_options.administration.inputkick')}) + if not input then lib.showMenu('qbx_adminmenu_player_administration_menu', MenuIndexes.qbx_adminmenu_player_administration_menu) return end if not input[1] then return end + TriggerServerEvent('qbx_admin:server:playerAdministration', selected, selectedPlayer, input[1]) + lib.showMenu('qbx_adminmenu_player_administration_menu', MenuIndexes.qbx_adminmenu_player_administration_menu) + elseif selected == 2 then + local input = lib.inputDialog(selectedPlayer.name, { + { type = 'input', label = locale('player_options.administration.inputkick'), placeholder = 'VDM'}, + { type = 'number', label = locale('player_options.administration.input1ban')}, + { type = 'number', label = locale('player_options.administration.input2ban')}, + { type = 'number', label = locale('player_options.administration.input3ban')} + }) + if not input then lib.showMenu('qbx_adminmenu_player_administration_menu', MenuIndexes.qbx_adminmenu_player_general_menu) return end if not input[1] or not input[2] and not input[3] and not input[4] then return end + TriggerServerEvent('qbx_admin:server:playerAdministration', selected, selectedPlayer, input) + lib.showMenu('qbx_adminmenu_player_administration_menu', MenuIndexes.qbx_adminmenu_player_administration_menu) + else + TriggerServerEvent('qbx_admin:server:playerAdministration', selected, selectedPlayer, args[scrollIndex]) + lib.showMenu('qbx_adminmenu_player_administration_menu', MenuIndexes.qbx_adminmenu_player_administration_menu) + end +end) + +lib.registerMenu({ + id = 'qbx_adminmenu_player_extra_menu', + title = locale('player_options.label2'), + position = 'top-right', + onClose = function(keyPressed) + CloseMenu(false, keyPressed, ('qbx_adminmenu_player_menu_%s'):format(selectedPlayer?.id)) + end, + onSelected = function(selected) + MenuIndexes.qbx_adminmenu_player_extra_menu = selected + end, + options = { + {label = 'Open Inventory'}, + {label = 'Give Clothing Menu'}, + {label = 'Give Item'}, + {label = 'Mute'} + } +}, function(selected) + if selected == 1 then + exports.ox_inventory:openInventory('player', selectedPlayer.id) + elseif selected == 2 then + local succeeded = lib.callback.await('qbx_admin:server:clothingMenu', false, selectedPlayer.id) + if succeeded then return end + lib.showMenu('qbx_adminmenu_player_extra_menu', MenuIndexes.qbx_adminmenu_player_extra_menu) + elseif selected == 3 then + local dialog = lib.inputDialog('Give Item', { + {type = 'input', label = 'Item', placeholder = 'phone'}, + {type = 'number', label = 'Amount', default = 1} + }) + if not dialog or not dialog[1] or dialog[1] == '' or not dialog[2] or dialog[2] < 1 then + lib.showMenu('qbx_adminmenu_player_extra_menu', MenuIndexes.qbx_adminmenu_player_extra_menu) + return + end + ExecuteCommand('giveitem ' .. selectedPlayer.id .. ' ' .. dialog[1] .. ' ' .. dialog[2]) + elseif selected == 4 then + exports['pma-voice']:toggleMutePlayer(selectedPlayer.id) + end +end) + +RegisterNetEvent('qbx_admin:client:killPlayer', function() + SetEntityHealth(cache.ped, 0) +end) \ No newline at end of file diff --git a/client/reports.lua b/client/reports.lua new file mode 100644 index 0000000..ec645d1 --- /dev/null +++ b/client/reports.lua @@ -0,0 +1,89 @@ +local function reportAction(selected, report) + if selected == 1 then + lib.alertDialog({ + header = ('Report ID: %s | Sender: %s'):format(report.id, report.senderName), + content = ('message: %s'):format(report.message), + centered = true, + cancel = false, + size = 'lg', + labels = { + confirm = 'Close' + } + }) + + lib.showMenu(('qbx_adminmenu_reports_menu_%s'):format(report.id), MenuIndexes[('qbx_adminmenu_reports_menu_%s'):format(report.id)]) + elseif selected == 2 then + local input = lib.inputDialog(('Report ID: %s | Sender: %s'):format(report.id, report.senderName), { + {type = 'input', label = 'Reply'} + }) + if input[1] == '' then + exports.qbx_core:Notify(locale('error.no_report_reply'), 'error') + else + TriggerServerEvent('qbx_admin:server:sendReply', report, input[1]) + end + + lib.showMenu(('qbx_adminmenu_reports_menu_%s'):format(report.id), MenuIndexes[('qbx_adminmenu_reports_menu_%s'):format(report.id)]) + elseif selected == 3 then + TriggerServerEvent('qbx_admin:server:deleteReport', report) + GenerateReportMenu() + else + return lib.showMenu(('qbx_adminmenu_reports_menu_%s'):format(report.id), MenuIndexes[('qbx_adminmenu_reports_menu_%s'):format(report.id)]) + end +end + +function GenerateReportMenu() + local reports = lib.callback.await('qbx_admin:server:getReports', false) + + if not reports or #reports < 1 then + exports.qbx_core:Notify(locale('error.no_reports'), 'error') + return lib.showMenu('qbx_adminmenu_main_menu', MenuIndexes.qbx_adminmenu_main_menu) + else + exports.qbx_core:Notify(locale('success.report_load'):format(#reports), 'success') + end + + local reportsList = {} + for i = 1, #reports do + reportsList[i] = {label = locale('report_options.label1'):format(reports[i].id, reports[i].senderName), description = locale('report_options.desc1'), args = {reports[i]}} + end + + lib.registerMenu({ + id = 'qbx_adminmenu_reports_menu', + title = locale('title.reports_menu'), + position = 'top-right', + onClose = function(keyPressed) + CloseMenu(false, keyPressed, 'qbx_adminmenu_main_menu') + end, + onSelected = function(selected) + MenuIndexes.qbx_adminmenu_reports_menu = selected + end, + options = reportsList + }, function(_, _, args) + local report = args[1] + + lib.registerMenu({ + id = ('qbx_adminmenu_reports_menu_%s'):format(report.id), + title = ('Report ID: %s | Sender: %s'):format(report.id, report.senderName), + position = 'top-right', + onClose = function(keyPressed) + CloseMenu(false, keyPressed, 'qbx_adminmenu_reports_menu') + end, + onSelected = function(selected) + MenuIndexes[('qbx_adminmenu_reports_menu_%s'):format(report.id)] = selected + end, + options = { + {label = 'View Message', icon = 'fas fa-message'}, + {label = 'Send Message', icon = 'fas fa-reply'}, + {label = 'Close Report', icon = 'fas fa-trash'}, + {label = ('Claimed By: %s'):format(report.claimed)}, + {label = ('Report ID: %s'):format(report.id)}, + {label = ('Sender ID: %s'):format(report.senderId)}, + {label = ('Sender Name: %s'):format(report.senderName)} + } + }, function(selected) + reportAction(selected, report) + end) + lib.showMenu(('qbx_adminmenu_reports_menu_%s'):format(report.id), MenuIndexes[('qbx_adminmenu_reports_menu_%s'):format(report.id)]) + end) + + lib.showMenu('qbx_adminmenu_reports_menu', MenuIndexes.qbx_adminmenu_reports_menu) +end \ No newline at end of file diff --git a/client/server.lua b/client/server.lua new file mode 100644 index 0000000..d6abc1b --- /dev/null +++ b/client/server.lua @@ -0,0 +1,49 @@ +local options = { + function(weather) TriggerServerEvent('qb-weathersync:server:setWeather', weather) end, + function(time) TriggerServerEvent('qb-weathersync:server:setTime', time) end, + function() + local input = lib.inputDialog(locale('server_options.label3'), { + {type = 'number', label = locale('server_options.input3label'), min = 0, max = 1000} + }) + if not input then return end if not input[1] then return end + lib.callback('qbx_admin:callback:getradiolist', false, function(players, frequency) + local optionsList = {} + for i = 1, #players do optionsList[#optionsList + 1] = {title = players[i].name .. ' | ' .. players[i].id} end + lib.registerContext({id = 'frequency_list', title = 'Frequency ' .. frequency, options = optionsList }) + lib.showContext('frequency_list') + end, input[1]) + end, + function() + local input = lib.inputDialog(locale('server_options.label4'), {locale('server_options.input4label')}) + if not input then return end if not input[1] then return end + TriggerServerEvent('inventory:server:OpenInventory', 'stash', input[1]) + TriggerEvent('inventory:client:SetCurrentStash', input[1]) + end, +} + +lib.registerMenu({ + id = 'qbx_adminmenu_server_menu', + title = locale('title.server_menu'), + position = 'top-right', + onClose = function(keyPressed) + CloseMenu(false, keyPressed, 'qbx_adminmenu_main_menu') + end, + onSelected = function(selected) + MenuIndexes.qbx_adminmenu_server_menu = selected + end, + options = { + {label = locale('server_options.label1'), description = locale('server_options.desc1'), icon = 'fas fa-cloud', values = {locale('server_options.value1_1'), locale('server_options.value1_2'), locale('server_options.value1_3'), locale('server_options.value1_4'), locale('server_options.value1_5'), locale('server_options.value1_6'), + locale('server_options.value1_7'), locale('server_options.value1_8'), locale('server_options.value1_9'), locale('server_options.value1_10'), locale('server_options.value1_11'), locale('server_options.value1_12'), locale('server_options.value1_13'), locale('server_options.value1_14'), locale('server_options.value1_15')}, + args = {'Extrasunny', 'Clear', 'Neutral', 'Smog', 'Foggy', 'Overcast', 'Clouds', 'Clearing', 'Rain', 'Thunder', 'Snow', 'Blizzard', 'Snowlight', 'Xmas', 'Halloween'}, close = false}, + {label = locale('server_options.label2'), description = locale('server_options.desc2'), icon = 'fas fa-clock', values = {'00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00'}, + args = {'00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23'}, close = false}, + {label = locale('server_options.label3'), description = locale('server_options.desc3'), icon = 'fas fa-walkie-talkie'}, + {label = locale('server_options.label4'), description = locale('server_options.desc4'), icon = 'fas fa-box-open'}, + } +}, function(selected, scrollIndex, args) + if selected == 1 or selected == 2 then + options[selected](args[scrollIndex]) + else + options[selected]() + end +end) diff --git a/client/vectors.lua b/client/vectors.lua new file mode 100644 index 0000000..7a1754d --- /dev/null +++ b/client/vectors.lua @@ -0,0 +1,30 @@ +function CopyToClipboard(dataType) + local coords = GetEntityCoords(cache.ped) + local x, y, z = qbx.math.round(coords.x, 2), qbx.math.round(coords.y, 2), qbx.math.round(coords.z, 2) + local heading = GetEntityHeading(cache.ped) + local h = qbx.math.round(heading, 2) + + local data + local message + + if dataType == 'coords2' then + data = string.format('vec2(%s, %s)', x, y) + message = locale('success.coords_copied') + elseif dataType == 'coords3' then + data = string.format('vec3(%s, %s, %s)', x, y, z) + message = locale('success.coords_copied') + elseif dataType == 'coords4' then + data = string.format('vec4(%s, %s, %s, %s)', x, y, z, h) + message = locale('success.coords_copied') + elseif dataType == 'heading' then + data = tostring(h) + message = locale('success.heading_copied') + end + + lib.setClipboard(data) + exports.qbx_core:Notify(message, 'success') +end + +RegisterNetEvent('qbx_admin:client:copyToClipboard', function(dataType) + CopyToClipboard(dataType) +end) diff --git a/client/vehicle.lua b/client/vehicle.lua new file mode 100644 index 0000000..764a052 --- /dev/null +++ b/client/vehicle.lua @@ -0,0 +1,160 @@ +local coreVehicles = exports.qbx_core:GetVehiclesByName() + +function GenerateVehiclesSpawnMenu() + local canUseMenu = lib.callback.await('qbx_admin:server:canUseMenu', false) + if not canUseMenu then + lib.showMenu('qbx_adminmenu_main_menu', MenuIndexes.qbx_adminmenu_main_menu) + return + end + + local indexedCategories = {} + local categories = {} + local vehs = {} + for _, v in pairs(coreVehicles) do + categories[v.category] = true + end + + local categoryIndex = 1 + local newCategories = {} + for k in pairs(categories) do + newCategories[categoryIndex] = k + categoryIndex += 1 + end + + categories = newCategories + + table.sort(categories, function(a, b) + return a < b + end) + + for i = 1, #categories do + lib.setMenuOptions('qbx_adminmenu_spawn_vehicles_menu', {label = qbx.string.capitalize(categories[i]), args = {('qbx_adminmenu_spawn_vehicles_menu_%s'):format(categories[i])}}, i) + + lib.registerMenu({ + id = ('qbx_adminmenu_spawn_vehicles_menu_%s'):format(categories[i]), + title = categories[i], + position = 'top-right', + onClose = function(keyPressed) + CloseMenu(false, keyPressed, 'qbx_adminmenu_spawn_vehicles_menu') + end, + onSelected = function(selected) + MenuIndexes[('qbx_adminmenu_spawn_vehicles_menu_%s'):format(categories[i])] = selected + end, + options = {} + }, function(_, _, args) + local vehNetId = lib.callback.await('qbx_admin:server:spawnVehicle', false, args[1]) + if not vehNetId then return end + local veh + repeat + veh = NetToVeh(vehNetId) + Wait(100) + until DoesEntityExist(veh) + TriggerEvent('qb-vehiclekeys:client:AddKeys', qbx.getVehiclePlate(veh)) + SetVehicleNeedsToBeHotwired(veh, false) + SetVehicleHasBeenOwnedByPlayer(veh, true) + SetEntityAsMissionEntity(veh, true, false) + SetVehicleIsStolen(veh, false) + SetVehicleIsWanted(veh, false) + SetVehicleEngineOn(veh, true, true, true) + SetPedIntoVehicle(cache.ped, veh, -1) + SetVehicleOnGroundProperly(veh) + SetVehicleRadioEnabled(veh, true) + SetVehRadioStation(veh, 'OFF') + end) + indexedCategories[categories[i]] = 1 + end + + for k in pairs(coreVehicles) do + vehs[#vehs + 1] = k + end + + table.sort(vehs, function(a, b) + return a < b + end) + + for i = 1, #vehs do + local v = coreVehicles[vehs[i]] + lib.setMenuOptions(('qbx_adminmenu_spawn_vehicles_menu_%s'):format(v.category), {label = v.name, args = {v.model}}, indexedCategories[v.category]) + indexedCategories[v.category] += 1 + end + + lib.showMenu('qbx_adminmenu_spawn_vehicles_menu', MenuIndexes.qbx_adminmenu_spawn_vehicles_menu) +end + +lib.registerMenu({ + id = 'qbx_adminmenu_vehicles_menu', + title = 'Vehicles', + position = 'top-right', + onClose = function(keyPressed) + CloseMenu(false, keyPressed, 'qbx_adminmenu_main_menu') + end, + onSelected = function(selected) + MenuIndexes.qbx_adminmenu_vehicles_menu = selected + end, + options = { + {label = 'Spawn Vehicle'}, + {label = 'Fix Vehicle', close = false}, + {label = 'Buy Vehicle', close = true}, + {label = 'Remove Vehicle', close = false}, + {label = 'Tune Vehicle'}, + {label = 'Change Plate'} + } +}, function(selected) + if selected == 1 then + GenerateVehiclesSpawnMenu() + elseif selected == 2 then + ExecuteCommand('fix') + elseif selected == 3 then + ExecuteCommand('admincar') + elseif selected == 4 then + ExecuteCommand('dv') + elseif selected == 5 then + if not cache.vehicle then + exports.qbx_core:Notify('You have to be in a vehicle, to use this', 'error') + lib.showMenu('qbx_adminmenu_vehicles_menu', MenuIndexes.qbx_adminmenu_vehicles_menu) + return + end + + -- New customs needs a way to open it from other resources + exports.qbx_core:Notify('Currently no support for new customs', 'error') + elseif selected == 6 then + if not cache.vehicle then + exports.qbx_core:Notify('You have to be in a vehicle, to use this', 'error') + lib.showMenu('qbx_adminmenu_vehicles_menu', MenuIndexes.qbx_adminmenu_vehicles_menu) + return + end + + local dialog = lib.inputDialog('Custom License Plate (Max. 8 characters)', {'License Plate'}) + + if not dialog or not dialog[1] or dialog[1] == '' then + Wait(200) + lib.showMenu('qbx_adminmenu_vehicles_menu', MenuIndexes.qbx_adminmenu_vehicles_menu) + return + end + + if #dialog[1] > 8 then + Wait(200) + exports.qbx_core:Notify('You can only enter a maximum of 8 characters', 'error') + lib.showMenu('qbx_adminmenu_vehicles_menu', MenuIndexes.qbx_adminmenu_vehicles_menu) + return + end + + SetVehicleNumberPlateText(cache.vehicle, dialog[1]) + TriggerEvent('qb-vehiclekeys:client:AddKeys', dialog[1]) + end +end) + +lib.registerMenu({ + id = 'qbx_adminmenu_spawn_vehicles_menu', + title = 'Spawn Vehicle', + position = 'top-right', + onClose = function(keyPressed) + CloseMenu(false, keyPressed, 'qbx_adminmenu_main_menu') + end, + onSelected = function(selected) + MenuIndexes.qbx_adminmenu_spawn_vehicles_menu = selected + end, + options = {} +}, function(_, _, args) + lib.showMenu(args[1], MenuIndexes[args[1]]) +end) diff --git a/config/server.lua b/config/server.lua new file mode 100644 index 0000000..de211bd --- /dev/null +++ b/config/server.lua @@ -0,0 +1,108 @@ +return { + commandPerms = { + useMenu = 'mod', + reportReply = 'mod', + noclip = 'mod', + names = 'mod', + blips = 'mod', + saveVehicle = 'admin', + setModel = 'admin', + dev = 'admin', + }, + + eventPerms = { + playerOptionsGeneral = 'mod', + kick = 'mod', + ban = 'admin', + changePerms = 'admin', + changePlayerData = 'admin', + giveAllWeapons = 'admin', + getRadioList = 'mod', + useMenu = 'mod', + clothingMenu = 'admin', + }, + + weaponList = { + pistol = { + 'weapon_pistol', + 'weapon_pistol_mk2', + 'weapon_combatpistol', + 'weapon_appistol', + 'weapon_stungun', + 'weapon_pistol50', + 'weapon_snspistol', + 'weapon_heavypistol', + 'weapon_vintagepistol', + 'weapon_flaregun', + 'weapon_marksmanpistol', + 'weapon_revolver', + 'weapon_revolver_mk2', + 'weapon_doubleaction', + 'weapon_snspistol_mk2', + 'weapon_raypistol', + 'weapon_ceramicpistol', + 'weapon_navyrevolver', + 'weapon_gadgetpistol', + }, + smg = { + 'weapon_microsmg', + 'weapon_smg', + 'weapon_smg_mk2', + 'weapon_assaultsmg', + 'weapon_combatpdw', + 'weapon_machinepistol', + 'weapon_minismg', + 'weapon_raycarbine', + }, + shotgun = { + 'weapon_pumpshotgun', + 'weapon_sawnoffshotgun', + 'weapon_assaultshotgun', + 'weapon_bullpupshotgun', + 'weapon_musket', + 'weapon_heavyshotgun', + 'weapon_dbshotgun', + 'weapon_autoshotgun', + 'weapon_pumpshotgun_mk2', + 'weapon_combatshotgun', + }, + assault = { + 'weapon_assaultrifle', + 'weapon_assaultrifle_mk2', + 'weapon_carbinerifle', + 'weapon_carbinerifle_mk2', + 'weapon_advancedrifle', + 'weapon_specialcarbine', + 'weapon_bullpuprifle', + 'weapon_compactrifle', + 'weapon_specialcarbine_mk2', + 'weapon_bullpuprifle_mk2', + 'weapon_militaryrifle', + }, + lmg = { + 'weapon_mg', + 'weapon_combatmg', + 'weapon_gusenberg', + 'weapon_combatmg_mk2', + }, + sniper = { + 'weapon_sniperrifle', + 'weapon_heavysniper', + 'weapon_marksmanrifle', + 'weapon_remotesniper', + 'weapon_heavysniper_mk2', + 'weapon_marksmanrifle_mk2', + }, + heavy = { + 'weapon_rpg', + 'weapon_grenadelauncher', + 'weapon_grenadelauncher_smoke', + 'weapon_minigun', + 'weapon_firework', + 'weapon_railgun', + 'weapon_hominglauncher', + 'weapon_compactlauncher', + 'weapon_rayminigun', + }, + }, +} diff --git a/fxmanifest.lua b/fxmanifest.lua new file mode 100644 index 0000000..047d3bd --- /dev/null +++ b/fxmanifest.lua @@ -0,0 +1,29 @@ +fx_version 'cerulean' +game 'gta5' + +description 'qbx_adminmenu' +repository 'https://github.com/Qbox-project/qbx_adminmenu' +version '1.0.0' + +ox_lib 'locale' + +shared_scripts { + '@ox_lib/init.lua', + '@qbx_core/modules/lib.lua', +} + +server_scripts { + '@oxmysql/lib/MySQL.lua', + 'server/*.lua', +} + +client_scripts { + 'client/*.lua', +} + +files { + 'locales/*.json', +} + +lua54 'yes' +use_experimental_fxv2_oal 'yes' diff --git a/locales/cs.json b/locales/cs.json new file mode 100644 index 0000000..adb8dad --- /dev/null +++ b/locales/cs.json @@ -0,0 +1,155 @@ +{ + "title": { + "main_menu": "Administrátorské Menu", + "admin_menu": "Administrátorské Možnosti", + "server_menu": "Správa Serveru", + "dev_menu": "Vývojářské Možnosti", + "players_menu": "Online Hráči" + }, + "main_options": { + "label1": "Administrátorské Možnosti", + "desc1": "Sada možností, které ovlivní pouze vás", + "label2": "Správa Hráčů", + "desc2": "Správa současných online hráčů", + "label3": "Správa Serveru", + "desc3": "Správa prostředků nebo serverových specifických možností", + "label4": "Vozidla", + "desc4": "Vše o vozidlech zde", + "desc5": "Možnosti užitečné pro vývojáře", + "label5": "Vývojářské Možnosti" + }, + "admin_options": { + "label1": "Noclip", + "desc1": "Procházet se zdmi jako duch 👻", + "label2": "Oživení", + "desc2": "Vrátit se zpět do akce", + "label3": "Neviditelnost", + "desc3": "Teď mě už nemůžete vidět", + "label4": "Božský Režim", + "desc4": "Silné svaly", + "label5": "Jména", + "desc5": "Vidět jména hráčů", + "label6": "Blipy", + "desc6": "Vidět polohy všech hráčů na mapě", + "label7": "Božský Režim Pro Vozidla", + "desc7": "Zničte vozidlo, aniž by bylo poškozeno nebo zničeno", + "label8": "Změna Modelu Postavy", + "desc8": "Změňte svůj vzhled", + "value8_1": "Změnit Postavu", + "value8_2": "Resetovat Postavu", + "input8label": "Název Modelu Postavy", + "input8placeholder": "a_m_m_soucent_04", + "label9": "Neomezená Munice", + "desc9": "Dá vám nekonečnou munici pro aktuální zbraň, kterou držíte", + "label10": "Dát Všechno", + "desc10": "Dá každou zbraň v této kategorii", + "value10_1": "Pistole", + "value10_2": "Smg", + "value10_3": "Brokovnice", + "value10_4": "Útočná", + "value10_5": "Lmg", + "value10_6": "Odstřelovač", + "value10_7": "Těžká", + "label11": "Zaklepat/Odemknout", + "desc11": "Svázat se nebo odemknout" + }, + "server_options": { + "label1": "Změna Počasí", + "desc1": "Změní počasí na aktuálně zvýrazněnou možnost", + "value1_1": "Velmi Slunečno", + "value1_2": "Jasno", + "value1_3": "Neutrální", + "value1_4": "Mlha", + "value1_5": "Mlžno", + "value1_6": "Zataženo", + "value1_7": "Oblaka", + "value1_8": "Zlepšení počasí", + "value1_9": "Déšť", + "value1_10": "Bouřka", + "value1_11": "Sníh", + "value1_12": "Blizzard", + "value1_13": "Lehký Sníh", + "value1_14": "Vánoce", + "value1_15": "Halloween", + "label2": "Změna Času", + "desc2": "Změní čas na zadanou hodinu", + "label3": "Získat Seznam Rádií", + "desc3": "Získá kompletní seznam hráčů na dané radiové frekvenci", + "input3label": "Radiová Frekvence", + "label4": "Vyjmout Schovávku", + "desc4": "Otevřít schovávku se zadaným názvem", + "input4label": "Název Schovávky" + }, + "dev_options": { + "label1": "Zkopírovat Vektor 2", + "desc1": "Zkopírujte své aktuální vektorové souřadnice do schránky", + "label2": "Zkopírovat Vektor 3", + "desc2": "Zkopírujte své aktuální vektorové souřadnice do schránky", + "label3": "Zkopírovat Vektor 4", + "desc3": "Zkopírujte své aktuální vektorové souřadnice do schránky", + "label4": "Zkopírovat Směr", + "desc4": "Zkopírujte svůj aktuální směr do schránky", + "label5": "Zobrazit Souřadnice", + "desc5": "Zobrazí vaše aktuální souřadnice", + "desc6": "Zobrazí všechny druhy informací o vozidle, ve kterém sedíte", + "label6": "Zobrazit Informace o Vozidle" + }, + "player_options": { + "label1": "Obecné Možnosti", + "desc1": "Stejné možnosti, které byste našli pod administrátorskými možnostmi, ale tyto ovlivní vybraného hráče", + "label2": "Administrace", + "desc2": "Vyhodit | Banovat | Oprávnění", + "label3": "Další Možnosti", + "desc3": "Některé zábavné různorodé možnosti", + "general": { + "labelkill": "Zabít", + "desckill": "Zabít aktuálně vybraného hráče", + "labelrevive": "Oživit", + "descrevive": "Oživit aktuálně vybraného hráče", + "labelfreeze": "Zamknout", + "descfreeze": "Zamknout aktuálně vybraného hráče", + "labelgoto": "Jít na", + "descgoto": "Jít na aktuálně vybraného hráče", + "labelbring": "Přivést", + "descbring": "Přivést aktuálně vybraného hráče", + "labelsitinveh": "Sedět ve vozidle", + "descsitinveh": "Sedět ve vozidle aktuálně vybraného hráče", + "labelrouting": "Routingbucket", + "descrouting": "Routingbucket aktuálně vybraného hráče" + }, + "administration": { + "labelkick": "Vyhodit", + "desckick": "Vyhoďte tohoto hráče ze serveru", + "inputkick": "Důvod", + "labelban": "Banovat", + "descban": "Trvale vyhoďte tohoto hráče ze serveru", + "input1ban": "Hodiny", + "input2ban": "Dny", + "input3ban": "Měsíce", + "banreason": "Důvod: %s, do %s", + "labelperm": "Oprávnění", + "descperm": "Změnit úroveň oprávnění někoho", + "permvalue1": "Odebrat", + "permvalue2": "Moderátor", + "permvalue3": "Admin", + "permvalue4": "Bůh" + }, + "admin": { + + }, + "extra": { + + } + }, + "success": { + "blips_activated": "Blipy aktivovány", + "names_activated": "Jména aktivována", + "coords_copied": "Souřadnice zkopírovány do schránky", + "heading_copied": "Směr zkopírován do schránky" + }, + "error": { + "no_perms": "Nemáte oprávnění k provedení této akce", + "blips_deactivated": "Blipy deaktivovány", + "names_deactivated": "Jména deaktivována" + } +} diff --git a/locales/da.json b/locales/da.json new file mode 100644 index 0000000..9efc18b --- /dev/null +++ b/locales/da.json @@ -0,0 +1,169 @@ +{ + "title": { + "admin_menu": "Admin Indstillinger", + "dev_menu": "Udvikler Indstillinger", + "main_menu": "Admin Menu", + "players_menu": "Online Spillere", + "server_menu": "Administrer Server", + "reports_menu": "Rapporter" + }, + "main_options": { + "label1": "Admin Indstillinger", + "desc1": "Et sæt af indstillinger, som kun vil påvirke dig", + "label2": "Spilleradministration", + "desc2": "Administrer dine nuværende online spillere", + "label3": "Serveradministration", + "desc3": "Administrer ressourcer eller server-specifikke indstillinger", + "label4": "Køretøjer", + "desc4": "Alt om køretøjer her", + "label5": "Udvikler Indstillinger", + "desc5": "Indstillinger, der er nyttige for en udvikler", + "label6": "Ventende Rapporter", + "desc6": "Nogen skal gøre det :(" + }, + "admin_options": { + "label1": "Noclip", + "desc1": "Gå gennem vægge som om du er et spøgelse 👻", + "label2": "Genopliv", + "desc2": "Få dig selv tilbage i aktion", + "label3": "Usynlig", + "desc3": "Nu kan du ikke se mig længere", + "label4": "Godmode", + "desc4": "Stærke muskler", + "label5": "Navne", + "desc5": "Se hvad spillernes navne er", + "label6": "Blips", + "desc6": "Se placeringerne af alle spillere på kortet", + "label7": "Køretøjs Godmode", + "desc7": "Smad dit køretøj uden at det bliver beskadiget eller ødelagt", + "label8": "Skift Ped Model", + "desc8": "Skift hvordan du ser ud", + "value8_1": "Skift Ped", + "value8_2": "Nulstil Ped", + "input8label": "Ped Model Navn", + "input8placeholder": "a_m_m_soucent_04", + "label9": "Uendelig Ammo", + "desc9": "Giver dig uendelig ammunition til det nuværende våben, du holder", + "label10": "Giv Alle", + "desc10": "Giver alle våben i den kategori", + "value10_1": "Pistoler", + "value10_2": "Smg", + "value10_3": "Hagelgevær", + "value10_4": "Angreb", + "value10_5": "Lmg", + "value10_6": "Sniper", + "value10_7": "Tungt", + "label11": "Håndjern/Fjern Håndjern", + "desc11": "Håndjern eller fjern håndjern" + }, + "server_options": { + "label1": "Skift Vejr", + "desc1": "Ændrer vejret til det, der aktuelt er markeret", + "value1_1": "Meget solrigt", + "value1_2": "Klart", + "value1_3": "Neutral", + "value1_4": "Smog", + "value1_5": "Tåget", + "value1_6": "Overskyet", + "value1_7": "Skyer", + "value1_8": "Klart op", + "value1_9": "Regn", + "value1_10": "Torden", + "value1_11": "Sne", + "value1_12": "Snestorm", + "value1_13": "Let sne", + "value1_14": "Jul", + "value1_15": "Halloween", + "label2": "Skift Tid", + "desc2": "Ændrer tiden til den angivne time", + "label3": "Få Radioliste", + "desc3": "Få en fuld liste over spillere på den givne radiofrekvens", + "input3label": "Radiofrekvens", + "label4": "Hent Stash", + "desc4": "Åbn en stash med det specificerede navn", + "input4label": "Stash Navn" + }, + "dev_options": { + "label1": "Kopiér Vektor 2", + "desc1": "Kopiér dine nuværende vektor 2 koordinater til din udklipsholder", + "label2": "Kopiér Vektor 3", + "desc2": "Kopiér dine nuværende vektor 3 koordinater til din udklipsholder", + "label3": "Kopiér Vektor 4", + "desc3": "Kopiér dine nuværende vektor 4 koordinater til din udklipsholder", + "label4": "Kopiér Heading", + "desc4": "Kopiér dine nuværende heading koordinater til din udklipsholder", + "label5": "Vis Koordinater", + "desc5": "Viser dine nuværende koordinater", + "label6": "Vis Køretøjsinformation", + "desc6": "Viser alle slags informationer om det køretøj, du sidder i" + }, + "player_options": { + "label1": "Generelle Indstillinger", + "desc1": "De samme indstillinger som du ville finde under admin indstillinger, men disse vil påvirke den valgte spiller", + "label2": "Administration", + "desc2": "Kick | Ban | Tilladelser", + "label3": "Ekstra Indstillinger", + "desc3": "Nogle sjove, forskellige indstillinger", + "general": { + "labelkill": "Dræb", + "desckill": "Dræb den aktuelt valgte spiller", + "labelrevive": "Genopliv", + "descrevive": "Genopliv den aktuelt valgte spiller", + "labelfreeze": "Frys", + "descfreeze": "Frys den aktuelt valgte spiller", + "labelgoto": "Gå til", + "descgoto": "Gå til den aktuelt valgte spiller", + "labelbring": "Bring", + "descbring": "Bring den aktuelt valgte spiller", + "labelsitinveh": "Sid i køretøj", + "descsitinveh": "Sid i køretøjet med den aktuelt valgte spiller", + "labelrouting": "Routingbucket", + "descrouting": "Routingbucket den aktuelt valgte spiller" + }, + "administration": { + "labelkick": "Kick", + "desckick": "Smid denne spiller ud af serveren", + "inputkick": "Årsag", + "labelban": "Ban", + "descban": "Permanent smid denne spiller ud af serveren", + "input1ban": "Timer", + "input2ban": "Dage", + "input3ban": "Måneder", + "banreason": "Årsag: %s, indtil %s", + "labelperm": "Tilladelse", + "descperm": "Skift en persons tilladelsesniveau", + "permvalue1": "Fjern", + "permvalue2": "Mod", + "permvalue3": "Admin", + "permvalue4": "Gud" + }, + "admin": { + + }, + "extra": { + + }, + "report_options": { + "label1": "Rapport ID: %s | afsender: %s", + "desc1": "Klik for at se rapportmuligheder" + }, + "success": { + "blips_activated": "Blips aktiveret", + "names_activated": "Navne aktiveret", + "coords_copied": "Koordinater kopieret til udklipsholder", + "heading_copied": "Heading kopieret til udklipsholder", + "report_sent": "Rapport er blevet sendt", + "new_report": "En ny rapport er modtaget", + "sent_report_reply": "Dit svar er sendt", + "report_load": "%s report(s) loaded", + "report_claimed_by": "Report #%s was claimed by %s" + }, + "error": { + "no_perms": "Du har ikke tilladelse til at gøre dette", + "blips_deactivated": "Blips deaktiveret", + "names_deactivated": "Navne deaktiveret", + "no_report_reply": "Svar kunne ikke sendes på grund af manglende besked", + "no_reports": "ingen afv. rapporter indlæst" + } + } +} diff --git a/locales/de.json b/locales/de.json new file mode 100644 index 0000000..5545c3e --- /dev/null +++ b/locales/de.json @@ -0,0 +1,169 @@ +{ + "title": { + "admin_menu": "Admin-Optionen", + "dev_menu": "Entwickler-Optionen", + "main_menu": "Admin-Menü", + "players_menu": "Online-Spieler", + "server_menu": "Server verwalten", + "reports_menu": "Reports" + }, + "main_options": { + "label1": "Admin-Optionen", + "desc1": "Ein Satz von Optionen, die nur dich betreffen", + "label2": "Spielerverwaltung", + "desc2": "Verwalte deine aktuellen Online-Spieler", + "label3": "Serververwaltung", + "desc3": "Verwalte Ressourcen oder server-spezifische Optionen", + "label4": "Fahrzeuge", + "desc4": "Alles rund um Fahrzeuge", + "label5": "Entwickler-Optionen", + "desc5": "Optionen, die für einen Entwickler nützlich sind", + "label6": "Ausstehende Reports", + "desc6": "Verwalte ausstehende Reports" + }, + "admin_options": { + "label1": "Noclip", + "desc1": "Gehe durch Wände, als wärst du ein Geist 👻", + "label2": "Wiederbeleben", + "desc2": "Komm zurück ins Geschehen", + "label3": "Unsichtbar", + "desc3": "Jetzt siehst du mich nicht mehr", + "label4": "Godmode", + "desc4": "Starke Muskeln", + "label5": "Spielernamen anzeigen", + "desc5": "Siehe die Namen der Spieler", + "label6": "Spieler-Blips", + "desc6": "Siehe die Positionen aller Spieler auf der Karte", + "label7": "Fahrzeug Godmode", + "desc7": "Zerstöre dein Fahrzeug, ohne dass es beschädigt wird", + "label8": "Ped-Modell ändern", + "desc8": "Ändere dein Aussehen", + "value8_1": "Ped ändern", + "value8_2": "Ped zurücksetzen", + "input8label": "Ped-Modell-Name", + "input8placeholder": "a_m_m_soucent_04", + "label9": "Unendliche Munition", + "desc9": "Gibt dir unendliche Munition für die aktuelle Waffe", + "label10": "Alle Waffen geben", + "desc10": "Gibt alle Waffen in dieser Kategorie", + "value10_1": "Pistolen", + "value10_2": "Maschinenpistolen", + "value10_3": "Schrotflinten", + "value10_4": "Sturmgewehre", + "value10_5": "Leichte Maschinengewehre", + "value10_6": "Scharfschützengewehre", + "value10_7": "Schwere Waffen", + "label11": "Festnehmen/Loslassen", + "desc11": "Dich selbst fesseln oder entfesseln" + }, + "server_options": { + "label1": "Wetter ändern", + "desc1": "Ändere das Wetter auf die derzeit markierte Option", + "value1_1": "Sonnig", + "value1_2": "Klar", + "value1_3": "Neutral", + "value1_4": "Smog", + "value1_5": "Nebelig", + "value1_6": "Bedeckt", + "value1_7": "Wolken", + "value1_8": "Aufklarend", + "value1_9": "Regen", + "value1_10": "Gewitter", + "value1_11": "Schnee", + "value1_12": "Schneesturm", + "value1_13": "Leichter Schnee", + "value1_14": "Weihnachten", + "value1_15": "Halloween", + "label2": "Uhrzeit ändern", + "desc2": "Ändert die Zeit auf die angegebene Stunde", + "label3": "Funk-Liste abrufen", + "desc3": "Erhalte eine vollständige Liste der Spieler auf der angegebenen Funkfrequenz", + "input3label": "Funkfrequenz", + "label4": "Stash öffnen", + "desc4": "Öffne ein Stash mit dem angegebenen Namen", + "input4label": "Stash-Name" + }, + "dev_options": { + "label1": "Kopiere Vektor 2", + "desc1": "Kopiere deine aktuellen Vektor-2-Koordinaten in die Zwischenablage", + "label2": "Kopiere Vektor 3", + "desc2": "Kopiere deine aktuellen Vektor-3-Koordinaten in die Zwischenablage", + "label3": "Kopiere Vektor 4", + "desc3": "Kopiere deine aktuellen Vektor-4-Koordinaten in die Zwischenablage", + "label4": "Kopiere Richtung", + "desc4": "Kopiere deine aktuellen Richtungskoordinaten in die Zwischenablage", + "label5": "Koordinaten anzeigen", + "desc5": "Zeigt deine aktuellen Koordinaten an", + "label6": "Fahrzeuginformationen anzeigen", + "desc6": "Zeigt alle möglichen Informationen über das Fahrzeug an, in dem du sitzt" + }, + "player_options": { + "label1": "Allgemeine Optionen", + "desc1": "Die gleichen Optionen wie unter Admin-Optionen, aber diese betreffen den ausgewählten Spieler", + "label2": "Verwaltung", + "desc2": "Kick | Ban | Berechtigungen", + "label3": "Zusätzliche Optionen", + "desc3": "Einige lustige, optionale Funktionen", + "general": { + "labelkill": "Töten", + "desckill": "Töte den ausgewählten Spieler", + "labelrevive": "Wiederbeleben", + "descrevive": "Belebe den ausgewählten Spieler", + "labelfreeze": "Einfrieren", + "descfreeze": "Friere den ausgewählten Spieler ein", + "labelgoto": "Gehe zu", + "descgoto": "Gehe zum ausgewählten Spieler", + "labelbring": "Bringen", + "descbring": "Bringe den ausgewählten Spieler", + "labelsitinveh": "In Fahrzeug setzen", + "descsitinveh": "Setze dich in das Fahrzeug des ausgewählten Spielers", + "labelrouting": "Routingbucket", + "descrouting": "Setze den ausgewählten Spieler in einen Routingbucket" + }, + "administration": { + "labelkick": "Kick", + "desckick": "Schmeiß diesen Spieler vom Server", + "inputkick": "Grund", + "labelban": "Ban", + "descban": "Verbanne diesen Spieler dauerhaft vom Server", + "input1ban": "Stunden", + "input2ban": "Tage", + "input3ban": "Monate", + "banreason": "Grund: %s, bis %s", + "labelperm": "Berechtigung", + "descperm": "Ändere das Berechtigungslevel eines Spielers", + "permvalue1": "Entfernen", + "permvalue2": "Mod", + "permvalue3": "Admin", + "permvalue4": "Gott" + }, + "admin": { + + }, + "extra": { + + } + }, + "report_options": { + "label1": "Report ID: %s | Absender: %s", + "desc1": "Klicken, um Meldeoptionen anzuzeigen" + }, + "success": { + "blips_activated": "Spieler-Blips aktiviert", + "names_activated": "Spielernamen aktiviert", + "coords_copied": "Koordinaten in die Zwischenablage kopiert", + "heading_copied": "Richtung in die Zwischenablage kopiert", + "report_sent": "Report wurde gesendet", + "new_report": "Eine neue Report wurde erstellt", + "sent_report_reply": "Deine Antwort wurde gesendet", + "report_load": "%s Report(s) geladen", + "report_claimed_by": "Report #%s wurde von %s beansprucht" + }, + "error": { + "no_perms": "Du hast keine Berechtigung, dies zu tun", + "blips_deactivated": "Spieler-Blips deaktiviert", + "names_deactivated": "Spielernamen deaktiviert", + "no_report_reply": "Antwort konnte nicht gesendet werden, da keine Nachricht vorhanden ist", + "no_reports": "Keine ausstehenden Reports zum Laden" + } +} diff --git a/locales/en.json b/locales/en.json new file mode 100644 index 0000000..f907091 --- /dev/null +++ b/locales/en.json @@ -0,0 +1,169 @@ +{ + "title": { + "admin_menu": "Admin Options", + "dev_menu": "Developer Options", + "main_menu": "Admin Menu", + "players_menu": "Online Players", + "server_menu": "Manage Server", + "reports_menu": "Reports" + }, + "main_options": { + "label1": "Admin Options", + "desc1": "A set of options which will only effect you", + "label2": "Player Management", + "desc2": "Manage your current online playerbase", + "label3": "Server Management", + "desc3": "Manage resources or server specific options", + "label4": "Vehicles", + "desc4": "All about vehicles here", + "label5": "Developer Options", + "desc5": "Options that are handy for a developer", + "label6": "Pending Reports", + "desc6": "Manage pending reports" + }, + "admin_options": { + "label1": "Noclip", + "desc1": "Go through walls as if you are a ghost 👻", + "label2": "Revive", + "desc2": "Get yourself back in action", + "label3": "Invisible", + "desc3": "Now you can't see me anymore", + "label4": "Godmode", + "desc4": "Strong muscles", + "label5": "Names", + "desc5": "See what the names are of players", + "label6": "Blips", + "desc6": "See the locations of all the players on the map", + "label7": "Vehicle Godmode", + "desc7": "Smash your vehicle without it being damaged or destroyed", + "label8": "Change Ped Model", + "desc8": "Change how you look", + "value8_1": "Change Ped", + "value8_2": "Reset Ped", + "input8label": "Ped Model Name", + "input8placeholder": "a_m_m_soucent_04", + "label9": "Infinite Ammo", + "desc9": "Gives you infinite ammo for the current gun you are holding", + "label10": "Give All", + "desc10": "Gives every weapon in that category", + "value10_1": "Pistols", + "value10_2": "Smg", + "value10_3": "Shotgun", + "value10_4": "Assualt", + "value10_5": "Lmg", + "value10_6": "Sniper", + "value10_7": "Heavy", + "label11": "Un/Cuff", + "desc11": "Cuff yourself or uncuff" + }, + "server_options": { + "label1": "Change Weather", + "desc1": "Changes the weather to whatever is currently highlighted", + "value1_1": "Extrasunny", + "value1_2": "Clear", + "value1_3": "Neutral", + "value1_4": "Smog", + "value1_5": "Foggy", + "value1_6": "Overcast", + "value1_7": "Clouds", + "value1_8": "Clearing", + "value1_9": "Rain", + "value1_10": "Thunder", + "value1_11": "Snow", + "value1_12": "Blizzard", + "value1_13": "Snowlight", + "value1_14": "Xmas", + "value1_15": "Halloween", + "label2": "Change Time", + "desc2": "Changes the time to the specified hour", + "label3": "Get Radio List", + "desc3": "Get a full list of players on the given radio frequency", + "input3label": "Radio Frequency", + "label4": "Pull Stash", + "desc4": "Open a stash with the specified name", + "input4label": "Stash Name" + }, + "dev_options": { + "label1": "Copy Vector 2", + "desc1": "Copy your current vector 2 coordinates to your clipboard", + "label2": "Copy Vector 3", + "desc2": "Copy your current vector 3 coordinates to your clipboard", + "label3": "Copy Vector 4", + "desc3": "Copy your current vector 4 coordinates to your clipboard", + "label4": "Copy Heading", + "desc4": "Copy your current heading coordinates to your clipboard", + "label5": "Display Coords", + "desc5": "Displays your current coordinates", + "label6": "Display Vehicle Info", + "desc6": "Displays all kinds of information about the vehicle you are sitting in" + }, + "player_options": { + "label1": "General Options", + "desc1": "The same options you would find under admin options, but these will affect the chosen player", + "label2": "Administration", + "desc2": "Kick | Ban | Permissions", + "label3": "Extra Options", + "desc3": "Some fun miscellaneous options", + "general": { + "labelkill": "Kill", + "desckill": "Kill the currently selected player", + "labelrevive": "Revive", + "descrevive": "Revive the currently selected player", + "labelfreeze": "Freeze", + "descfreeze": "Freeze the currently selected player", + "labelgoto": "Go to", + "descgoto": "Go to the currently selected player", + "labelbring": "Bring", + "descbring": "Bring the currently selected player", + "labelsitinveh": "Sit in vehicle", + "descsitinveh": "Sit in vehicle the currently selected player", + "labelrouting": "Routingbucket", + "descrouting": "Routingbucket the currently selected player" + }, + "administration": { + "labelkick": "Kick", + "desckick": "Yeet this player from the server", + "inputkick": "Reason", + "labelban": "Ban", + "descban": "Perm yeet this player from the server", + "input1ban": "Hours", + "input2ban": "Days", + "input3ban": "Months", + "banreason": "Reason: %s, until %s", + "labelperm": "Permission", + "descperm": "Change someone's permission level", + "permvalue1": "Remove", + "permvalue2": "Mod", + "permvalue3": "Admin", + "permvalue4": "God" + }, + "admin": { + + }, + "extra": { + + } + }, + "report_options": { + "label1": "Report ID: %s | Sender: %s", + "desc1": "Click to view report options" + }, + "success": { + "blips_activated": "Blips activated", + "names_activated": "Names activated", + "coords_copied": "Coordinates copied to clipboard", + "heading_copied": "Heading copied to clipboard", + "report_sent": "Report has been sent", + "new_report": "A new report has been received", + "sent_report_reply": "Your reply has been sent", + "report_load": "%s report(s) loaded", + "report_claimed_by": "Report #%s was claimed by %s" + }, + "error": { + "no_perms": "You don't have permission to do this", + "blips_deactivated": "Blips deactivated", + "names_deactivated": "Names deactivated", + "no_report_reply": "Reply failed to send due to no message", + "no_reports": "no pending reports to load" + } +} diff --git a/locales/es.json b/locales/es.json new file mode 100644 index 0000000..cdbd14b --- /dev/null +++ b/locales/es.json @@ -0,0 +1,155 @@ +{ + "title": { + "main_menu": "Menú de admin", + "admin_menu": "Opciones de admin", + "server_menu": "Manejar servidor", + "dev_menu": "Opciones de desarrollador", + "players_menu": "Jugadores en línea" + }, + "main_options": { + "label1": "Opciones de admin", + "desc1": "Grupo de opciones que solo te afectarán a ti", + "label2": "Manejo de jugador", + "desc2": "Maneja tu base de jugadores en línea en este momento", + "label3": "Manejo de servidor", + "desc3": "Maneja recursos o opciones específicas de servidor", + "label4": "Vehículos", + "desc4": "Todo sobre vehículos aquí", + "label5": "Opciones de desarrollador", + "desc5": "Opciones que son útiles para los desarrolladores" + }, + "admin_options": { + "label1": "Noclip", + "desc1": "Taspasa paredes como si fueras un fantasam 👻", + "label2": "Revivir", + "desc2": "Vuelve de nuevo a la acción", + "label3": "Invisible", + "desc3": "Ahora ya no puedes verme más", + "label4": "Modo dios", + "desc4": "Músculos fuertes", + "label5": "Nombres", + "desc5": "Muestra los nombres de los jugadores", + "label6": "Blips", + "desc6": "Ve la ubicación de todos los jugadores en el mapa", + "label7": "Modo dios vehículo", + "desc7": "Estrella tu vehículo sin dañarlo o destruirlo", + "label8": "Cambia el modelo de ped", + "desc8": "Cambia como te ves", + "value8_1": "Cambia ped", + "value8_2": "Resetea ped", + "input8label": "Nombre modelo ped", + "input8placeholder": "a_m_m_soucent_04", + "label9": "Munición infinita", + "desc9": "Te da munición infinita para la arma que estás sosteniendo", + "label10": "Dar todo", + "desc10": "Da todas las armas en esa categoría", + "value10_1": "Pistolas", + "value10_2": "Smg", + "value10_3": "Escopetas", + "value10_4": "Asalto", + "value10_5": "Lmg", + "value10_6": "Sniper", + "value10_7": "Pesado", + "label11": "Esposa/quita esposa", + "desc11": "Esposate o quitate la esposa" + }, + "server_options": { + "label1": "Cambiar clima", + "desc1": "Cambia el clima a lo que este seleccionado actualmente", + "value1_1": "Extra soleado", + "value1_2": "Despejado", + "value1_3": "Neutro", + "value1_4": "Smog", + "value1_5": "Neblina", + "value1_6": "Overcast", + "value1_7": "Nubes", + "value1_8": "Despejandose", + "value1_9": "Lluvia", + "value1_10": "Tormenta", + "value1_11": "Nieve", + "value1_12": "Blizzard", + "value1_13": "Snowlight", + "value1_14": "Xmas", + "value1_15": "Halloween", + "label2": "Cambia el horario", + "desc2": "Cambia el horario a la hora específicada", + "label3": "Obten la lista de radios", + "desc3": "Obten la lista completa de jugadores en una frecuencia de radio", + "input3label": "Frecuencia de radio", + "input4label": "Nombre de escondite", + "label4": "Sacar escondite", + "desc4": "Abrir escondite del nombre específicado" + }, + "dev_options": { + "label1": "Copiar Vector 2", + "desc1": "Copiar tus coordenadas actuales de vector 2 a tu portapapeles", + "label2": "Copiar Vector 3", + "desc2": "Copiar tus coordenadas actuales de vector 3 a tu portapapeles", + "label3": "Copiar Vector 4", + "desc3": "Copiar tus coordenadas actuales de vector 4 a tu portapapeles", + "label4": "Copiar dirección", + "desc4": "Copiar tus coordenadas de direccioón a tu portapapeles", + "label5": "Mostrar coords", + "desc5": "Muestra tus coordenadas actuales", + "label6": "Mostrar info de vehículo", + "desc6": "Muestra todo tipo de información del vehículo en el que estás sentado" + }, + "player_options": { + "label1": "Opciones generales", + "desc1": "Las mismas opciones que encontrarías en opciones de admin, pero afectan al jugador elegido", + "label2": "Administración", + "desc2": "Expulsar | Suspender | Permisos", + "label3": "Opciones extras", + "desc3": "Algunas opciones divertidas miscelaneas", + "general": { + "labelkill": "Matar", + "desckill": "Mata al jugador seleccionado", + "labelrevive": "Revivir", + "descrevive": "Revive al jugador seleccionado", + "labelfreeze": "Congela", + "descfreeze": "Congela al jugador seleccionado", + "labelgoto": "Ir a", + "descgoto": "Ir a al jugador seleccionado", + "labelbring": "Traer", + "descbring": "Traer al jugador seleccionado", + "labelsitinveh": "Sentar en vehículo", + "descsitinveh": "Sentar en vehículo al jugador seleccionado", + "labelrouting": "Routingbucket", + "descrouting": "Routingbucket al jugador seleccionado" + }, + "administration": { + "labelkick": "Expulsar", + "desckick": "Saca al jugador del servidor", + "inputkick": "Razón", + "labelban": "Suspender", + "descban": "Permanentemente saca al jugador del servidor", + "input1ban": "Horas", + "input2ban": "Días", + "input3ban": "Meses", + "banreason": "Razón: %s, hasta %s", + "labelperm": "Permiso", + "descperm": "Cambia el nivel de permiso de alguien", + "permvalue1": "Quitar", + "permvalue2": "Mod", + "permvalue3": "Admin", + "permvalue4": "Dios" + }, + "admin": { + + }, + "extra": { + + } + }, + "success": { + "blips_activated": "Blips activados", + "names_activated": "Names activados", + "coords_copied": "Coordenadas copiadas al portapapeles", + "heading_copied": "Dirección copiada al portapapeles" + }, + "error": { + "no_perms": "No tienes permiso para hacer esto", + "blips_deactivated": "Blips deactivados", + "names_deactivated": "Names deactivados" + } +} diff --git a/locales/fr.json b/locales/fr.json new file mode 100644 index 0000000..97b70a8 --- /dev/null +++ b/locales/fr.json @@ -0,0 +1,153 @@ +{ + "title": { + "main_menu": "Menu Admin", + "admin_menu": "Options Admin", + "server_menu": "Gérer Serveur", + "dev_menu": "Options Developpeur", + "players_menu": "Joueurs En Ligne" + }, + "main_options": { + "label1": "Options Admin", + "desc1": "Des Actions qui n'affectent que vous", + "label2": "Gérer Joueurs", + "desc2": "Managez les Joueurs en ligne", + "label3": "Gérer Serveur", + "desc3": "Des Actions sur le Serveur directement", + "label4": "Vehicules", + "desc4": "Tout ce qui concerne les véhicules", + "label5": "Options Developpeur", + "desc5": "Des actions pratiques pour un développeur" + }, + "admin_options": { + "label1": "Noclip", + "desc1": "Traversez les murs comme un fantôme 👻", + "label2": "Réanimer", + "desc2": "Réanimez vous pour retourner dans l'action", + "label3": "Invisible", + "desc3": "John Cena", + "label4": "Godmode", + "desc4": "T'es fort dis-donc!", + "label5": "Noms", + "desc5": "Voir les noms des joueurs", + "label6": "Blips", + "desc6": "Voir oû se cache les joueurs sur la carte", + "label7": "Godmode Vehicule", + "desc7": "Rendez votre véhicule invincible", + "label8": "Changer Modèle Ped", + "desc8": "Changez d'apparence", + "value8_1": "Changer Ped", + "value8_2": "Reset Ped", + "input8label": "Nom Modèle Ped", + "input8placeholder": "a_m_m_soucent_04", + "label9": "Munitions infinies", + "desc9": "INFINITE POWEEEERRR", + "label10": "Donner Armes", + "desc10": "Donne toutes les armes de cette catégorie", + "value10_1": "Pistolets", + "value10_2": "Smg", + "value10_3": "Fusils-de-pompe", + "value10_4": "Fusils-D'assault", + "value10_5": "Mitrailleuses", + "value10_6": "Snipers", + "value10_7": "Lourds", + "label11": "(Dé)menoter", + "desc11": "Menotez ou démenotez vous" + }, + "server_options": { + "label1": "Changer météo", + "desc1": "Change la météo a votre choix", + "value1_1": "Ensoleillé", + "value1_10": "Orage", + "value1_11": "Neige", + "value1_12": "Blizzard", + "value1_13": "Neige légère", + "value1_14": "Nôel", + "value1_15": "Halloween", + "value1_2": "Clair", + "value1_3": "Neute", + "value1_4": "Brouillard", + "value1_5": "Brumeux", + "value1_6": "Couvert", + "value1_7": "Nuageux", + "value1_8": "Éclaircisements", + "value1_9": "Pluie", + "label2": "Changer Temps", + "desc2": "Change le temps a l'heure spécifiée", + "label3": "Récuperer Liste Radio", + "desc3": "Récuperez une liste de tous les joueurs dans une fréquence radio", + "input3label": "Fréquence Radio", + "label4": "Ouvrir Stockage", + "desc4": "Ouvrir le Stockage avec le nom spécifié", + "input4label": "Nom du Stockage" + }, + "dev_options": { + "label1": "Copier Vector 2", + "desc1": "Copier votre vector 2 dans votre presse-papier", + "label2": "Copier Vector 3", + "desc2": "Copier votre vector 3 dans votre presse-papier", + "label3": "Copier Vector 4", + "desc3": "Copier votre vector 4 dans votre presse-papier", + "label4": "Copier Heading", + "desc4": "Copie votre heading dans votre presse-papier", + "label5": "Afficher Coords", + "desc5": "Affiche vos coordonnées", + "label6": "Afficher Info Vehicule", + "desc6": "Affiche plein d'information à propos du vehicule dans lequel vous êtes" + }, + "player_options": { + "label1": "Options Generales", + "desc1": "Les mêmes options que les options admin, mais elles affectent le joueur que vous séléctionnez", + "label2": "Administration", + "desc2": "Kick | Ban | Permissions", + "label3": "Options Extra", + "desc3": "Des options mixtes amusantes", + "general": { + "labelkill": "Tuer", + "desckill": "Tue le joueur séléctionné", + "labelrevive": "Réanimer", + "descrevive": "Réanime le joueur séléctionné", + "labelfreeze": "Freeze", + "descfreeze": "Freeze le joueur séléctionné", + "labelgoto": "Aller-à", + "descgoto": "Aller au joueur séléctionné", + "labelbring": "Ramener", + "descbring": "Ramener le joueur séléctionné à soi", + "labelsitinveh": "S'Asseoir Véhicule", + "descsitinveh": "S'asseoir dans le véhicule du joueur séléctionné", + "labelrouting": "Routingbucket", + "descrouting": "Changer le Routingbucket du joueur séléctionné" + }, + "administration": { + "labelkick": "Kick", + "desckick": "Kick le joueur du server", + "inputkick": "Raison", + "labelban": "Ban", + "descban": "Bannir ce joueur du server", + "input1ban": "Heures", + "input2ban": "Jours", + "input3ban": "Mois", + "banreason": "Raison: %s, jusqu'à %s", + "labelperm": "Permission", + "descperm": "Changer le niveau de permission de quelqu'un", + "permvalue1": "Retirer", + "permvalue2": "Mod", + "permvalue3": "Admin", + "permvalue4": "God" + }, + "admin": { + + }, + "extra": { + + } + }, + "success": { + "blips_activated": "Blips activatés", + "names_activated": "Noms activatés" + }, + "error": { + "no_perms": "Vous n'avez pas la permission de faire cela", + "blips_deactivated": "Blips désactivatés", + "names_deactivated": "Noms désactivatés" + } +} diff --git a/locales/it.json b/locales/it.json new file mode 100644 index 0000000..6adcbb6 --- /dev/null +++ b/locales/it.json @@ -0,0 +1,151 @@ +{ + "title": { + "admin_menu": "Opzioni Admin", + "dev_menu": "Menu Developer", + "main_menu": "Admin Menu", + "players_menu": "Giocatori Online", + "server_menu": "Gestione Server" + }, + "main_options": { + "label1": "Opzioni Admin", + "desc1": "Una serie di opzioni che avranno effetto solo su di te", + "label2": "Gestione Giocatori", + "desc2": "Gestisci i giocatori online", + "label3": "Gestione Server", + "desc3": "Gestisci risorse o opzioni specifiche del server", + "label4": "Veicoli", + "desc4": "Tutto sui veicoli", + "label5": "Opzioni Developer", + "desc5": "Opzioni utili per un dev" + }, + "admin_options": { + "label1": "Noclip", + "desc1": "Attraversa i muri come se fossi un fantasma 👻", + "label2": "Rianima", + "desc2": "Rianima e cura tutte le ferite/status", + "label3": "Invisibile", + "desc3": "Nessuno potrà vederti 👻", + "label4": "Godmode", + "desc4": "Dio, cosa sennò?", + "label5": "Nomi", + "desc5": "Visualizza i nomi dei giocatori", + "label6": "Blip", + "desc6": "Vedi le posizioni di tutti i giocatori sulla mappa", + "label7": "Veicolo in Godmode", + "desc7": "Il tuo veicolo non verrà danneggiato o distrutto", + "label8": "Cambia modello Ped", + "desc8": "Cambia il tuo aspetto", + "value8_1": "Cambia Ped", + "value8_2": "Reset Ped", + "input8label": "Nome del Ped", + "input8placeholder": "a_m_m_soucent_04", + "label9": "Munizioni Infinite", + "desc9": "Ti dà munizioni infinite per l'arma che stai impugnando", + "label10": "Dai Tutte le Armi", + "desc10": "Fornisce ogni arma in quella categoria", + "value10_1": "Pistole", + "value10_2": "Smg", + "value10_3": "Fucili a Pompa", + "value10_4": "Fucili d'Assalto", + "value10_5": "Mitragliatrici leggera", + "value10_6": "Cecchini", + "value10_7": "Armi Pesanti", + "label11": "Manette", + "desc11": "Metti/Togli Manette" + }, + "server_options": { + "label1": "Cambia tempo", + "desc1": "Cambia il meteo in base a ciò che è attualmente evidenziato", + "value1_1": "Extrasoleggiato", + "value1_2": "Cancella", + "value1_3": "Neutro", + "value1_4": "Smog", + "value1_5": "Nebbioso", + "value1_6": "Nuvoloso", + "value1_7": "Nuvole", + "value1_8": "Soleggiato", + "value1_9": "Pioggia", + "value1_10": "Tempesta", + "value1_11": "Neve", + "value1_12": "Bufera di neve", + "value1_13": "Luce di neve", + "value1_14": "Natale", + "value1_15": "Halloween", + "label2": "Cambia ora", + "desc2": "Cambia l'ora nell'ora specificata", + "label3": "Ottieni elenco radio", + "desc3": "Ottieni un elenco completo dei giocatori sulla frequenza radio specificata", + "input3label": "Radiofrequenza", + "label4": "Prendi la scorta", + "desc4": "Apri una scorta con il nome specificato", + "input4label": "Nome della scorta" + }, + "dev_options": { + "label1": "Copia vector 2", + "desc1": "Copia le coordinate attuali del vector 2 negli appunti", + "label2": "Copia vector 3", + "desc2": "Copia le coordinate attuali del vector 3 negli appunti", + "label3": "Copia vector 4", + "desc3": "Copia le coordinate attuali del vector 4 negli appunti", + "label4": "Copia intestazione", + "desc4": "Copia le coordinate della tua rotta attuale negli appunti", + "label5": "Visualizza coordinate", + "desc5": "Mostra le tue coordinate attuali", + "label6": "Visualizza informazioni sul veicolo", + "desc6": "Mostra tutti i tipi di informazioni sul veicolo in cui ti trovi" + }, + "player_options": { + "label1": "Opzioni generali", + "desc1": "Le stesse opzioni che troverai nelle opzioni di amministrazione, ma influenzeranno il giocatore scelto", + "label2": "Amministrazione", + "desc2": "Espulsione | Ban | Permessi", + "label3": "Opzioni extra", + "desc3": "Alcune divertenti opzioni varie", + "general": { + "labelkill": "Uccidi", + "desckill": "Uccidi il giocatore attualmente selezionato", + "labelrevive": "Ravviva", + "descrevive": "Rianima il giocatore attualmente selezionato", + "labelfreeze": "Blocca", + "descfreeze": "Blocca il giocatore attualmente selezionato", + "labelgoto": "Vai a", + "descgoto": "Vai al giocatore attualmente selezionato", + "labelbring": "Porta", + "descbring": "Porta il giocatore attualmente selezionato", + "labelsitinveh": "Siediti nel veicolo", + "descsitinveh": "Fai sedere nel veicolo il giocatore attualmente selezionato", + "labelrouting": "Routingbucket", + "descrouting": "Routingbucket il giocatore attualmente selezionato" + }, + "administration": { + "labelkick": "Espelli", + "desckick": "Sì, questo giocatore dal server", + "inputkick": "Motivo", + "labelban": "Ban", + "descban": "Banna questo giocatore dal server", + "input1ban": "Ore", + "input2ban": "Giorni", + "input3ban": "Mesi", + "banreason": "Motivo: %s, fino a %s", + "labelperm": "Permessi", + "descperm": "Cambia il livello di permessi", + "permvalue1": "Rimuovi", + "permvalue2": "Mod", + "permvalue3": "Admin", + "permvalue4": "God" + }, + "admin": {}, + "extra": {} + }, + "success": { + "blips_activated": "Blip attivati", + "names_activated": "Nomi attivati", + "coords_copied": "Coordinate copiate negli appunti", + "heading_copied": "Heading copiato negli appunti" + }, + "error": { + "no_perms": "Non hai il permesso per farlo", + "blips_deactivated": "Blip disattivati", + "names_deactivated": "Nomi disattivati" + } +} diff --git a/locales/pt-br.json b/locales/pt-br.json new file mode 100644 index 0000000..1a23628 --- /dev/null +++ b/locales/pt-br.json @@ -0,0 +1,155 @@ +{ + "title": { + "admin_menu": "Opções de Administrador", + "dev_menu": "Opções de Desenvolvedor", + "main_menu": "Menu de Administrador", + "players_menu": "Jogadores Online", + "server_menu": "Gerenciar Servidor" + }, + "main_options": { + "label1": "Opções de Administrador", + "desc1": "Um conjunto de opções que afetarão apenas você", + "label2": "Gerenciamento de Jogadores", + "desc2": "Gerencie sua base de jogadores online atual", + "label3": "Gerenciamento de Servidor", + "desc3": "Gerencie recursos ou opções específicas do servidor", + "label4": "Veículos", + "desc4": "Tudo sobre veículos aqui", + "label5": "Opções de Desenvolvedor", + "desc5": "Opções úteis para um desenvolvedor" + }, + "admin_options": { + "label1": "Noclip", + "desc1": "Passar por paredes como se fosse um fantasma 👻", + "label2": "Reviver", + "desc2": "Volte à ação", + "label3": "Invisível", + "desc3": "Agora você não pode me ver mais", + "label4": "Modo Deus", + "desc4": "Músculos fortes", + "label5": "Nomes", + "desc5": "Veja quais são os nomes dos jogadores", + "label6": "Blips", + "desc6": "Veja as localizações de todos os jogadores no mapa", + "label7": "Modo Deus para Veículo", + "desc7": "Destrua seu veículo sem que ele seja danificado ou destruído", + "label8": "Alterar Modelo de Ped", + "desc8": "Altere sua aparência", + "value8_1": "Alterar Ped", + "value8_2": "Redefinir Ped", + "input8label": "Nome do Modelo de Ped", + "input8placeholder": "a_m_m_soucent_04", + "label9": "Munição Infinita", + "desc9": "Fornece munição infinita para a arma atual que você está segurando", + "label10": "Dar Tudo", + "desc10": "Dá todas as armas dessa categoria", + "value10_1": "Pistolas", + "value10_2": "SMG", + "value10_3": "Escopeta", + "value10_4": "Assalto", + "value10_5": "LMG", + "value10_6": "Sniper", + "value10_7": "Pesado", + "label11": "Algema/Solta", + "desc11": "Algema-se ou solte-se" + }, + "server_options": { + "label1": "Alterar Clima", + "desc1": "Altera o clima para o que estiver atualmente destacado", + "value1_1": "Muito Ensolarado", + "value1_2": "Limpo", + "value1_3": "Neutro", + "value1_4": "Névoa", + "value1_5": "Neblina", + "value1_6": "Nublado", + "value1_7": "Nuvens", + "value1_8": "Clareando", + "value1_9": "Chuva", + "value1_10": "Trovoada", + "value1_11": "Neve", + "value1_12": "Nevasca", + "value1_13": "Neve Leve", + "value1_14": "Natal", + "value1_15": "Halloween", + "label2": "Alterar Horário", + "desc2": "Altera o horário para a hora especificada", + "label3": "Obter Lista de Rádio", + "desc3": "Obtenha uma lista completa de jogadores na frequência de rádio fornecida", + "input3label": "Frequência de Rádio", + "label4": "Pegar Esconderijo", + "desc4": "Abra um esconderijo com o nome especificado", + "input4label": "Nome do Esconderijo" + }, + "dev_options": { + "label1": "Copiar Vetor 2", + "desc1": "Copie suas coordenadas de vetor 2 atuais para a área de transferência", + "label2": "Copiar Vetor 3", + "desc2": "Copie suas coordenadas de vetor 3 atuais para a área de transferência", + "label3": "Copiar Vetor 4", + "desc3": "Copie suas coordenadas de vetor 4 atuais para a área de transferência", + "label4": "Copiar Cabeçalho", + "desc4": "Copie suas coordenadas de cabeçalho atuais para a área de transferência", + "label5": "Exibir Coordenadas", + "desc5": "Exibe suas coordenadas atuais", + "label6": "Exibir Informações do Veículo", + "desc6": "Exibe todos os tipos de informações sobre o veículo em que você está sentado" + }, + "player_options": { + "label1": "Opções Gerais", + "desc1": "As mesmas opções que você encontraria em opções de administrador, mas essas afetarão o jogador escolhido", + "label2": "Administração", + "desc2": "Kick | Ban | Permissões", + "label3": "Opções Extras", + "desc3": "Algumas opções diversas divertidas", + "general": { + "labelkill": "Matar", + "desckill": "Matar o jogador selecionado atualmente", + "labelrevive": "Reviver", + "descrevive": "Reviver o jogador selecionado atualmente", + "labelfreeze": "Congelar", + "descfreeze": "Congelar o jogador selecionado atualmente", + "labelgoto": "Ir para", + "descgoto": "Ir para o jogador selecionado atualmente", + "labelbring": "Trazer", + "descbring": "Trazer o jogador selecionado atualmente", + "labelsitinveh": "Sentar no veículo", + "descsitinveh": "Sentar-se no veículo do jogador selecionado atualmente", + "labelrouting": "Bucket de Roteamento", + "descrouting": "Bucket de roteamento do jogador selecionado atualmente" + }, + "administration": { + "labelkick": "Expulsar", + "desckick": "Expulse este jogador do servidor", + "inputkick": "Motivo", + "labelban": "Banir", + "descban": "Banir permanentemente este jogador do servidor", + "input1ban": "Horas", + "input2ban": "Dias", + "input3ban": "Meses", + "banreason": "Motivo: %s, até %s", + "labelperm": "Permissão", + "descperm": "Alterar o nível de permissão de alguém", + "permvalue1": "Remover", + "permvalue2": "Mod", + "permvalue3": "Admin", + "permvalue4": "Deus" + }, + "admin": { + + }, + "extra": { + + } + }, + "success": { + "blips_activated": "Blips ativados", + "names_activated": "Nomes ativados", + "coords_copied": "Coordenadas copiadas para a área de transferência", + "heading_copied": "Cabeçalho copiado para a área de transferência" + }, + "error": { + "no_perms": "Você não tem permissão para fazer isso", + "blips_deactivated": "Blips desativados", + "names_deactivated": "Nomes desativados" + } +} diff --git a/locales/pt.json b/locales/pt.json new file mode 100644 index 0000000..598ad30 --- /dev/null +++ b/locales/pt.json @@ -0,0 +1,165 @@ +{ + "title": { + "admin_menu": "Opções de Admin", + "dev_menu": "Opções de Desenvolvedor", + "main_menu": "Menu de Admin", + "players_menu": "Jogadores Online", + "server_menu": "Gerenciar Servidor", + "reports_menu": "Relatórios" + }, + "main_options": { + "label1": "Opções de Admin", + "desc1": "Um conjunto de opções que afetará apenas você", + "label2": "Gerenciamento de Jogadores", + "desc2": "Gerencie sua base de jogadores online atual", + "label3": "Gerenciamento de Servidor", + "desc3": "Gerencie recursos ou opções específicas do servidor", + "label4": "Veículos", + "desc4": "Tudo sobre veículos aqui", + "label5": "Opções de Desenvolvedor", + "desc5": "Opções úteis para um desenvolvedor", + "label6": "Relatórios Pendentes", + "desc6": "Alguém precisa fazer isso :(" + }, + "admin_options": { + "label1": "Noclip", + "desc1": "Atravesse paredes como se fosse um fantasma 👻", + "label2": "Reviver", + "desc2": "Coloque-se de volta em ação", + "label3": "Invisível", + "desc3": "Agora você não pode mais me ver", + "label4": "Modo Deus", + "desc4": "Músculos fortes", + "label5": "Nomes", + "desc5": "Veja quais são os nomes dos jogadores", + "label6": "Blips", + "desc6": "Veja as localizações de todos os jogadores no mapa", + "label7": "Modo Deus para Veículos", + "desc7": "Destrua seu veículo sem que ele seja danificado ou destruído", + "label8": "Alterar Modelo de Pedestre", + "desc8": "Mude sua aparência", + "value8_1": "Mudar Pedestre", + "value8_2": "Redefinir Pedestre", + "input8label": "Nome do Modelo do Pedestre", + "input8placeholder": "a_m_m_soucent_04", + "label9": "Munição Infinita", + "desc9": "Fornece munição infinita para a arma atual que você está segurando", + "label10": "Dar Tudo", + "desc10": "Dá todas as armas naquela categoria", + "value10_1": "Pistolas", + "value10_2": "Smg", + "value10_3": "Espingarda", + "value10_4": "Assalto", + "value10_5": "Lmg", + "value10_6": "Franco-atirador", + "value10_7": "Pesado", + "label11": "Algema / Desalgemar", + "desc11": "Algemar-se ou desalgemar" + }, + "server_options": { + "label1": "Alterar Clima", + "desc1": "Muda o clima para o que estiver atualmente destacado", + "value1_1": "Extra Ensolarado", + "value1_2": "Limpo", + "value1_3": "Neutro", + "value1_4": "Neblina", + "value1_5": "Nublado", + "value1_6": "Encoberto", + "value1_7": "Nuvens", + "value1_8": "Limpo", + "value1_9": "Chuva", + "value1_10": "Trovão", + "value1_11": "Neve", + "value1_12": "Tempestade de Neve", + "value1_13": "Neve Leve", + "value1_14": "Natal", + "value1_15": "Halloween", + "label2": "Alterar Hora", + "desc2": "Muda a hora para a hora especificada", + "label3": "Obter Lista de Rádio", + "desc3": "Obtenha uma lista completa de jogadores na frequência de rádio especificada", + "input3label": "Frequência de Rádio", + "label4": "Pegar Esconderijo", + "desc4": "Abra um esconderijo com o nome especificado", + "input4label": "Nome do Esconderijo" + }, + "dev_options": { + "label1": "Copiar Vetor 2", + "desc1": "Copie suas coordenadas de vetor 2 atuais para a área de transferência", + "label2": "Copiar Vetor 3", + "desc2": "Copie suas coordenadas de vetor 3 atuais para a área de transferência", + "label3": "Copiar Vetor 4", + "desc3": "Copie suas coordenadas de vetor 4 atuais para a área de transferência", + "label4": "Copiar Cabeçalho", + "desc4": "Copie suas coordenadas de cabeçalho atuais para a área de transferência", + "label5": "Exibir Coordenadas", + "desc5": "Exibe suas coordenadas atuais", + "label6": "Exibir Informações do Veículo", + "desc6": "Exibe todo tipo de informação sobre o veículo em que você está sentado" + }, + "player_options": { + "label1": "Opções Gerais", + "desc1": "As mesmas opções que você encontraria em opções de admin, mas estas afetarão o jogador escolhido", + "label2": "Administração", + "desc2": "Kick | Banir | Permissões", + "label3": "Opções Extras", + "desc3": "Algumas opções divertidas e diversas", + "general": { + "labelkill": "Matar", + "desckill": "Mate o jogador selecionado atualmente", + "labelrevive": "Reviver", + "descrevive": "Reviva o jogador selecionado atualmente", + "labelfreeze": "Congelar", + "descfreeze": "Congele o jogador selecionado atualmente", + "labelgoto": "Ir para", + "descgoto": "Vá para o jogador selecionado atualmente", + "labelbring": "Trazer", + "descbring": "Traga o jogador selecionado atualmente", + "labelsitinveh": "Sentar no veículo", + "descsitinveh": "Sente-se no veículo do jogador selecionado atualmente", + "labelrouting": "Roteamento", + "descrouting": "Roteie o jogador selecionado atualmente" + }, + "administration": { + "labelkick": "Kick", + "desckick": "Expulse este jogador do servidor", + "inputkick": "Razão", + "labelban": "Ban", + "descban": "Expulse permanentemente este jogador do servidor", + "input1ban": "Horas", + "input2ban": "Dias", + "input3ban": "Meses", + "banreason": "Razão: %s, até %s", + "labelperm": "Permissão", + "descperm": "Mude o nível de permissão de alguém", + "permvalue1": "Remover", + "permvalue2": "Mod", + "permvalue3": "Admin", + "permvalue4": "Deus" + }, + "admin": { + + }, + "extra": { + + } + }, + "report_options": { + "desc1": "Clique para ver as opções de relatório" + }, + "success": { + "blips_activated": "Blips ativados", + "names_activated": "Nomes ativados", + "coords_copied": "Coordenadas copiadas para a área de transferência", + "heading_copied": "Cabeçalho copiado para a área de transferência", + "report_sent": "Relatório enviado", + "new_report": "Um novo relatório foi recebido", + "sent_report_reply": "Sua resposta foi enviada" + }, + "error": { + "no_perms": "Você não tem permissão para fazer isso", + "blips_deactivated": "Blips desativados", + "names_deactivated": "Nomes desativados", + "no_report_reply": "Falha ao enviar resposta devido a nenhuma mensagem" + } +} diff --git a/locales/sv.json b/locales/sv.json new file mode 100644 index 0000000..0012074 --- /dev/null +++ b/locales/sv.json @@ -0,0 +1,153 @@ +{ + "title": { + "main_menu": "Admin-Meny", + "admin_menu": "Admin-Alternativ", + "server_menu": "Hantera server", + "dev_menu": "Utvecklar-Alternativ", + "players_menu": "Online-spelare" + }, + "main_options": { + "label1": "Admin-Alternativ", + "desc1": "En uppsättning alternativ som bara påverkar dig", + "label2": "Spelarhantering", + "desc2": "Hantera din nuvarande onlinespelarebas", + "label3": "Serverhantering", + "desc3": "Hantera resurser eller serverspecifika alternativ", + "label4": "Fordon", + "desc4": "Allt om fordon här", + "label5": "Utvecklaralternativ", + "desc5": "Alternativ som är praktiska för en utvecklare" + }, + "admin_options": { + "label1": "Noclip", + "desc1": "Gå igenom väggarna som om du är ett spöke 👻", + "label2": "Revive", + "desc2": "Get yourself back in action", + "label3": "Invisible", + "desc3": "Nu kan du inte se mig längre", + "label4": "Godmode", + "desc4": "Strong muscles", + "label5": "Names", + "desc5": "Se spelares namn", + "label6": "Blips", + "desc6": "Se alla spelare på kartan", + "label7": "Vehicle Godmode", + "desc7": "Krocka ditt fordon utan att det skadas eller förstörs", + "label8": "Ändra PED-modell", + "desc8": "Ändra hur du ser ut", + "value8_1": "Ändra ped", + "value8_2": "Återställ ped", + "input8label": "Ped-modell namn", + "input8placeholder": "a_m_m_soucent_04", + "label9": "Infinite Ammo", + "desc9": "Ger dig oändlig ammunition för det vapen du bär", + "label10": "Ge alla", + "desc10": "Ger varje vapen i den kategorin", + "value10_1": "Pistols", + "value10_2": "Smg", + "value10_3": "Shotgun", + "value10_4": "Assualt", + "value10_5": "Lmg", + "value10_6": "Sniper", + "value10_7": "Heavy", + "label11": "Handfängsel på/av", + "desc11": "På/av handfängsel på dig själv" + }, + "server_options": { + "label1": "Ändra vädret", + "desc1": "Ändrar vädret till vad som för närvarande är markerat", + "value1_1": "Extrasunny", + "value1_2": "Clear", + "value1_3": "Neutral", + "value1_4": "Smog", + "value1_5": "Foggy", + "value1_6": "Overcast", + "value1_7": "Clouds", + "value1_8": "Clearing", + "value1_9": "Rain", + "value1_10": "Thunder", + "value1_11": "Snow", + "value1_12": "Blizzard", + "value1_13": "Snowlight", + "value1_14": "Xmas", + "value1_15": "Halloween", + "label2": "Ändra tid", + "desc2": "Ändrar tiden till den angivna timmen", + "label3": "Få radiolista", + "desc3": "Få en fullständig lista över spelare på den givna radiofrekvensen", + "input3label": "Radiofrekvens", + "label4": "Visa Stash", + "desc4": "Öppna en stash med det angivna namnet", + "input4label": "Stash namn" + }, + "dev_options": { + "label1": "Kopiera Vector 2", + "desc1": "Kopiera din nuvarande vektor 2 koordinater till ditt urklipp", + "label2": "Kopiera Vector 3", + "desc2": "Kopiera din nuvarande vektor 3 koordinater till ditt urklipp", + "label3": "Kopiera Vector 4", + "desc3": "Kopiera din nuvarande vektor 4 koordinater till ditt urklipp", + "label4": "Kopiera Heading", + "desc4": "Kopiera dina nuvarande heading till ditt urklipp", + "label5": "Visa koordinater", + "desc5": "Visar dina nuvarande koordinater", + "label6": "Visa fordonsinformation", + "desc6": "Visar all slags information om fordonet du sitter i" + }, + "player_options": { + "label1": "Generella-Alternativ", + "desc1": "Samma alternativ som du hittar under administratörsalternativ, men dessa kommer att påverka den valda spelaren", + "label2": "Administrering", + "desc2": "Kick | Ban | Behörigheter", + "label3": "Extra alternativ", + "desc3": "Några roliga diverse alternativ", + "general": { + "labelkill": "Döda", + "desckill": "Döda den valda spelaren", + "labelrevive": "Återuppliva", + "descrevive": "Återuppliva den valda spelaren", + "labelfreeze": "Frys", + "descfreeze": "Frys den valda spelaren", + "labelgoto": "Gå till", + "descgoto": "Gå till den valda spelaren", + "labelbring": "Ta hit", + "descbring": "Ta hit den valda spelaren", + "labelsitinveh": "Sitt i fordonet", + "descsitinveh": "Sätt dig i fordenet som den valda spelaren", + "labelrouting": "Routingbucket", + "descrouting": "RoutingBucket valda spelaren" + }, + "administration": { + "labelkick": "Kick", + "desckick": "Yeet this player from the server", + "inputkick": "Anledning", + "labelban": "Ban", + "descban": "Perm yeet this player from the server", + "input1ban": "Timme", + "input2ban": "Dagar", + "input3ban": "Månad", + "banreason": "Anledning: %s, fram tills %s", + "labelperm": "Behörigheter", + "descperm": "Ändra någons Behörigheter", + "permvalue1": "Ta bort", + "permvalue2": "Mod", + "permvalue3": "Admin", + "permvalue4": "God" + }, + "admin": { + + }, + "extra": { + + } + }, + "success": { + "blips_activated": "Blips aktiverad", + "names_activated": "Names aktiverad" + }, + "error": { + "no_perms": "Du har inte tillstånd att göra detta", + "blips_deactivated": "Blips inaktiverad", + "names_deactivated": "Names inaktiverad" + } +} diff --git a/server/commands.lua b/server/commands.lua new file mode 100644 index 0000000..1357fba --- /dev/null +++ b/server/commands.lua @@ -0,0 +1,119 @@ +local config = require 'config.server'.commandPerms + +lib.addCommand('report', { + help = 'Send Report', + params = { + {name = 'report', help = 'Your report message', type = 'string'} + } +}, function(source, args, raw) + SendReport(source, string.sub(raw, 8)) +end) + +lib.addCommand('admin', { + help = 'Opens Admin Menu', + restricted = config.useMenu, +}, function(source) + TriggerClientEvent('qbx_admin:client:openMenu', source) +end) + +lib.addCommand('noclip', { + help = 'Toggle NoClip', + restricted = config.noclip, +}, function(source) + TriggerClientEvent('qbx_admin:client:ToggleNoClip', source) +end) + +lib.addCommand('names', { + help = 'Toggle Player Names', + restricted = config.names, +}, function(source) + TriggerClientEvent('qbx_admin:client:names', source) +end) + +lib.addCommand('blips', { + help = 'Toggle Player Blips', + restricted = config.blips, +}, function(source) + TriggerClientEvent('qbx_admin:client:blips', source) +end) + +lib.addCommand('admincar', { + help = 'Buy Vehicle', + restricted = config.saveVehicle, +}, function(source) + local vehicle = GetVehiclePedIsIn(GetPlayerPed(source), false) + if vehicle == 0 then + return exports.qbx_core:Notify(source, 'You have to be in a vehicle, to use this', 'error') + end + + local vehModel = GetEntityModel(vehicle) + + if not exports.qbx_core:GetVehiclesByHash()[vehModel] then + return exports.qbx_core:Notify(source, 'Unknown vehicle, please contact your developer to register it.', 'error') + end + + local playerData = exports.qbx_core:GetPlayer(source).PlayerData + local vehName, props = lib.callback.await('qbx_admin:client:GetVehicleInfo', source) + local existingVehicleId = Entity(vehicle).state.vehicleid + if existingVehicleId then + local response = lib.callback.await('qbx_admin:client:SaveCarDialog', source) + + if not response then + return exports.qbx_core:Notify(source, 'Canceled.', 'inform') + end + local success, err = exports.qbx_vehicles:SetPlayerVehicleOwner(existingVehicleId, playerData.citizenid) + if not success then error(err) end + else + local vehicleId, err = exports.qbx_vehicles:CreatePlayerVehicle({ + model = vehName, + citizenid = playerData.citizenid, + props = props, + }) + if err then error(err) end + Entity(vehicle).state:set('vehicleid', vehicleId, true) + end + exports.qbx_core:Notify(source, 'This vehicle is now yours.', 'success') +end) + +lib.addCommand('setmodel', { + help = 'Sets your model to the given model', + restricted = config.setModel, + params = { + {name = 'model', help = 'NPC Model', type = 'string'}, + {name = 'id', help = 'Player ID', type = 'number', optional = true}, + } +}, function(source, args) + local Target = args.id or source + + if not exports.qbx_core:GetPlayer(Target) then return end + + TriggerClientEvent('qbx_admin:client:setModel', Target, args.model) +end) + +lib.addCommand('vec2', { + help = 'Copy vector2 to clipboard (Admin only)', + restricted = config.dev, +}, function(source) + TriggerClientEvent('qbx_admin:client:copyToClipboard', source, 'coords2') +end) + +lib.addCommand('vec3', { + help = 'Copy vector3 to clipboard (Admin only)', + restricted = config.dev, +}, function(source) + TriggerClientEvent('qbx_admin:client:copyToClipboard', source, 'coords3') +end) + +lib.addCommand('vec4', { + help = 'Copy vector4 to clipboard (Admin only)', + restricted = config.dev, +}, function(source) + TriggerClientEvent('qbx_admin:client:copyToClipboard', source, 'coords4') +end) + +lib.addCommand('heading', { + help = 'Copy heading to clipboard (Admin only)', + restricted = config.dev, +}, function(source) + TriggerClientEvent('qbx_admin:client:copyToClipboard', source, 'heading') +end) \ No newline at end of file diff --git a/server/main.lua b/server/main.lua new file mode 100644 index 0000000..05f6335 --- /dev/null +++ b/server/main.lua @@ -0,0 +1,306 @@ +local config = require 'config.server' +local isFrozen = {} +local reportsCount = 0 + +REPORTS = {} + +--- Trigger something on players who have the passed permission +--- @param permission string - The required permission +--- @param cb function - The function, will return player object as parameter +function OnAdmin(permission, cb) + for k, v in pairs(exports.qbx_core:GetQBPlayers()) do + if IsPlayerAceAllowed(k, permission) then + cb(v) + end + end +end + +--- Sends a report to online staff members +--- @param source string - The player's ID +--- @param message string - Message for the report +function SendReport(source, message) + local reportId = #REPORTS + 1 + reportsCount += 1 + + REPORTS[reportId] = { + id = reportsCount, + senderId = source, + senderName = GetPlayerName(source), + message = message, + claimed = 'Nobody' + } + + table.sort(REPORTS, function(a, b) return a.id < b.id end) + + exports.qbx_core:Notify(source, locale('success.report_sent'), 'success') + + OnAdmin(config.commandPerms.reportReply, function(target) + exports.qbx_core:Notify(target.PlayerData.source, locale('success.new_report'), 'success') + end) +end + +--- Checks if the source is inside of the target's routingbucket +--- if not set the source's routingbucket to the target's +--- @param source string - The player's ID +--- @param target string - The player's ID +function CheckRoutingbucket(source, target) + local sourceBucket = GetPlayerRoutingBucket(source) + local targetBucket = GetPlayerRoutingBucket(target) + if sourceBucket ~= targetBucket then SetPlayerRoutingBucket(source, targetBucket) end +end + +RegisterNetEvent('qbx_admin:server:sendReply', function(report, message) + if not IsPlayerAceAllowed(source, config.commandPerms.reportReply) then exports.qbx_core:Notify(source, locale('error.no_perms'), 'error') return end + + for k, v in pairs(REPORTS) do + if v.id == report.id then + local name = GetPlayerName(source) + + TriggerClientEvent('chatMessage', report.senderId, "", {255, 0, 0}, string.format('[REPORT #%s] [%s] ^7%s', report.id, name, message)) + + exports.qbx_core:Notify(source, locale('success.sent_report_reply'), 'success') + if REPORTS[k].claimed == 'Nobody' then + REPORTS[k].claimed = name + OnAdmin(config.commandPerms.reportReply, function(target) + exports.qbx_core:Notify(target.PlayerData.source, string.format(locale('success.report_claimed_by'), report.id, name), 'success') + end) + end + return + end + end +end) + +RegisterNetEvent('qbx_admin:server:deleteReport', function(report) + if not IsPlayerAceAllowed(source, config.commandPerms.reportReply) then exports.qbx_core:Notify(source, locale('error.no_perms'), 'error') return end + + for k, v in pairs(REPORTS) do + if v.id == report.id then + return table.remove(REPORTS, k) + end + end +end) + +local generalOptions = { + function(selectedPlayer) TriggerClientEvent('qbx_admin:client:killPlayer', selectedPlayer.id) end, + function(selectedPlayer) TriggerClientEvent('qbx_medical:client:playerRevived', selectedPlayer.id) end, + function(selectedPlayer) + if isFrozen[selectedPlayer.id] then + FreezeEntityPosition(GetPlayerPed(selectedPlayer.id), false) + isFrozen[selectedPlayer.id] = false + else + FreezeEntityPosition(GetPlayerPed(selectedPlayer.id), true) + isFrozen[selectedPlayer.id] = true + end + end, + function(selectedPlayer, source) + local coords = GetEntityCoords(GetPlayerPed(selectedPlayer.id)) + CheckRoutingbucket(source, selectedPlayer.id) + SetEntityCoords(GetPlayerPed(source), coords.x, coords.y, coords.z, false, false, false, false) + end, + function(selectedPlayer, source) + local coords = GetEntityCoords(GetPlayerPed(source)) + CheckRoutingbucket(selectedPlayer.id, source) + SetEntityCoords(GetPlayerPed(selectedPlayer.id), coords.x, coords.y, coords.z, false, false, false, false) + end, + function(selectedPlayer, source) + local vehicle = GetVehiclePedIsIn(GetPlayerPed(selectedPlayer.id), false) + local seat = -1 + if vehicle == 0 then return end + for i = 0, 8, 1 do if GetPedInVehicleSeat(vehicle, i) == 0 then seat = i break end end + if seat == -1 then return end + SetPedIntoVehicle(GetPlayerPed(source), vehicle, seat) + end, + function(selectedPlayer, _, input) + exports.qbx_core:SetPlayerBucket(selectedPlayer.id, input) + end, +} +RegisterNetEvent('qbx_admin:server:playerOptionsGeneral', function(selected, selectedPlayer, input) + if not IsPlayerAceAllowed(source, config.eventPerms.playerOptionsGeneral) then exports.qbx_core:Notify(source, locale('error.no_perms'), 'error') return end + + ---@diagnostic disable-next-line: redundant-parameter + generalOptions[selected](selectedPlayer, source, input) +end) + +local administrationOptions = { + function(source, selectedPlayer, input) + if not IsPlayerAceAllowed(source, config.eventPerms.kick) then exports.qbx_core:Notify(source, locale('error.no_perms'), 'error') return end + DropPlayer(selectedPlayer.id, input) + end, + function(source, selectedPlayer, input) + if not IsPlayerAceAllowed(source, config.eventPerms.ban) then exports.qbx_core:Notify(source, locale('error.no_perms'), 'error') return end + local banDuration = (input[2] or 0) * 3600 + (input[3] or 0) * 86400 + (input[4] or 0) * 2629743 + DropPlayer(selectedPlayer.id, locale('player_options.administration.banreason', input[1], os.date('%c', os.time() + banDuration))) + MySQL.Async.insert('INSERT INTO bans (name, license, discord, ip, reason, expire, bannedby) VALUES (?, ?, ?, ?, ?, ?, ?)', { + GetPlayerName(selectedPlayer.id), GetPlayerIdentifierByType(selectedPlayer.id, 'license'), GetPlayerIdentifierByType(selectedPlayer.id, 'discord'), + GetPlayerIdentifierByType(selectedPlayer.id, 'ip'), input[1], os.time() + banDuration, GetPlayerName(source) + }) + end, + function(source, selectedPlayer, input) + if not IsPlayerAceAllowed(source, config.eventPerms.changePerms) then exports.qbx_core:Notify(source, locale('error.no_perms'), 'error') return end + if input == 'remove' then exports.qbx_core:RemovePermission(selectedPlayer.id) else exports.qbx_core:AddPermission(selectedPlayer.id, input) end + end, +} +RegisterNetEvent('qbx_admin:server:playerAdministration', function(selected, selectedPlayer, input) + administrationOptions[selected](source, selectedPlayer, input) +end) + +local playerDataOptions = { + name = function(target, input) + if input[1] then target.PlayerData.charinfo.firstname = input[1] end + if input[2] then target.PlayerData.charinfo.lastname = input[2] end + target.Functions.SetPlayerData('charinfo', target.PlayerData.charinfo) + end, + food = function(target, input) target.Functions.SetMetaData('hunger', input[1]) end, + thirst = function(target, input) target.Functions.SetMetaData('thirst', input[1]) end, + stress = function(target, input) target.Functions.SetMetaData('stress', input[1]) end, + armor = function(target, input) target.Functions.SetMetaData('armor', input[1]) SetPedArmour(GetPlayerPed(target.PlayerData.source), input[1]) end, + phone = function(target, input) + target.PlayerData.charinfo.phone = input[1] + target.Functions.SetPlayerData('charinfo', target.PlayerData.charinfo) + end, + crafting = function(target, input) target.Functions.SetMetaData('craftingrep', input[1]) end, + dealer = function(target, input) target.Functions.SetMetaData('dealerrep', input[1]) end, + cash = function(target, input) + target.Functions.SetMoney('cash', input[1], 'qbx_adminmenu') + end, + bank = function(target, input) + target.Functions.SetMoney('bank', input[1], 'qbx_adminmenu') + end, + job = function(target, input) + target.Functions.SetJob(input[1], input[2]) + end, + gang = function(target, input) + target.Functions.SetGang(input[1], input[2]) + end, + radio = function(target, input) + exports['pma-voice']:setPlayerRadio(target.PlayerData.source, input[1]) + end, +} +RegisterNetEvent('qbx_admin:server:changePlayerData', function(selected, selectedPlayer, input) + local target = exports.qbx_core:GetPlayer(selectedPlayer.id) + + if not IsPlayerAceAllowed(source, config.eventPerms.changePlayerData) then exports.qbx_core:Notify(source, locale('error.no_perms'), 'error') return end + if not target then return end + + playerDataOptions[selected](target, input) +end) + +RegisterNetEvent('qbx_admin:server:giveAllWeapons', function(weaponType, playerID) + local src = playerID or source + local target = exports.qbx_core:GetPlayer(src) + + if not IsPlayerAceAllowed(source, config.eventPerms.giveAllWeapons) then exports.qbx_core:Notify(source, locale('error.no_perms'), 'error') return end + + for i = 1, #config.weaponList[weaponType], 1 do + target.Functions.AddItem(config.weaponList[weaponType][i], 1) + end +end) + +lib.callback.register('qbx_admin:callback:getradiolist', function(source, frequency) + local list = exports['pma-voice']:getPlayersInRadioChannel(tonumber(frequency)) + local players = {} + + if not IsPlayerAceAllowed(source, config.eventPerms.getRadioList) then exports.qbx_core:Notify(source, locale('error.no_perms'), 'error') return end + + for targetSource, _ in pairs(list) do -- cheers Knight who shall not be named + local player = exports.qbx_core:GetPlayer(targetSource) + players[#players + 1] = { + id = targetSource, + name = player.PlayerData.charinfo.firstname .. ' ' .. player.PlayerData.charinfo.lastname .. ' | (' .. GetPlayerName(targetSource) .. ')' + } + end + return players, frequency +end) + +lib.callback.register('qbx_admin:server:getPlayers', function(source) + if not IsPlayerAceAllowed(source, config.eventPerms.useMenu) then exports.qbx_core:Notify(source, locale('error.no_perms'), 'error') return end + + local players = {} + for k, v in pairs(exports.qbx_core:GetQBPlayers()) do + players[#players + 1] = { + id = k, + cid = v.PlayerData.citizenid, + name = v.PlayerData.charinfo.firstname .. ' ' .. v.PlayerData.charinfo.lastname .. ' | (' .. GetPlayerName(k) .. ')', + food = Player(v.PlayerData.source).state.hunger, + water = Player(v.PlayerData.source).state.thirst, + stress = Player(v.PlayerData.source).state.stress, + armor = v.PlayerData.metadata.armor, + phone = v.PlayerData.charinfo.phone, + craftingrep = v.PlayerData.metadata.craftingrep, + dealerrep = v.PlayerData.metadata.dealerrep, + cash = v.PlayerData.money.cash, + bank = v.PlayerData.money.bank, + job = v.PlayerData.job.label .. ' | ' .. v.PlayerData.job.grade.level, + gang = v.PlayerData.gang.label, + license = GetPlayerIdentifierByType(k, 'license') or 'Unknown', + discord = GetPlayerIdentifierByType(k, 'discord') or 'Not Linked', + steam = GetPlayerIdentifierByType(k, 'steam') or 'Not Linked', + } + end + table.sort(players, function(a, b) return a.id < b.id end) + return players +end) + +lib.callback.register('qbx_admin:server:getPlayer', function(source, playerToGet) + if not IsPlayerAceAllowed(source, config.eventPerms.useMenu) then exports.qbx_core:Notify(source, locale('error.no_perms'), 'error') return end + + local playerData = exports.qbx_core:GetPlayer(playerToGet).PlayerData + local player = { + id = playerToGet, + cid = playerData.citizenid, + name = playerData.charinfo.firstname .. ' ' .. playerData.charinfo.lastname .. ' | (' .. GetPlayerName(playerToGet) .. ')', + food = Player(playerData.source).state.hunger, + water = Player(playerData.source).state.thirst, + stress = Player(playerData.source).state.stress, + armor = playerData.metadata.armor, + phone = playerData.charinfo.phone, + craftingrep = playerData.metadata.craftingrep, + dealerrep = playerData.metadata.dealerrep, + cash = playerData.money.cash, + bank = playerData.money.bank, + job = playerData.job.label .. ' | ' .. playerData.job.grade.level, + gang = playerData.gang.label, + license = GetPlayerIdentifierByType(playerToGet, 'license') or 'Unknown', + discord = GetPlayerIdentifierByType(playerToGet, 'discord') or 'Not Linked', + steam = GetPlayerIdentifierByType(playerToGet, 'steam') or 'Not Linked', + } + return player +end) + +lib.callback.register('qbx_admin:server:clothingMenu', function(source, target) + if not IsPlayerAceAllowed(source, config.eventPerms.clothingMenu) then + exports.qbx_core:Notify(source, locale('error.no_perms'), 'error') + return false + end + + TriggerClientEvent('qb-clothing:client:openMenu', target) + + return true +end) + +lib.callback.register('qbx_admin:server:canUseMenu', function(source) + if not IsPlayerAceAllowed(source, config.eventPerms.useMenu) then + exports.qbx_core:Notify(source, locale('error.no_perms'), 'error') + return false + end + + return true +end) + +lib.callback.register('qbx_admin:server:spawnVehicle', function(source, model) + local ped = GetPlayerPed(source) + local netId = qbx.spawnVehicle({ + model = model, + spawnSource = ped, + warp = true, + }) + + exports.qbx_vehiclekeys:GiveKeys(source, NetworkGetEntityFromNetworkId(netId)) + return netId +end) + +lib.callback.register('qbx_admin:server:getReports', function(source) + if not IsPlayerAceAllowed(source, config.commandPerms.reportReply) then exports.qbx_core:Notify(source, locale('error.no_perms'), 'error') return end + + return REPORTS +end) \ No newline at end of file From d170807de126b8820d5a2c47265d654e19ef666b Mon Sep 17 00:00:00 2001 From: Solareon <769465+solareon@users.noreply.github.com> Date: Sun, 29 Sep 2024 11:44:33 +0200 Subject: [PATCH 2/3] refactor(server): use vehicle entity from spawnvehicle --- server/main.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/main.lua b/server/main.lua index 05f6335..556bb9b 100644 --- a/server/main.lua +++ b/server/main.lua @@ -57,7 +57,7 @@ RegisterNetEvent('qbx_admin:server:sendReply', function(report, message) local name = GetPlayerName(source) TriggerClientEvent('chatMessage', report.senderId, "", {255, 0, 0}, string.format('[REPORT #%s] [%s] ^7%s', report.id, name, message)) - + exports.qbx_core:Notify(source, locale('success.sent_report_reply'), 'success') if REPORTS[k].claimed == 'Nobody' then REPORTS[k].claimed = name @@ -289,13 +289,13 @@ end) lib.callback.register('qbx_admin:server:spawnVehicle', function(source, model) local ped = GetPlayerPed(source) - local netId = qbx.spawnVehicle({ + local netId, vehicle = qbx.spawnVehicle({ model = model, spawnSource = ped, warp = true, }) - exports.qbx_vehiclekeys:GiveKeys(source, NetworkGetEntityFromNetworkId(netId)) + exports.qbx_vehiclekeys:GiveKeys(source, vehicle) return netId end) From 4fe3223c3f3bf60ab1acd1acf8d0d64c5ac0348f Mon Sep 17 00:00:00 2001 From: Solareon <769465+solareon@users.noreply.github.com> Date: Sun, 29 Sep 2024 11:48:24 +0200 Subject: [PATCH 3/3] chore: revert editorconfig linefeed change --- .editorconfig | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.editorconfig b/.editorconfig index 9c97eb2..689eb11 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,9 +1,9 @@ -root = true - -[*] -end_of_line = lf -insert_final_newline = false -indent_style = space -charset = utf-8 -trim_trailing_whitespace = true -indent_size = 4 +root = true + +[*] +end_of_line = lf +insert_final_newline = false +indent_style = space +charset = utf-8 +trim_trailing_whitespace = true +indent_size = 4