Kartik Scripts

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

NameTypeRequiredDescription
messagestringโœ…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:

ParameterTypeDescription
sourcenumberSource player ID sending the 311 call.
fullMessagestringThe actual message content (stripped from command prefix).
truebooleanIndicates the call is anonymous.
jobstableJobs to notify (ems = true).
"311"stringThe 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:
&#xNAN;"Need medical help at Legion Square."


On this page