Commands Registration


๐Ÿ“Ÿ 311a Command

Sends an anonymous 311 message to EMS personnel. This is useful for citizens to contact EMS without revealing their identity.


๐Ÿ”ง Command Registration

lib.addCommand('311a', {
    help = 'Send an anonymous message to 311',
    params = {{
        name = 'message',
        type = 'string',
        help = '311 Message'
    }}
}, function(source, args, raw)
    ...
end)

๐Ÿ“ฅ Parameters

Name
Type
Required
Description

message

string

โœ…

The message content for 311.

The message is extracted from the raw input, excluding the command prefix (311a).


โš™๏ธ Execution Logic

local fullMessage = raw:sub(5)
local jobs = {
    ems = true
}
TriggerClientEvent('kartik-mdt:client:sendCall', source, fullMessage, true, jobs, "311")

๐Ÿงพ Triggered Event

kartik-mdt:client:sendCall

Parameters:

Parameter
Type
Description

source

number

Source player ID sending the 311 call.

fullMessage

string

The actual message content (stripped from command prefix).

true

boolean

Indicates the call is anonymous.

jobs

table

Jobs to notify (ems = true).

"311"

string

The type of call. In this case, a 311 non-emergency call.


โœ… Example Usage

/311a Need medical help at Legion Square.

This sends an anonymous 311 message to EMS with the content: "Need medical help at Legion Square."


Last updated