Coder Social home page Coder Social logo

qb-cityhall's Introduction

qb-cityhall

City Services for QB-Core Framework

Dependencies

Features

  • Ability to request birth certificate when lost
  • Ability to request driver license when granted by a driving instructor
  • Ability to request weapon license when granted it by the police
  • Ability to apply to government jobs
  • Ability to add multiple cityhall locations
  • Ability to add nultiple driving school locations
  • Ability to take driving lessons
  • qb-target integration, this is optional
  • PolyZone and qb-core DrawText integration, this is optional

Installation

Manual

  • Download the script and put it in the [qb] directory.
  • Add the following code to your server.cfg/resources.cfg
ensure qb-core
ensure qb-target # Optional
ensure qb-phone
ensure qb-cityhall

Screenshots

City Services Request Birth Certificate Request Driver License Request Weapon License Apply For a Job Cityhall DrawText Interaction Cityhall QB-Target Interaction Driving School Sending And Receiving Mail Driving School DrawText Interaction Driving School QB-Target Interaction

License

QBCore Framework
Copyright (C) 2021 Joshua Eger

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 <https://www.gnu.org/licenses/>

qb-cityhall's People

Contributors

berkiebb avatar citrattv avatar codiaz avatar developer-bear avatar evanillaa avatar getpwnedbydolbajoba avatar ghzgarage avatar i-kulgu avatar idrisdose avatar ihyajb avatar izmystic avatar kamuikody avatar liamdormon avatar mataskc avatar minkuan-buu avatar morfar22 avatar newtonzz avatar pluto-really avatar pride1922 avatar r0adra93 avatar sharkiiie avatar skyvzla avatar slugteamsix avatar suelthedev avatar theilleniumstudios avatar tom-osborne avatar tonybynmp4 avatar viruspc2002 avatar z3rio avatar zfbx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qb-cityhall's Issues

[Script Error]

Hey, my core is updated but I'm getting this error, any help?:

image

Free Licenses Glitch

if you have 0 cash on you , you can buy as much free licenses as you want and it doesn't even check for the bank .

[New features] Overhaul

  • Being able to make seperate city halls with different licenses available per cityhall
  • A driving school feature, these can also be seperate and you can have different driving instructors available for every driving school
  • Better code
  • Optimized code
  • qb-target and qb-core drawtext integration using PolyZone
  • Some bugs and exploits fixed
  • You can now only get a license such as a driving license and weapon license if you are granted it, for the driving license it has to be granted by a driving instructor, for the weapon license the police needs to grant you it

Email not Receive

image

after waiting around 10 mins
i didnt get any mail to take driving license
can someone help me? thanks

[]Weapon Lic at city hall

Describe the bug
I'm having the problem of when you issue the Weapon lic thru ps mdt or the /grantlic. command you go to the city hall and is does not show at all now i can go restart just city hall and it shows up then but i if i revoke the weapon lic and reissue it the lic it won't show up unless you restart the script then it shows up just fine.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'City Hall'
  2. Type in '/grantlic (id) weapon'
  3. Check to see if lic cause on my side i dont see it
  4. if it not there then restart city hall only

Expected behavior
Give Weapon Lic..

Screenshots
If applicable, add screenshots to help explain your problem.

Questions (please complete the following information):

  • When you last updated: [12/3/2023]
  • Are you using custom resource? which ones? [N/A]
  • Have you renamed qb- to something custom? [NO]

Additional context
Here is the Code for Grant Lic.
QBCore.Commands.Add("grantlicense", Lang:t("commands.license_grant"), {{name = "id", help = Lang:t('info.player_id')}, {name = "license", help = Lang:t('info.license_type')}}, true, function(source, args)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if Player.PlayerData.job.name == "police" and Player.PlayerData.job.grade.level >= Config.LicenseRank then
if args[2] == "driver" or args[2] == "weapon" then
local SearchedPlayer = QBCore.Functions.GetPlayer(tonumber(args[1]))
if not SearchedPlayer then return end
local licenseTable = SearchedPlayer.PlayerData.metadata["licences"]
if licenseTable[args[2]] then
TriggerClientEvent('QBCore:Notify', src, Lang:t("error.license_already"), "error")
return
end
licenseTable[args[2]] = true
SearchedPlayer.Functions.SetMetaData("licences", licenseTable)
TriggerClientEvent('QBCore:Notify', SearchedPlayer.PlayerData.source, Lang:t("success.granted_license"), "success")
TriggerClientEvent('QBCore:Notify', src, Lang:t("success.grant_license"), "success")
else
TriggerClientEvent('QBCore:Notify', src, Lang:t("error.error_license_type"), "error")
end
else
TriggerClientEvent('QBCore:Notify', src, Lang:t("error.rank_license"), "error")
end
end)

QBCore.Commands.Add("revokelicense", Lang:t("commands.license_revoke"), {{name = "id", help = Lang:t('info.player_id')}, {name = "license", help = Lang:t('info.license_type')}}, true, function(source, args)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if Player.PlayerData.job.name == "police" and Player.PlayerData.job.grade.level >= Config.LicenseRank then
if args[2] == "driver" or args[2] == "weapon" then
local SearchedPlayer = QBCore.Functions.GetPlayer(tonumber(args[1]))
if not SearchedPlayer then return end
local licenseTable = SearchedPlayer.PlayerData.metadata["licences"]
if not licenseTable[args[2]] then
TriggerClientEvent('QBCore:Notify', src, Lang:t("error.error_license"), "error")
return
end
licenseTable[args[2]] = false
SearchedPlayer.Functions.SetMetaData("licences", licenseTable)
TriggerClientEvent('QBCore:Notify', SearchedPlayer.PlayerData.source, Lang:t("error.revoked_license"), "error")
TriggerClientEvent('QBCore:Notify', src, Lang:t("success.revoke_license"), "success")
else
TriggerClientEvent('QBCore:Notify', src, Lang:t("error.error_license"), "error")
end
else
TriggerClientEvent('QBCore:Notify', src, Lang:t("error.rank_revoke"), "error")
end
end)

I have tried going to a discord support call but no one was wanting too help out on this any help will be helpful. THANK YOU!!!

tutorial [SUGGESTION]

Make a tutorial how to make the license card so it shows what kind of license you have instead off class c license

for when i show my license its only saying Class c license when i have N and AM

[BUG] Weapon license with a different police script

I have a qbcore server and I have Changed the qb-police to wasabi-police but when I Issue a weapon licence and they go to city hall they Weapon licence is not there.
Is there something I need to change in thidescript and if so can someone please help me and where I need to change it?

[BUG] Setjob function not working

When I go to apply for a job via the NPC at city hall, like taxi for example, no notification comes up and I don't get the job. There are no errors in F8 and console. The jobs do exist. Not sure what else to do. Thank you for your help in advance!

[BUG] City hall menu accessible from roof - Kicked when used for "Attempted exploit abuse"

Describe the bug
Using /tpm to tp to the cityhall puts you on the roof of the building and the menu is still accessible up there. If you select a job while still on the roof, you get kicked for "Attempted exploit abuse"

To Reproduce
Steps to reproduce the behavior:

  1. Ensure server is not using qb-target: setr UseTarget false in server.cfg
  2. TP to the Cityhall using /tpm
  3. Should result in you being on the roof of the cityhall building
  4. Move around a bit until you see the [E] Open Cityhall notification
  5. Press E
  6. Server kicks you

Expected behavior
I would expect to not be TP'd to the roof, and also while on the roof, the menu should not be accessible.

Screenshots
image

Questions (please complete the following information):

  • When you last updated: 1 week ago
  • Are you using custom resource? Base QB install
  • Have you renamed qb- to something custom? No

Additional context
N/A

[BUG]

The menu after it closes freezes your character, as if the menu is still open.

I am not able to access the City services menu, Not sure how to open it. The location of the ped has been moved but having issues to open the City Services menu to buy id, drivers license or Weapon license[BUG]

Describe the bug
A clear and concise description of what the bug is. A stranger to qbcore should be able to read your bug report and understand how to reproduce it themselves and understand how the feature should work normally.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Use this item '....' (item's name from shared.lua if applicable)
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Questions (please complete the following information):

  • When you last updated: [e.g. last week]
  • Are you using custom resource? which ones? [e.g. zdiscord, qb-target]
  • Have you renamed qb- to something custom? [e.g. yes/no]

Additional context
Add any other context about the problem here.

the peds in city hall float no mater how many vectors i try

Describe the bug
the peds used in city hall float no matter how many vectors ive tried is there a fix or something that can be done to bring them back to ground lvl?

image

Expected behavior
looking for them to be on ground level

Questions (please complete the following information):

  • When you last updated: [e.g. last week]
  • Are you using custom resource? which ones? [qb-target]
  • Have you renamed qb- to something custom? [no]

Additional context
Add any other context about the problem here.

How do we get business licenses to work?

We are able to get the business license to show up in the list of Identification available , but players get kicked when trying to buy it. How do we fix this?

DMV

Is there a way to remove the default driving license and have the ability to give the license based on a dmv test? So basically a whitelist for a driving license given by the instructor?

[SUGGESTION] Cooldown when apply job

I have new idea for make it better about job cooldown

  • now when player apply job like trucker they can change job every time, then i have some idea to give cooldown hr. or minutes
    to allow player change another job again.
  • Sometimes you might don't show the job menu when they get the job and display menu again when the cooldown expires.
    hope you think about it.

Issue with trying to purchase license once revoked

Screenshot 2021-08-03 183117

Hi,

I have found an issue with when you have had your license revoked and attempt to buy another then the attached is thrown.
Also when you go to the town hall there are no prompts to allow you to request to take a driving test.
If a license is revoked how do you ask for this back and should the police actually remove this from you?

Thanks in advance.

Angie

[BUG] Relogging Breaks Job Page

Script works all good for me until I relog, when I come back and talk to the NPC, the licenses page works but the jobs page is empty (more like it's hidden) and I can only see the back button.

Players getting banned when applying for some jobs.

I updated cityhall and towjob and was going through configurating other jobs, come to get the towjob via city hall and when I click on the job I get instantly banned:

Connection rejected by server: You have been banned from the server: Abuse localhost:13172 For POST Requests Your ban expires 22/8/2021 21:12 Abuse localhost:13172 For POST Requests

I see it's this thread:

RegisterServerEvent('qb-cityhall:server:banPlayer') AddEventHandler('qb-cityhall:server:banPlayer', function() local src = source TriggerClientEvent('chatMessage', -1, "QB Anti-Cheat", "error", GetPlayerName(src).." has been banned for sending POST Request's ") exports.ghmattimysql:execute('INSERT INTO bans (name, license, discord, ip, reason, expire, bannedby) VALUES (@name, @license, @discord, @ip, @reason, @expire, @bannedby)', { ['@name'] = GetPlayerName(src), ['@license'] = QBCore.Functions.GetIdentifier(src, 'license'), ['@discord'] = QBCore.Functions.GetIdentifier(src, 'discord'), ['@ip'] = QBCore.Functions.GetIdentifier(src, 'ip'), ['@reason'] = 'Abuse localhost:13172 For POST Requests', ['@expire'] = 2145913200, ['@bannedby'] = GetPlayerName(src) }) DropPlayer(src, 'Attempting To Exploit') end)

I have no idea what is causing it?

I also removed the newsreporter job from the resources and the button was still in the HTML and it did the same thing.

[BUG] Buying Weapon License kicks players for "Attempted Exploit Abuse"

Describe the bug
As the title reads, for some reason players cannot purchase a physical copy of their weapons license from City Hall. If they try, FiveM somehow sees this as an attempted exploit and boots them from the server.

To Reproduce
Steps to reproduce the behavior:

  1. Go to city hall
  2. Click on ped who sells licenses
  3. Try to buy a weapons license
  4. Server instantly boots you with the message "Disconnected from Server, attempted exploit abuse."

Cant get the jobs to work.

The error we get:

[ script:qb-cityhall] SCRIPT ERROR: @qb-cityhall/server/main.lua:114: attempt to index a nil value (field 'Jobs')

The block of Code its referencing:
RegisterNetEvent('qb-cityhall:server:ApplyJob', function(job, cityhallCoords)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if not Player then return end
local ped = GetPlayerPed(src)
local pedCoords = GetEntityCoords(ped)
local JobInfo = QBCore.Shared.Jobs[job]
if #(pedCoords - cityhallCoords) >= 20.0 or not availableJobs[job] then
return DropPlayer(source, "Attempted exploit abuse")

We go to the guy in City Hall apply for the job doesnt matter which one. This is what happens

Buy ID and License

Is it normal that i can buy unlimited IDs and Driver Licenses, even when i already have them in my inventory ?

[BUG] Ped disappears after using /logout

Describe the bug
The CityHall ped disappears if you use /logout and then respawn.

To Reproduce
Steps to reproduce the behavior:

  1. Connect with character 1
  2. Go to City Hall - Ped will be there
  3. Use /logout
  4. Re-connect with same character
  5. Use Last location or go to City Hall
  6. ped no longer exists

Expected behavior
Ped should spawn on player connected

Screenshots
image

Questions (please complete the following information):

  • When you last updated: 9th October
  • Are you using custom resource? which ones? No
  • Have you renamed qb- to something custom? No

Additional context
Add any other context about the problem here.

No map/bug

Coordinates to DrivingSchool and DriveTest on config.lua lead to inside of some buildings without map.

Drivers license not available in city hall.

Hi,

I noticed on pictures provided in this script that there has to be an option to buy the drivers license in the cityhall. Only on the latest version you can only buy an id card.

My fault. Didnt noticed another admin took my driverlicense with the /revoke option as a cop

"help wanted" weaponlicense

Please help me, I do not understand how to get a "weaponlicense", the weapons store requires a license, I got a job as a policeman but I did not understand how to give it to the player or myself, I got a "weaponlicense" in the inventory with the "giveitem" command, but the store still asks for a license

html /app.js

I don't really understand scripts, but I'm learning, I added four jobs, everything was duplicated in the menu, I rummaged through the entire server, looked for where I did what wrong myself... I didn't find anything, finally replaced the html /app.js on the old one, everything worked fine

Driver license

Can buy a driver license without driving test And theory. Set a notification that you are not allowed to buy a driver license without permission from the driving school boss.

Citizenid is null over phone mail

With the new updates, when you ask the ped for the driving lessons it does send the mail but in the database in mails the column citizenid is null

image

and yes, in the config, i did replace the citizenid that was provided.

Hotdog job needs adding

With the updated hotdog job, it's no longer a open job, so I ended up putting, this into server main of city hall. Line9.
["hotdog"] = "Hot Dog",

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.