Bug: onMessage
Development Issue
Yes
Phone Version
Last one
Issue Description
Im using this export :
exports.npwd:onMessage('911', function(ctx)
local sendernmbr = exports.npwd:getPhoneNumber(ctx.source)
local police = ESX.GetExtendedPlayers('job','police')
for i = 1, #police do
local targetnmbr = exports.npwd:getPhoneNumber(police[i].playerId)
exports.npwd:emitMessage({
senderNumber = sendernmbr,
targetNumber = targetnmbr,
message = ctx.data.message,
})
end
end)

direct after receive this message in my phone i got this error :

Issue Reproduction
apply the export you will see
Evidence
No response
this error still going if i press on the empty message
can you provide a framework agnostic reproduction since none of our developers are using ESX
Im using the legacy one, https://github.com/esx-framework/esx-legacy
Try exports.npwd:getPhoneNumber(police[i].source)
I will try it today.
I see an other bug, I'm using ESX legacy like I told you and ox inventory , I have everything set up good.
But if I'm connect and I don't have the phone I can receive notifications from my phone when someone call. I can't answer.
@frazz1234 did chips change fix the error?
Hello, Ive already wrote something on PE discord, but I wanted to make it official here too: Thats my snippet and I know the error. The problem here is, that if you are police yourself you are receiving the message you send to the police yourself. So if you are texting a message to 911 not only will the message appear in the 911 chat, but you will send YOURSELF a message with that. Clicking on one of the empty chats will show you this error, since npwd isnt able to create a message-conversation with yourself.
For everyone in need of that snippet, because they want a possibility for the police to get messages rp-wise Id recommend to take a look at Mojitos npwd-dispatch script, which utilizes exactly that, just way better and smarter.