Authors: Digital
Feel free to submit pull requests, I plan on adding all class names for objects, vehicles, doors, weapons and clothing.
- 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)
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"
-- 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)
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.
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.
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.
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.