functions.lua

🛠 Debugging & Utility Functions

Debug Print

DebugPrint(file, msg)
  • Description: Prints a debug message if debugging is enabled.

  • Arguments:

    • file (string) – The file name where the debug was triggered.

    • msg (string) – The message to display.

Get Vehicle Image

GetVehicleIMG(model)
  • Description: Retrieves a vehicle image URL based on the model. To get more info about vehicle images check out this

  • Arguments:

    • model (string) – The spawn code of the vehicle.

  • Returns: (string) The URL to the vehicle’s image.

Is Admin

IsAdmin(source)
  • Description: Checks if a player has admin permissions.

  • Arguments:

    • source (number) – The player’s source ID.

  • Returns: (boolean) true if the player is an admin, otherwise false.

Server Notify

ServerNotify(source, msg, type, time, title)
  • Description: Sends a server notification to a player.

  • Arguments:

    • source (number) – The target player.

    • msg (string) – The notification message.

    • type (string, optional) – Notification type (default: info).

    • time (number, optional) – Duration in milliseconds (default: 5000ms).

    • title (string, optional) – Notification title.


🚗 Garage & Vehicle Handling

Get Society Garage

GetSocietyGarage(job)
  • Description: Determines the default garage for a given job.

  • Arguments:

    • job (string) – The job name.

  • Returns: (string) The name of the society garage.

Get Impound By Type

GetImpoundByType(vehicleType)
  • Description: Determines the appropriate impound lot for a given vehicle type.

  • Arguments:

    • vehicleType (string) – The type of vehicle.

  • Returns: (string) The impound lot name.

Delivery Check

DeliveryCheck(source, plate, deliveryTime, entity)
  • Description: Checks if a vehicle contains illegal items before delivery.

  • Arguments:

    • source (number) – The player’s source ID.

    • plate (string) – The vehicle plate.

    • deliveryTime (number) – Delivery time in milliseconds.

    • entity (entity ID, optional) – The vehicle entity.

  • Returns: (boolean) true if delivery is allowed, otherwise false.

Took Vehicle Out

TookVehicleOut(source, plate, vehType, model, vehicleProps, owner, impound)
  • Description: Handles vehicle retrieval (for societies and personal vehicles).

  • Arguments:

    • source (number) – The player’s source ID.

    • plate (string) – The vehicle plate.

    • vehType (string) – The vehicle type.

    • model (string) – The vehicle model.

    • vehicleProps (table) – The vehicle’s properties.

    • owner (string) – Values: personal or society.

    • impound (boolean) – Whether the vehicle was impounded.

  • Returns: None.

Parked Vehicle

ParkedVehicle(source, plate, vehType, model, vehicleProps, owner)
  • Description: Handles vehicle parking.

  • Arguments:

    • source (number) – The player’s source ID.

    • plate (string) – The vehicle plate.

    • vehType (string) – The vehicle type.

    • model (string) – The vehicle model.

    • vehicleProps (table) – The vehicle’s properties.

    • owner (string) – The vehicle owner.

  • Returns: None.

On Plate Change

OnPlateChange(identifier, oldPlate, newPlate)
  • Description: Updates the vehicle’s plate in the database.

  • Arguments:

    • identifier (string) – The owner’s identifier.

    • oldPlate (string) – The old plate number.

    • newPlate (string) – The new plate number.

  • Returns: None.


👨‍💼 Permissions & Command Access

Is Boss

IsBoss(source)
  • Description: Checks if a player is a boss in their job.

  • Arguments:

    • source (number) – The player’s source ID.

  • Returns: (boolean) true if the player is a boss, otherwise false.

Can Transfer Vehicle

CanTransferVehicle(source, targetId, ownerIdentifier, targetIdentifier, plate, name, price)
  • Description: Determines if a vehicle can be transferred.

  • Arguments:

    • source (number) – The player’s source ID.

    • targetId (number) – The target player’s source ID.

    • ownerIdentifier (string) – The current owner’s identifier.

    • targetIdentifier (string) – The new owner’s identifier.

    • plate (string) – The vehicle plate.

    • name (string) – The vehicle’s name.

    • price (number) – The sale price.

  • Returns: (boolean) true if transfer is allowed.

Can Run Command

CanRunCommand(source, accessingCommand)
  • Description: Checks if a player can run a specific command.

  • Arguments:

    • source (number) – The player’s source ID.

    • accessingCommand (string) – The command type (vehicleMenu, giveKeys, deleteKeys, vehicleAdd, vehicleRemove).

  • Returns: (boolean) true if the command can be executed.

Last updated