Redutzu's Scripts
  • â„šī¸Information
  • 🛒Store
  • đŸ’ģDiscord
  • 📚Resources
    • Redutzu MDT
      • Installation
      • Guides
        • Frameworks
        • Items
        • Localization
        • Images
        • Logs
        • Permissions
        • Bodycam
      • Exports/Events
        • Server Events
          • addDispatchToMDT
        • Server Exports
          • Incidents
          • Evidences
          • Warrants
          • Bolos
          • Citizens
          • Vehicles
          • Codes
          • Charges
          • Weapons
          • Announcements
          • Tags
        • Client Events
          • Open/Close MDT
        • Client Exports
      • Common Issues
    • Redutzu EMS
      • Installation
      • Guides
      • Exports
    • Redutzu Documents
      • Installation
      • Guides
      • Exports
Powered by GitBook
On this page
  • Type
  • Exports
  • Search for an incident
  • Create an incident
  • Update an incident
  • Delete an incident

Was this helpful?

  1. Resources
  2. Redutzu MDT
  3. Exports/Events
  4. Server Exports

Incidents

Here, you'll find key exports for managing incidents. These exports allow you to create, update, and delete incidents as needed.


Type

type Incident = {
    id: number,
    name: string,
    description: string, // stringified JSON
    vehicles: string[],
    evidences: number[],
    players: {
        identifier: string,
        name: string
    }[],
    victims: {
        identifier: string,
        name: string
    }[],
    cops: {
        identifier: string,
        name: string
    }[],
    charges: {
        list: { id: number, name: string }[],
        reduction: {
            fine: 50,
            jail: 70
        },
        amount: {
            fine: 15000,
            jail: 60
        }
    },
    createdAt: string
}

Exports

Search for an incident

-- It returns the incident data
exports['redutzu-mdt']:SearchIncident(id)
local incident = exports['redutzu-mdt']:SearchIncident(1)
print(incident.name)

Create an incident

-- It returns the id of the created incident
exports['redutzu-mdt']:CreateIncident(data, sender)
RegisterCommand('createIncident', function(source)
    exports['redutzu-mdt']:CreateIncident({
        name = 'Incident Name',
        description = '[]',
        players = { 'identifier' },
        victims = { 'identifier' },
        cops = { 'identifier' },
        vehicles = { 'plate' },
        evidences = { 1, 5 },
        charges = {
            list = { 2, 4, 8 },
            amount = { fine = 15000, jail = 50 },
            reduction = { fine = 35, jail = 80 }
        }
    }, source)
end, false)

Update an incident

-- It returns a boolean (if it was successfully updated)
exports['redutzu-mdt']:UpdateIncident(id, data)
local success = exports['redutzu-mdt']:UpdateIncident(1, {
    name = 'Updated Incident',
    vehicles = { 'XYZ987' }
})

if not success then
    print('There was an error updating the incident')
    return
end

print('Incident updated')

Delete an incident

-- It returns a boolean (if it was successfully deleted)
exports['redutzu-mdt']:DeleteIncident(id)
local success = exports['redutzu-mdt']:DeleteIncident(1)

if not success then
    print('There was an error deleting the incident')
    return
end

print('Incident deleted')
PreviousServer ExportsNextEvidences

Last updated 11 months ago

Was this helpful?

📚