Update Citizen License
updateCitizenLicense(source, data)
Updates or creates a license record for a specific citizen in the system.
Parameters
source
source
Type: number
Description: The source player ID from which the request is initiated.
data
data
Type: table
Description: Contains the citizen ID and license information to be updated or inserted.
Fields within data
data
data.citizenId
data.citizenId
Type: string
Required: ✅
Description: The unique identifier for the citizen whose license record is being updated or created.
data.license
data.license
Type: table
Required: ✅
Description: Contains details of the license being created or modified.
Fields within data.license
data.license
type
string
✅
Type of license (e.g., "driver"
, "weapon"
).
name
string
✅
Name of the license.
status
string
✅
Status of the license. Accepted values: "approved"
, "rejected"
, "expired"
.
approvedBy
string
❌
Name of the person who approved the license. Defaults to the source player.
approvedDate
string
❌
Date of approval in format "YYYY-MM-DD HH:MM:SS"
. Defaults to current date.
expirationDate
string
❌
Expiry date in format "YYYY-MM-DD HH:MM:SS"
. Set only if status is "approved"
.
note
string
❌
Additional notes or comments related to the license.
Returns
Type: table
Description: Returns a response object indicating the result of the operation.
Response Fields
success
boolean
Whether the license was successfully inserted or updated.
message
string
A message describing the outcome (e.g., "License updated successfully."
).
licenses
string
(Optional) JSON-encoded string of all licenses associated with the citizen.
Example Usage
Last updated