Skip to content

dig/onset-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

onset-data

Authors: Digital

Feel free to submit pull requests, I plan on adding all class names for objects, vehicles, doors, weapons and clothing.

Features

  • Adds all weapon class names, WEAPON_COLT, WEAPON_DEAGLE, etc.
  • Adds all vehicle class names, VEHICLE_GARBAGE_TRUCK, VEHICLE_NASCAR, etc.
  • Useful functions for vehicles & weapons.
  • All names are in fictional names instead of class names like the base game is. (Pistol01 -> Deagle)

Installation

Download all files from this repository and place them inside your package in a folder called data. packages/mypackage/data/
Add the following to your client_scripts in package.json,

    "data/util.lua",
    "data/clothing.lua",
    "data/doors.lua",
    "data/objects.lua",
    "data/vehicles.lua",
    "data/weapons.lua"

Add the following to your server_scripts in package.json,

    "data/util.lua",
    "data/clothing.lua",
    "data/doors.lua",
    "data/objects.lua",
    "data/vehicles.lua",
    "data/weapons.lua"

Example

-- Display weapon WEAPON_COLT's name.
AddPlayerChat(GetWeaponName(WEAPON_COLT)) -- or GetWeaponName(5)

-- Find a weapon ID by its name.
local _myWeaponID = GetWeaponByName('Deagle')
AddPlayerChat(_myWeaponID)

Functions

GetVehicleName

Find a vehicle's name from its ID.

GetVehicleName(vehicleID)
  • vehicleID A vehicle ID. Example: 5
    Returns a string, if vehicle cannot be found then false will be returned.

GetVehicleByName

Find a vehicle ID by its name or alias.

GetVehicleByName(vehicleName)
  • vehicleName The vehicle name you are looking for. Example: Ambulance
    Returns a vehicle ID integer, if vehicle cannot be found then 0 will be returned.

GetWeaponName

Find a weapon's name from its ID.

GetWeaponName(weaponID)
  • weaponID A weapon ID. Example: 5
    Returns a string, if weapon cannot be found then false will be returned.

GetWeaponByName

Find a weapon ID by its name or alias.

GetWeaponByName(weaponName)
  • weaponName The weapon name you are looking for. Example: Deagle
    Returns a weapon ID integer, if weapon cannot be found then 0 will be returned.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages