Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/911p errors when using multiple args in command #150

Closed
LordChunk opened this issue Jan 2, 2025 · 1 comment · Fixed by #153
Closed

/911p errors when using multiple args in command #150

LordChunk opened this issue Jan 2, 2025 · 1 comment · Fixed by #153
Labels
bug Something isn't working need repro This bug report needs confirmation

Comments

@LordChunk
Copy link

LordChunk commented Jan 2, 2025

Summary

/911p errors when using multiple args in command

Reproduction

  1. Set player job to police (to receive alerts)
  2. Type /911p hello I need help
  3. Error visible in console or chat
    image
[   1291391] [b3258_GTAProce]             MainThrd/ ^1command '911p' failed to execute!
[   1291391] [b3258_GTAProce]             MainThrd/ @qbx_policejob/server/commands.lua:392: invalid value (nil) at index 1 in table for 'concat'

Expected behavior

Alert should be forwarded to police

Actual behavior

An error is thrown when concatenating all the args from the command.

Additional context

qbx ambulance has a similar issue: Qbox-project/qbx_ambulancejob#149

Current Version

Commit hash 2d717ba81c0aad56ed2134e9382aa355c9511c5c

Custom Resources

ox_lib v3.27.0

@LordChunk LordChunk added bug Something isn't working need repro This bug report needs confirmation labels Jan 2, 2025
@qbox-duck qbox-duck bot added this to Issues Jan 2, 2025
@github-project-automation github-project-automation bot moved this to Todo in Issues Jan 2, 2025
@LordChunk
Copy link
Author

LordChunk commented Jan 2, 2025

ps-dispatch handles their commands like this. Looks like it could work for qbox as well?

lib.addCommand('311', {
    help = 'Send a message to 311',
    params = { { name = 'message', type = 'string', help = '311 Message' }},
}, function(source, args, raw)
    local fullMessage = raw:sub(5)
    TriggerClientEvent('ps-dispatch:client:sendEmergencyMsg', source, fullMessage, "311", false)
end)

@Ehbw Ehbw closed this as completed in #153 Jan 11, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in Issues Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need repro This bug report needs confirmation
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant