Please note that most common errors can be caused by a bad installation or a poorly done update, always verify this using the default asset before communicating your problem to us, this will save time.
If you've made it this far, congratulations, you're one of the few customers reading through the documentation and taking an interest in fixing problems that come your way using our resources.
This section is intended for the common problems that some players usually have when using this asset, we ask you to check one by one to find your problem here and save long waits on community tickets. If your problem still persists, do not hesitate to contact us from the Discord community by opening a ticket.
List of common problems
Deploy each section according to your problem, so you will find the solution quickly, each problem has a general and basic solution in its description that will help you solve the case.
I get spam alerts when a dispatch call is executed
The problem occurs when calling the client function 'ramdomscript:client:fight' from the server code, setting the value to -1. This causes an alert to be generated for each player on the server.
RegisterCommand('test', function ()TriggerClientEvent('ramdomscript:client:fight', -1)end)
Or
RegisterCommand('test', function(source,args,rawCommand)local xPlayers = ESX.GetExtendedPlayers() -- Devuelve todos los xPlayersfor _, xPlayer inpairs(xPlayers) doif player.job.name =='police' then-- Envía el evento A TODOS LOS POLICÍAS CONECTADOSTriggerClientEvent('ramdomscript:client:fight', xPlayer.source)endendend, false)
The solution to the problem:
The solution is to assign the correct values to the function. Instead of using TriggerClientEvent('qs-dispatch:client:fight', -1), we should use 'source' instead.
RegisterCommand('test', function (source,args,rawCommand)TriggerClientEvent('qs-dispatch:client:fight', source)end)
In short, the solution ensures that the event is sent only to the player who initiated it ('source'), thus avoiding issuing alerts to all players on the server. Additionally, some bugs in the code, such as incorrect use of variables, were fixed and readability was improved.
Data overflow (qs-dispatch:blips:updateAll)
If you have problems with this event qs-dispatch:blips:updateAll and you get out of your server, is that you are using the default configuration of Config.PlayerLocationTick, so this is equal to 5 seconds, this means that you are running the event of the blips every 5 seconds per player, a solution to this is to increase the value, to prevent repeating this event as often as possible.
Config.PlayerLocationTick =5-- Change to 15 for example
Open job menu key sends a dispatch call
Go to client/custom/misc/commands.lua and replace the commands name, and restart the server.
TriggerEvent('chat:addSuggestion', '/police', 'Call to Police Services', { { name ='message', help ='Message to send to police' },})RegisterCommand("police", function(source,args,rawCommand)-- Rest of the call codeend, false)
The modified code is:
-- The change was in the /police commandTriggerEvent('chat:addSuggestion', '/policecall', 'Call to Police Services', { { name ='message', help ='Message to send to police' },})RegisterCommand("policecall", function(source,args,rawCommand)-- Rest of the call codeend, false)