Upload shared files

This commit is contained in:
Kakarot
2025-03-11 23:06:37 -05:00
parent 7800abdca0
commit 2e67cf644b
11 changed files with 13883 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
{
"General": {
"cash": {
"amount": 500,
"allowminus": false,
"minuslimit": -5000
},
"bank": {
"amount": 5000,
"allowminus": false,
"minuslimit": -50000
},
"crypto": {
"amount": 0,
"allowminus": false,
"minuslimit": -5000
},
"DefaultSpawn": { "x": -1035.71, "y": -2731.87, "z": 12.86, "h": 0.0 },
"UpdateInterval": 5,
"StatusInterval": 5000,
"ForceJobDefaultDutyAtLogin": true,
"HungerRate": 4.2,
"ThirstRate": 3.8,
"PayCheckTimeOut": 10,
"PayCheckSociety": false,
"Bloodtypes": ["A+", "A-", "B+", "B-", "AB+", "AB-", "O+", "O-"],
"items": [
{ "item": "driver_license", "amount": 1 },
{ "item": "id_card", "amount": 1 },
{ "item": "phone", "amount": 1 }
]
},
"Server": {
"Closed": false,
"ClosedReason": "Server Closed",
"Uptime": 0,
"Whitelist": false,
"WhitelistPermission": "admin",
"PVP": true,
"Discord": "",
"CheckDuplicateLicense": true,
"Permissions": ["god", "admin", "mod"]
}
}
+118
View File
@@ -0,0 +1,118 @@
{
"none": {
"label": "No Gang",
"grades": [
{
"name": "Unaffiliated"
}
]
},
"lostmc": {
"label": "The Lost MC",
"grades": [
{
"name": "Recruit"
},
{
"name": "Enforcer"
},
{
"name": "Shot Caller"
},
{
"name": "Boss",
"isboss": true
}
]
},
"ballas": {
"label": "Ballas",
"grades": [
{
"name": "Recruit"
},
{
"name": "Enforcer"
},
{
"name": "Shot Caller"
},
{
"name": "Boss",
"isboss": true
}
]
},
"vagos": {
"label": "Vagos",
"grades": [
{
"name": "Recruit"
},
{
"name": "Enforcer"
},
{
"name": "Shot Caller"
},
{
"name": "Boss",
"isboss": true
}
]
},
"cartel": {
"label": "Cartel",
"grades": [
{
"name": "Recruit"
},
{
"name": "Enforcer"
},
{
"name": "Shot Caller"
},
{
"name": "Boss",
"isboss": true
}
]
},
"families": {
"label": "Families",
"grades": [
{
"name": "Recruit"
},
{
"name": "Enforcer"
},
{
"name": "Shot Caller"
},
{
"name": "Boss",
"isboss": true
}
]
},
"triads": {
"label": "Triads",
"grades": [
{
"name": "Recruit"
},
{
"name": "Enforcer"
},
{
"name": "Shot Caller"
},
{
"name": "Boss",
"isboss": true
}
]
}
}
File diff suppressed because it is too large Load Diff
+399
View File
@@ -0,0 +1,399 @@
{
"unemployed": {
"label": "Civilian",
"defaultDuty": true,
"offDutyPay": false,
"grades": [
{
"name": "Freelancer",
"payment": 10
}
]
},
"bus": {
"label": "Bus",
"defaultDuty": true,
"offDutyPay": false,
"grades": [
{
"name": "Driver",
"payment": 50
}
]
},
"judge": {
"label": "Honorary",
"defaultDuty": true,
"offDutyPay": false,
"grades": [
{
"name": "Judge",
"payment": 100
}
]
},
"lawyer": {
"label": "Law Firm",
"defaultDuty": true,
"offDutyPay": false,
"grades": [
{
"name": "Associate",
"payment": 50
}
]
},
"reporter": {
"label": "Reporter",
"defaultDuty": true,
"offDutyPay": false,
"grades": [
{
"name": "Journalist",
"payment": 50
}
]
},
"trucker": {
"label": "Trucker",
"defaultDuty": true,
"offDutyPay": false,
"grades": [
{
"name": "Driver",
"payment": 50
}
]
},
"tow": {
"label": "Towing",
"defaultDuty": true,
"offDutyPay": false,
"grades": [
{
"name": "Driver",
"payment": 50
}
]
},
"garbage": {
"label": "Garbage",
"defaultDuty": true,
"offDutyPay": false,
"grades": [
{
"name": "Collector",
"payment": 50
}
]
},
"vineyard": {
"label": "Vineyard",
"defaultDuty": true,
"offDutyPay": false,
"grades": [
{
"name": "Picker",
"payment": 50
}
]
},
"hotdog": {
"label": "Hotdog",
"defaultDuty": true,
"offDutyPay": false,
"grades": [
{
"name": "Sales",
"payment": 50
}
]
},
"police": {
"label": "Law Enforcement",
"type": "leo",
"defaultDuty": true,
"offDutyPay": false,
"grades": [
{
"name": "Recruit",
"payment": 50
},
{
"name": "Officer",
"payment": 75
},
{
"name": "Sergeant",
"payment": 100
},
{
"name": "Lieutenant",
"payment": 125
},
{
"name": "Chief",
"isboss": true,
"payment": 150
}
]
},
"ambulance": {
"label": "EMS",
"type": "ems",
"defaultDuty": true,
"offDutyPay": false,
"grades": [
{
"name": "Recruit",
"payment": 50
},
{
"name": "Paramedic",
"payment": 75
},
{
"name": "Doctor",
"payment": 100
},
{
"name": "Surgeon",
"payment": 125
},
{
"name": "Chief",
"isboss": true,
"payment": 150
}
]
},
"realestate": {
"label": "Real Estate",
"defaultDuty": true,
"offDutyPay": false,
"grades": [
{
"name": "Recruit",
"payment": 50
},
{
"name": "House Sales",
"payment": 75
},
{
"name": "Business Sales",
"payment": 100
},
{
"name": "Broker",
"payment": 125
},
{
"name": "Manager",
"isboss": true,
"payment": 150
}
]
},
"taxi": {
"label": "Taxi",
"defaultDuty": true,
"offDutyPay": false,
"grades": [
{
"name": "Recruit",
"payment": 50
},
{
"name": "Driver",
"payment": 75
},
{
"name": "Event Driver",
"payment": 100
},
{
"name": "Sales",
"payment": 125
},
{
"name": "Manager",
"isboss": true,
"payment": 150
}
]
},
"cardealer": {
"label": "Vehicle Dealer",
"defaultDuty": true,
"offDutyPay": false,
"grades": [
{
"name": "Recruit",
"payment": 50
},
{
"name": "Showroom Sales",
"payment": 75
},
{
"name": "Business Sales",
"payment": 100
},
{
"name": "Finance",
"payment": 125
},
{
"name": "Manager",
"isboss": true,
"payment": 150
}
]
},
"mechanic": {
"label": "LS Customs",
"type": "mechanic",
"defaultDuty": true,
"offDutyPay": false,
"grades": [
{
"name": "Recruit",
"payment": 50
},
{
"name": "Novice",
"payment": 75
},
{
"name": "Experienced",
"payment": 100
},
{
"name": "Advanced",
"payment": 125
},
{
"name": "Manager",
"isboss": true,
"payment": 150
}
]
},
"mechanic2": {
"label": "LS Customs",
"type": "mechanic",
"defaultDuty": true,
"offDutyPay": false,
"grades": [
{
"name": "Recruit",
"payment": 50
},
{
"name": "Novice",
"payment": 75
},
{
"name": "Experienced",
"payment": 100
},
{
"name": "Advanced",
"payment": 125
},
{
"name": "Manager",
"isboss": true,
"payment": 150
}
]
},
"mechanic3": {
"label": "LS Customs",
"type": "mechanic",
"defaultDuty": true,
"offDutyPay": false,
"grades": [
{
"name": "Recruit",
"payment": 50
},
{
"name": "Novice",
"payment": 75
},
{
"name": "Experienced",
"payment": 100
},
{
"name": "Advanced",
"payment": 125
},
{
"name": "Manager",
"isboss": true,
"payment": 150
}
]
},
"beeker": {
"label": "Beeker's Garage",
"type": "mechanic",
"defaultDuty": true,
"offDutyPay": false,
"grades": [
{
"name": "Recruit",
"payment": 50
},
{
"name": "Novice",
"payment": 75
},
{
"name": "Experienced",
"payment": 100
},
{
"name": "Advanced",
"payment": 125
},
{
"name": "Manager",
"isboss": true,
"payment": 150
}
]
},
"bennys": {
"label": "Benny's Original Motor Works",
"type": "mechanic",
"defaultDuty": true,
"offDutyPay": false,
"grades": [
{
"name": "Recruit",
"payment": 50
},
{
"name": "Novice",
"payment": 75
},
{
"name": "Experienced",
"payment": 100
},
{
"name": "Advanced",
"payment": 125
},
{
"name": "Manager",
"isboss": true,
"payment": 150
}
]
}
}
+90
View File
@@ -0,0 +1,90 @@
{
"citizenid": null,
"cid": 1,
"money": {
"cash": 500,
"bank": 5000,
"crypto": 0
},
"optin": true,
"charinfo": {
"firstname": "Firstname",
"lastname": "Lastname",
"birthdate": "00-00-0000",
"gender": 0,
"nationality": "USA",
"phone": null,
"account": null
},
"job": {
"name": "unemployed",
"label": "Civilian",
"payment": 10,
"type": "none",
"onduty": false,
"isboss": false,
"grade": {
"name": "Freelancer",
"level": 1,
"payment": 10,
"isboss": false
}
},
"gang": {
"name": "none",
"label": "No Gang Affiliation",
"isboss": false,
"grade": {
"name": "none",
"level": 1,
"isboss": false
}
},
"metadata": {
"hunger": 100,
"thirst": 100,
"stress": 0,
"isdead": false,
"inlaststand": false,
"armor": 0,
"ishandcuffed": false,
"tracker": false,
"injail": 0,
"jailitems": [],
"status": {},
"phone": {},
"rep": {},
"currentapartment": null,
"callsign": "NO CALLSIGN",
"bloodtype": null,
"fingerprint": null,
"walletid": null,
"criminalrecord": {
"hasRecord": false,
"date": null
},
"licences": {
"driver": true,
"business": false,
"weapon": false
},
"inside": {
"house": null,
"apartment": {
"apartmentType": null,
"apartmentId": null
}
},
"phonedata": {
"SerialNumber": null,
"InstalledApps": []
}
},
"position": {
"x": 1000,
"y": 1000,
"z": 1000,
"h": 1000
},
"items": []
}
File diff suppressed because it is too large Load Diff
+884
View File
@@ -0,0 +1,884 @@
[
{
"name": "weapon_unarmed",
"label": "Fists",
"weapontype": "Melee",
"ammotype": null,
"damagereason": "Melee killed / Whacked / Executed / Beat down / Murdered / Battered"
},
{
"name": "weapon_dagger",
"label": "Dagger",
"weapontype": "Melee",
"ammotype": null,
"damagereason": "Knifed / Stabbed / Eviscerated"
},
{
"name": "weapon_bat",
"label": "Bat",
"weapontype": "Melee",
"ammotype": null,
"damagereason": "Melee killed / Whacked / Executed / Beat down / Murdered / Battered"
},
{
"name": "weapon_bottle",
"label": "Broken Bottle",
"weapontype": "Melee",
"ammotype": null,
"damagereason": "Knifed / Stabbed / Eviscerated"
},
{
"name": "weapon_crowbar",
"label": "Crowbar",
"weapontype": "Melee",
"ammotype": null,
"damagereason": "Melee killed / Whacked / Executed / Beat down / Murdered / Battered"
},
{
"name": "weapon_flashlight",
"label": "Flashlight",
"weapontype": "Melee",
"ammotype": null,
"damagereason": "Melee killed / Whacked / Executed / Beat down / Murdered / Battered"
},
{
"name": "weapon_golfclub",
"label": "Golfclub",
"weapontype": "Melee",
"ammotype": null,
"damagereason": "Melee killed / Whacked / Executed / Beat down / Murdered / Battered"
},
{
"name": "weapon_hammer",
"label": "Hammer",
"weapontype": "Melee",
"ammotype": null,
"damagereason": "Melee killed / Whacked / Executed / Beat down / Murdered / Battered"
},
{
"name": "weapon_hatchet",
"label": "Hatchet",
"weapontype": "Melee",
"ammotype": null,
"damagereason": "Knifed / Stabbed / Eviscerated"
},
{
"name": "weapon_knuckle",
"label": "Knuckle",
"weapontype": "Melee",
"ammotype": null,
"damagereason": "Melee killed / Whacked / Executed / Beat down / Murdered / Battered"
},
{
"name": "weapon_knife",
"label": "Knife",
"weapontype": "Melee",
"ammotype": null,
"damagereason": "Knifed / Stabbed / Eviscerated"
},
{
"name": "weapon_machete",
"label": "Machete",
"weapontype": "Melee",
"ammotype": null,
"damagereason": "Knifed / Stabbed / Eviscerated"
},
{
"name": "weapon_switchblade",
"label": "Switchblade",
"weapontype": "Melee",
"ammotype": null,
"damagereason": "Knifed / Stabbed / Eviscerated"
},
{
"name": "weapon_nightstick",
"label": "Nightstick",
"weapontype": "Melee",
"ammotype": null,
"damagereason": "Melee killed / Whacked / Executed / Beat down / Murdered / Battered"
},
{
"name": "weapon_wrench",
"label": "Wrench",
"weapontype": "Melee",
"ammotype": null,
"damagereason": "Melee killed / Whacked / Executed / Beat down / Murdered / Battered"
},
{
"name": "weapon_battleaxe",
"label": "Battle Axe",
"weapontype": "Melee",
"ammotype": null,
"damagereason": "Knifed / Stabbed / Eviscerated"
},
{
"name": "weapon_poolcue",
"label": "Poolcue",
"weapontype": "Melee",
"ammotype": null,
"damagereason": "Melee killed / Whacked / Executed / Beat down / Murdered / Battered"
},
{
"name": "weapon_briefcase",
"label": "Briefcase",
"weapontype": "Melee",
"ammotype": null,
"damagereason": "Melee killed / Whacked / Executed / Beat down / Murdered / Battered"
},
{
"name": "weapon_briefcase_02",
"label": "Briefcase",
"weapontype": "Melee",
"ammotype": null,
"damagereason": "Melee killed / Whacked / Executed / Beat down / Murdered / Battered"
},
{
"name": "weapon_garbagebag",
"label": "Garbage Bag",
"weapontype": "Melee",
"ammotype": null,
"damagereason": "Melee killed / Whacked / Executed / Beat down / Murdered / Battered"
},
{
"name": "weapon_handcuffs",
"label": "Handcuffs",
"weapontype": "Melee",
"ammotype": null,
"damagereason": "Melee killed / Whacked / Executed / Beat down / Murdered / Battered"
},
{
"name": "weapon_bread",
"label": "Baquette",
"weapontype": "Melee",
"ammotype": null,
"damagereason": "Melee killed / Whacked / Executed / Beat down / Murdered / Battered"
},
{
"name": "weapon_stone_hatchet",
"label": "Stone Hatchet",
"weapontype": "Melee",
"ammotype": null,
"damagereason": "Knifed / Stabbed / Eviscerated"
},
{
"name": "weapon_candycane",
"label": "Candy Cane",
"weapontype": "Melee",
"ammotype": null,
"damagereason": "Melee Killed / Whacked / Executed / Beat down / Musrdered / Battered / Candy Caned"
},
{
"name": "weapon_pistol",
"label": "Pistol",
"weapontype": "Pistol",
"ammotype": "AMMO_PISTOL",
"damagereason": "Pistoled / Blasted / Plugged / Bust a cap in"
},
{
"name": "weapon_pistol_mk2",
"label": "Pistol Mk2",
"weapontype": "Pistol",
"ammotype": "AMMO_PISTOL",
"damagereason": "Pistoled / Blasted / Plugged / Bust a cap in"
},
{
"name": "weapon_combatpistol",
"label": "Combat Pistol",
"weapontype": "Pistol",
"ammotype": "AMMO_PISTOL",
"damagereason": "Pistoled / Blasted / Plugged / Bust a cap in"
},
{
"name": "weapon_appistol",
"label": "AP Pistol",
"weapontype": "Pistol",
"ammotype": "AMMO_PISTOL",
"damagereason": "Pistoled / Blasted / Plugged / Bust a cap in"
},
{
"name": "weapon_stungun",
"label": "Taser",
"weapontype": "Pistol",
"ammotype": "AMMO_STUNGUN",
"damagereason": "Died"
},
{
"name": "weapon_pistol50",
"label": "Pistol .50 Cal",
"weapontype": "Pistol",
"ammotype": "AMMO_PISTOL",
"damagereason": "Pistoled / Blasted / Plugged / Bust a cap in"
},
{
"name": "weapon_snspistol",
"label": "SNS Pistol",
"weapontype": "Pistol",
"ammotype": "AMMO_PISTOL",
"damagereason": "Pistoled / Blasted / Plugged / Bust a cap in"
},
{
"name": "weapon_snspistol_mk2",
"label": "SNS Pistol MK2",
"weapontype": "Pistol",
"ammotype": "AMMO_PISTOL",
"damagereason": "Pistoled / Blasted / Plugged / Bust a cap in"
},
{
"name": "weapon_heavypistol",
"label": "Heavy Pistol",
"weapontype": "Pistol",
"ammotype": "AMMO_PISTOL",
"damagereason": "Pistoled / Blasted / Plugged / Bust a cap in"
},
{
"name": "weapon_vintagepistol",
"label": "Vintage Pistol",
"weapontype": "Pistol",
"ammotype": "AMMO_PISTOL",
"damagereason": "Pistoled / Blasted / Plugged / Bust a cap in"
},
{
"name": "weapon_flaregun",
"label": "Flare Gun",
"weapontype": "Pistol",
"ammotype": "AMMO_FLARE",
"damagereason": "Died"
},
{
"name": "weapon_marksmanpistol",
"label": "Marksman Pistol",
"weapontype": "Pistol",
"ammotype": "AMMO_PISTOL",
"damagereason": "Pistoled / Blasted / Plugged / Bust a cap in"
},
{
"name": "weapon_revolver",
"label": "Revolver",
"weapontype": "Pistol",
"ammotype": "AMMO_PISTOL",
"damagereason": "Pistoled / Blasted / Plugged / Bust a cap in"
},
{
"name": "weapon_revolver_mk2",
"label": "Revolver MK2",
"weapontype": "Pistol",
"ammotype": "AMMO_PISTOL",
"damagereason": "Pistoled / Blasted / Plugged / Bust a cap in"
},
{
"name": "weapon_doubleaction",
"label": "Double Action Revolver",
"weapontype": "Pistol",
"ammotype": "AMMO_PISTOL",
"damagereason": "Pistoled / Blasted / Plugged / Bust a cap in"
},
{
"name": "weapon_raypistol",
"label": "Ray Pistol",
"weapontype": "Pistol",
"ammotype": "AMMO_PISTOL",
"damagereason": "Pistoled / Blasted / Plugged / Bust a cap in"
},
{
"name": "weapon_ceramicpistol",
"label": "Ceramic Pistol",
"weapontype": "Pistol",
"ammotype": "AMMO_PISTOL",
"damagereason": "Pistoled / Blasted / Plugged / Bust a cap in"
},
{
"name": "weapon_navyrevolver",
"label": "Navy Revolver",
"weapontype": "Pistol",
"ammotype": "AMMO_PISTOL",
"damagereason": "Pistoled / Blasted / Plugged / Bust a cap in"
},
{
"name": "weapon_gadgetpistol",
"label": "Gadget Pistol",
"weapontype": "Pistol",
"ammotype": "AMMO_PISTOL",
"damagereason": "Pistoled / Blasted / Plugged / Bust a cap in"
},
{
"name": "weapon_stungun_mp",
"label": "Taser",
"weapontype": "Pistol",
"ammotype": "AMMO_STUNGUN",
"damagereason": "Died"
},
{
"name": "weapon_pistolxm3",
"label": "Pistol XM3",
"weapontype": "Pistol",
"ammotype": "AMMO_PISTOL",
"damagereason": "Pistoled / Blasted / Plaugged / Bust a cap in"
},
{
"name": "weapon_microsmg",
"label": "Micro SMG",
"weapontype": "Submachine Gun",
"ammotype": "AMMO_SMG",
"damagereason": "Riddled / Drilled / Finished / Submachine Gunned"
},
{
"name": "weapon_smg",
"label": "SMG",
"weapontype": "Submachine Gun",
"ammotype": "AMMO_SMG",
"damagereason": "Riddled / Drilled / Finished / Submachine Gunned"
},
{
"name": "weapon_smg_mk2",
"label": "SMG MK2",
"weapontype": "Submachine Gun",
"ammotype": "AMMO_SMG",
"damagereason": "Riddled / Drilled / Finished / Submachine Gunned"
},
{
"name": "weapon_assaultsmg",
"label": "Assault SMG",
"weapontype": "Submachine Gun",
"ammotype": "AMMO_SMG",
"damagereason": "Riddled / Drilled / Finished / Submachine Gunned"
},
{
"name": "weapon_combatpdw",
"label": "Combat PDW",
"weapontype": "Submachine Gun",
"ammotype": "AMMO_SMG",
"damagereason": "Riddled / Drilled / Finished / Submachine Gunned"
},
{
"name": "weapon_machinepistol",
"label": "Tec-9",
"weapontype": "Submachine Gun",
"ammotype": "AMMO_PISTOL",
"damagereason": "Riddled / Drilled / Finished / Submachine Gunned"
},
{
"name": "weapon_minismg",
"label": "Mini SMG",
"weapontype": "Submachine Gun",
"ammotype": "AMMO_SMG",
"damagereason": "Riddled / Drilled / Finished / Submachine Gunned"
},
{
"name": "weapon_raycarbine",
"label": "Raycarbine",
"weapontype": "Submachine Gun",
"ammotype": "AMMO_SMG",
"damagereason": "Riddled / Drilled / Finished / Submachine Gunned"
},
{
"name": "weapon_pumpshotgun",
"label": "Pump Shotgun",
"weapontype": "Shotgun",
"ammotype": "AMMO_SHOTGUN",
"damagereason": "Devastated / Pulverized / Shotgunned"
},
{
"name": "weapon_pumpshotgun_mk2",
"label": "Pump Shotgun MK2",
"weapontype": "Shotgun",
"ammotype": "AMMO_SHOTGUN",
"damagereason": "Devastated / Pulverized / Shotgunned"
},
{
"name": "weapon_sawnoffshotgun",
"label": "Sawn-off Shotgun",
"weapontype": "Shotgun",
"ammotype": "AMMO_SHOTGUN",
"damagereason": "Devastated / Pulverized / Shotgunned"
},
{
"name": "weapon_assaultshotgun",
"label": "Assault Shotgun",
"weapontype": "Shotgun",
"ammotype": "AMMO_SHOTGUN",
"damagereason": "Devastated / Pulverized / Shotgunned"
},
{
"name": "weapon_bullpupshotgun",
"label": "Bullpup Shotgun",
"weapontype": "Shotgun",
"ammotype": "AMMO_SHOTGUN",
"damagereason": "Devastated / Pulverized / Shotgunned"
},
{
"name": "weapon_musket",
"label": "Musket",
"weapontype": "Shotgun",
"ammotype": "AMMO_SHOTGUN",
"damagereason": "Devastated / Pulverized / Shotgunned"
},
{
"name": "weapon_heavyshotgun",
"label": "Heavy Shotgun",
"weapontype": "Shotgun",
"ammotype": "AMMO_SHOTGUN",
"damagereason": "Devastated / Pulverized / Shotgunned"
},
{
"name": "weapon_dbshotgun",
"label": "Double-barrel Shotgun",
"weapontype": "Shotgun",
"ammotype": "AMMO_SHOTGUN",
"damagereason": "Devastated / Pulverized / Shotgunned"
},
{
"name": "weapon_autoshotgun",
"label": "Auto Shotgun",
"weapontype": "Shotgun",
"ammotype": "AMMO_SHOTGUN",
"damagereason": "Devastated / Pulverized / Shotgunned"
},
{
"name": "weapon_combatshotgun",
"label": "Combat Shotgun",
"weapontype": "Shotgun",
"ammotype": "AMMO_SHOTGUN",
"damagereason": "Devastated / Pulverized / Shotgunned"
},
{
"name": "weapon_assaultrifle",
"label": "Assault Rifle",
"weapontype": "Assault Rifle",
"ammotype": "AMMO_RIFLE",
"damagereason": "Ended / Rifled / Shot down / Floored"
},
{
"name": "weapon_assaultrifle_mk2",
"label": "Assault Rifle MK2",
"weapontype": "Assault Rifle",
"ammotype": "AMMO_RIFLE",
"damagereason": "Ended / Rifled / Shot down / Floored"
},
{
"name": "weapon_carbinerifle",
"label": "Carbine Rifle",
"weapontype": "Assault Rifle",
"ammotype": "AMMO_RIFLE",
"damagereason": "Ended / Rifled / Shot down / Floored"
},
{
"name": "weapon_carbinerifle_mk2",
"label": "Carbine Rifle MK2",
"weapontype": "Assault Rifle",
"ammotype": "AMMO_RIFLE",
"damagereason": "Ended / Rifled / Shot down / Floored"
},
{
"name": "weapon_advancedrifle",
"label": "Advanced Rifle",
"weapontype": "Assault Rifle",
"ammotype": "AMMO_RIFLE",
"damagereason": "Ended / Rifled / Shot down / Floored"
},
{
"name": "weapon_specialcarbine",
"label": "Special Carbine",
"weapontype": "Assault Rifle",
"ammotype": "AMMO_RIFLE",
"damagereason": "Ended / Rifled / Shot down / Floored"
},
{
"name": "weapon_specialcarbine_mk2",
"label": "Specialcarbine MK2",
"weapontype": "Assault Rifle",
"ammotype": "AMMO_RIFLE",
"damagereason": "Ended / Rifled / Shot down / Floored"
},
{
"name": "weapon_bullpuprifle",
"label": "Bullpup Rifle",
"weapontype": "Assault Rifle",
"ammotype": "AMMO_RIFLE",
"damagereason": "Ended / Rifled / Shot down / Floored"
},
{
"name": "weapon_bullpuprifle_mk2",
"label": "Bull Puprifle MK2",
"weapontype": "Assault Rifle",
"ammotype": "AMMO_RIFLE",
"damagereason": "Ended / Rifled / Shot down / Floored"
},
{
"name": "weapon_compactrifle",
"label": "Compact Rifle",
"weapontype": "Assault Rifle",
"ammotype": "AMMO_RIFLE",
"damagereason": "Ended / Rifled / Shot down / Floored"
},
{
"name": "weapon_militaryrifle",
"label": "Military Rifle",
"weapontype": "Assault Rifle",
"ammotype": "AMMO_RIFLE",
"damagereason": "Ended / Rifled / Shot down / Floored"
},
{
"name": "weapon_heavyrifle",
"label": "Heavy Rifle",
"weapontype": "Assault Rifle",
"ammotype": "AMMO_RIFLE",
"damagereason": "Ended / Rifled / Shot down / Floored"
},
{
"name": "weapon_mg",
"label": "Machinegun",
"weapontype": "Light Machine Gun",
"ammotype": "AMMO_MG",
"damagereason": "Machine gunned / Sprayed / Ruined"
},
{
"name": "weapon_combatmg",
"label": "Combat MG",
"weapontype": "Light Machine Gun",
"ammotype": "AMMO_MG",
"damagereason": "Machine gunned / Sprayed / Ruined"
},
{
"name": "weapon_combatmg_mk2",
"label": "Combat MG MK2",
"weapontype": "Light Machine Gun",
"ammotype": "AMMO_MG",
"damagereason": "Machine gunned / Sprayed / Ruined"
},
{
"name": "weapon_gusenberg",
"label": "Thompson SMG",
"weapontype": "Light Machine Gun",
"ammotype": "AMMO_MG",
"damagereason": "Machine gunned / Sprayed / Ruined"
},
{
"name": "weapon_sniperrifle",
"label": "Sniper Rifle",
"weapontype": "Sniper Rifle",
"ammotype": "AMMO_SNIPER",
"damagereason": "Sniped / Picked off / Scoped"
},
{
"name": "weapon_heavysniper",
"label": "Heavy Sniper",
"weapontype": "Sniper Rifle",
"ammotype": "AMMO_SNIPER",
"damagereason": "Sniped / Picked off / Scoped"
},
{
"name": "weapon_heavysniper_mk2",
"label": "Heavysniper MK2",
"weapontype": "Sniper Rifle",
"ammotype": "AMMO_SNIPER",
"damagereason": "Sniped / Picked off / Scoped"
},
{
"name": "weapon_marksmanrifle",
"label": "Marksman Rifle",
"weapontype": "Sniper Rifle",
"ammotype": "AMMO_SNIPER",
"damagereason": "Sniped / Picked off / Scoped"
},
{
"name": "weapon_marksmanrifle_mk2",
"label": "Marksman Rifle MK2",
"weapontype": "Sniper Rifle",
"ammotype": "AMMO_SNIPER",
"damagereason": "Sniped / Picked off / Scoped"
},
{
"name": "weapon_remotesniper",
"label": "Remote Sniper",
"weapontype": "Sniper Rifle",
"ammotype": "AMMO_SNIPER_REMOTE",
"damagereason": "Sniped / Picked off / Scoped"
},
{
"name": "weapon_rpg",
"label": "RPG",
"weapontype": "Heavy Weapons",
"ammotype": "AMMO_RPG",
"damagereason": "Killed / Exploded / Obliterated / Destroyed / Erased / Annihilated"
},
{
"name": "weapon_grenadelauncher",
"label": "Grenade Launcher",
"weapontype": "Heavy Weapons",
"ammotype": "AMMO_GRENADELAUNCHER",
"damagereason": "Killed / Exploded / Obliterated / Destroyed / Erased / Annihilated"
},
{
"name": "weapon_grenadelauncher_smoke",
"label": "Smoke Grenade Launcher",
"weapontype": "Heavy Weapons",
"ammotype": "AMMO_GRENADELAUNCHER",
"damagereason": "Killed / Exploded / Obliterated / Destroyed / Erased / Annihilated"
},
{
"name": "weapon_minigun",
"label": "Minigun",
"weapontype": "Heavy Weapons",
"ammotype": "AMMO_MINIGUN",
"damagereason": "Killed / Exploded / Obliterated / Destroyed / Erased / Annihilated"
},
{
"name": "weapon_firework",
"label": "Firework Launcher",
"weapontype": "Heavy Weapons",
"ammotype": null,
"damagereason": "Killed / Exploded / Obliterated / Destroyed / Erased / Annihilated"
},
{
"name": "weapon_railgun",
"label": "Railgun",
"weapontype": "Heavy Weapons",
"ammotype": null,
"damagereason": "Killed / Exploded / Obliterated / Destroyed / Erased / Annihilated"
},
{
"name": "weapon_railgunxm3",
"label": "Railgun XM3",
"weapontype": "Heavy Weapons",
"ammotype": null,
"damagereason": "Killed / Exploded / Obliterated / Destroyed / Erased / Annihilated"
},
{
"name": "weapon_hominglauncher",
"label": "Homing Launcher",
"weapontype": "Heavy Weapons",
"ammotype": "AMMO_STINGER",
"damagereason": "Killed / Exploded / Obliterated / Destroyed / Erased / Annihilated"
},
{
"name": "weapon_compactlauncher",
"label": "Compact Launcher",
"weapontype": "Heavy Weapons",
"ammotype": null,
"damagereason": "Killed / Exploded / Obliterated / Destroyed / Erased / Annihilated"
},
{
"name": "weapon_rayminigun",
"label": "Ray Minigun",
"weapontype": "Heavy Weapons",
"ammotype": "AMMO_MINIGUN",
"damagereason": "Killed / Exploded / Obliterated / Destroyed / Erased / Annihilated"
},
{
"name": "weapon_emplauncher",
"label": "EMP Launcher",
"weapontype": "Heavy Weapons",
"ammotype": "AMMO_EMPLAUNCHER",
"damagereason": "Died"
},
{
"name": "weapon_grenade",
"label": "Grenade",
"weapontype": "Throwable",
"ammotype": null,
"damagereason": "Bombed / Exploded / Detonated / Blew up"
},
{
"name": "weapon_bzgas",
"label": "BZ Gas",
"weapontype": "Throwable",
"ammotype": null,
"damagereason": "Died"
},
{
"name": "weapon_molotov",
"label": "Molotov",
"weapontype": "Throwable",
"ammotype": null,
"damagereason": "Torched / Flambeed / Barbecued"
},
{
"name": "weapon_stickybomb",
"label": "C4",
"weapontype": "Throwable",
"ammotype": null,
"damagereason": "Bombed / Exploded / Detonated / Blew up"
},
{
"name": "weapon_proxmine",
"label": "Proxmine Grenade",
"weapontype": "Throwable",
"ammotype": null,
"damagereason": "Bombed / Exploded / Detonated / Blew up"
},
{
"name": "weapon_snowball",
"label": "Snowball",
"weapontype": "Throwable",
"ammotype": null,
"damagereason": "Died"
},
{
"name": "weapon_pipebomb",
"label": "Pipe Bomb",
"weapontype": "Throwable",
"ammotype": null,
"damagereason": "Bombed / Exploded / Detonated / Blew up"
},
{
"name": "weapon_ball",
"label": "Ball",
"weapontype": "Throwable",
"ammotype": "AMMO_BALL",
"damagereason": "Died"
},
{
"name": "weapon_smokegrenade",
"label": "Smoke Grenade",
"weapontype": "Throwable",
"ammotype": null,
"damagereason": "Died"
},
{
"name": "weapon_flare",
"label": "Flare pistol",
"weapontype": "Throwable",
"ammotype": "AMMO_FLARE",
"damagereason": "Died"
},
{
"name": "weapon_petrolcan",
"label": "Petrol Can",
"weapontype": "Miscellaneous",
"ammotype": "AMMO_PETROLCAN",
"damagereason": "Died"
},
{
"name": "gadget_parachute",
"label": "Parachute",
"weapontype": "Miscellaneous",
"ammotype": null,
"damagereason": "Died"
},
{
"name": "weapon_fireextinguisher",
"label": "Fire Extinguisher",
"weapontype": "Miscellaneous",
"ammotype": null,
"damagereason": "Died"
},
{
"name": "weapon_hazardcan",
"label": "Hazardcan",
"weapontype": "Miscellaneous",
"ammotype": "AMMO_PETROLCAN",
"damagereason": "Died"
},
{
"name": "weapon_fertilizercan",
"label": "Fertilizer Can",
"weapontype": "Miscellaneous",
"ammotype": "AMMO_FERTILIZERCAN",
"damagereason": "Died"
},
{
"name": "weapon_barbed_wire",
"label": "Barbed Wire",
"weapontype": "Miscellaneous",
"ammotype": null,
"damagereason": "Prodded"
},
{
"name": "weapon_drowning",
"label": "Drowning",
"weapontype": "Miscellaneous",
"ammotype": null,
"damagereason": "Died"
},
{
"name": "weapon_drowning_in_vehicle",
"label": "Drowning in a Vehicle",
"weapontype": "Miscellaneous",
"ammotype": null,
"damagereason": "Died"
},
{
"name": "weapon_bleeding",
"label": "Bleeding",
"weapontype": "Miscellaneous",
"ammotype": null,
"damagereason": "Bled out"
},
{
"name": "weapon_electric_fence",
"label": "Electric Fence",
"weapontype": "Miscellaneous",
"ammotype": null,
"damagereason": "Fried"
},
{
"name": "weapon_explosion",
"label": "Explosion",
"weapontype": "Miscellaneous",
"ammotype": null,
"damagereason": "Killed / Exploded / Obliterated / Destroyed / Erased / Annihilated"
},
{
"name": "weapon_fall",
"label": "Fall",
"weapontype": "Miscellaneous",
"ammotype": null,
"damagereason": "Committed suicide"
},
{
"name": "weapon_exhaustion",
"label": "Exhaustion",
"weapontype": "Miscellaneous",
"ammotype": null,
"damagereason": "Died"
},
{
"name": "weapon_hit_by_water_cannon",
"label": "Water Cannon",
"weapontype": "Miscellaneous",
"ammotype": null,
"damagereason": "Died"
},
{
"name": "weapon_rammed_by_car",
"label": "Rammed - Vehicle",
"weapontype": "Miscellaneous",
"ammotype": null,
"damagereason": "Flattened / Ran over / Ran down"
},
{
"name": "weapon_run_over_by_car",
"label": "Run Over - Vehicle",
"weapontype": "Miscellaneous",
"ammotype": null,
"damagereason": "Flattened / Ran over / Ran down"
},
{
"name": "weapon_heli_crash",
"label": "Heli Crash",
"weapontype": "Miscellaneous",
"ammotype": null,
"damagereason": "Helicopter Crash"
},
{
"name": "weapon_fire",
"label": "Fire",
"weapontype": "Miscellaneous",
"ammotype": null,
"damagereason": "Torched / Flambeed / Barbecued"
},
{
"name": "weapon_animal",
"label": "Animal",
"weapontype": "Animals",
"ammotype": null,
"damagereason": "Mauled"
},
{
"name": "weapon_cougar",
"label": "Cougar",
"weapontype": "Animals",
"ammotype": null,
"damagereason": "Mauled"
}
]
+144
View File
@@ -0,0 +1,144 @@
Locale = {}
Locale.__index = Locale
local function translateKey(phrase, subs)
if type(phrase) ~= 'string' then
error('TypeError: translateKey function expects arg #1 to be a string')
end
-- Substituions
if not subs then
return phrase
end
-- We should be escaping gsub just in case of any
-- shenanigans with nested template patterns or injection
-- Create and copy our return string
local result = phrase
-- Initial Scan over result looking for substituions
for k, v in pairs(subs) do
local templateToFind = '%%{' .. k .. '}'
result = result:gsub(templateToFind, tostring(v)) -- string to allow all types
end
return result
end
--- Constructor function for a new Locale class instance
--- @param opts table<string, any> - Constructor opts param
--- @return Locale
function Locale.new(_, opts)
local self = setmetatable({}, Locale)
self.fallback = opts.fallbackLang and Locale:new({
warnOnMissing = false,
phrases = opts.fallbackLang.phrases,
}) or false
self.warnOnMissing = type(opts.warnOnMissing) ~= 'boolean' and true or opts.warnOnMissing
self.phrases = {}
self:extend(opts.phrases or {})
return self
end
--- Method for extending an instances phrases map. This is also, used
--- internally for initial population of phrases field.
--- @param phrases table<string, string> - Table of phrase definitions
--- @param prefix string | nil - Optional prefix used for recursive calls
--- @return nil
function Locale:extend(phrases, prefix)
for key, phrase in pairs(phrases) do
local prefixKey = prefix and ('%s.%s'):format(prefix, key) or key
-- If this is a nested table, we need to go reeeeeeeeeeeecursive
if type(phrase) == 'table' then
self:extend(phrase, prefixKey)
else
self.phrases[prefixKey] = phrase
end
end
end
--- Clear locale instance phrases
--- Might be useful for memory management of large phrase maps.
--- @return nil
function Locale:clear()
self.phrases = {}
end
--- Clears all phrases and replaces it with the passed phrases table
--- @param phrases table<string, any>
function Locale:replace(phrases)
phrases = phrases or {}
self:clear()
self:extend(phrases)
end
--- Gets & Sets a locale depending on if an argument is passed
--- @param newLocale string - Optional new locale to set
--- @return string
function Locale:locale(newLocale)
if (newLocale) then
self.currentLocale = newLocale
end
return self.currentLocale
end
--- Primary translation method for a phrase of given key
--- @param key string - The phrase key to target
--- @param subs table<string, any> | nil
--- @return string
function Locale:t(key, subs)
local phrase, result
subs = subs or {}
-- See if the passed key resolves to a valid phrase string
if type(self.phrases[key]) == 'string' then
phrase = self.phrases[key]
-- At this point we know whether the phrase does not exist for this key
else
if self.warnOnMissing then
print(('^3Warning: Missing phrase for key: "%s"'):format(key))
end
if self.fallback then
return self.fallback:t(key, subs)
end
result = key
end
if type(phrase) == 'string' then
result = translateKey(phrase, subs)
end
return result
end
--- Check if a phrase key has already been defined within the Locale instance phrase maps.
--- @return boolean
function Locale:has(key)
return self.phrases[key] ~= nil
end
--- Will remove phrase keys from a Locale instance, using recursion/
--- @param phraseTarget string | table
--- @param prefix string
function Locale:delete(phraseTarget, prefix)
-- If the target is a string, we know that this is the end
-- of nested table tree.
if type(phraseTarget) == 'string' then
self.phrases[phraseTarget] = nil
else
for key, phrase in pairs(phraseTarget) do
local prefixKey = prefix and prefix .. '.' .. key or key
if type(phrase) == 'table' then
self:delete(phrase, prefixKey)
else
self.phrases[prefixKey] = nil
end
end
end
end
+46
View File
@@ -0,0 +1,46 @@
QBCore = {
Config = {},
Shared = {
Jobs = {},
Gangs = {},
Items = {},
Vehicles = {},
Weapons = {},
VehicleHashes = {},
},
Player = {},
Players = {},
PlayerData = {},
Functions = {},
ClientCallbacks = {},
ServerCallbacks = {},
Player_Buckets = {},
Entity_Buckets = {},
UsableItems = {},
Commands = {
List = {},
IgnoreList = {
['god'] = true,
['user'] = true
}
}
}
local function GetCoreObject(filters)
if not filters then return QBCore end
local results = {}
for i = 1, #filters do
local key = filters[i]
if QBCore[key] then
results[key] = QBCore[key]
end
end
return results
end
exports('GetCoreObject', GetCoreObject)
exports('GetSharedItems', function() return QBCore.Shared.Items end)
exports('GetSharedVehicles', function() return QBCore.Shared.Vehicles end)
exports('GetSharedWeapons', function() return QBCore.Shared.Weapons end)
exports('GetSharedJobs', function() return QBCore.Shared.Jobs end)
exports('GetSharedGangs', function() return QBCore.Shared.Gangs end)
+523
View File
@@ -0,0 +1,523 @@
function QBCore.Functions.GetVehicles()
if IsDuplicityVersion() then
return GetAllVehicles()
else
return GetGamePool('CVehicle')
end
end
function QBCore.Functions.GetObjects()
if IsDuplicityVersion() then
return GetAllObjects()
else
return GetGamePool('CObject')
end
end
function QBCore.Functions.GetPeds()
if IsDuplicityVersion() then
local pedPool = GetAllPeds()
local peds = {}
for i = 1, #pedPool do
if NetworkGetEntityOwner(pedPool[i]) == 0 then
table.insert(peds, pedPool[i])
end
end
return peds
else
local pedPool = GetGamePool('CPed')
local peds = {}
for i = 1, #pedPool do
if not IsPedAPlayer(pedPool[i]) then
table.insert(peds, pedPool[i])
end
end
return peds
end
end
function QBCore.Functions.GetPlayers()
if IsDuplicityVersion() then
local sources = {}
for k in pairs(QBCore.Players) do
sources[#sources + 1] = k
end
return sources
else
return GetActivePlayers()
end
end
function QBCore.Functions.GetCoords(entity)
local coords = GetEntityCoords(entity, false)
local heading = GetEntityHeading(entity)
return vector4(coords.x, coords.y, coords.z, heading)
end
function QBCore.Functions.HasItem(...)
if GetResourceState('qb-inventory') == 'missing' then return false end
if IsDuplicityVersion() then
local source, items, amount = ...
return exports['qb-inventory']:HasItem(source, items, amount)
else
local items, amount = ...
return exports['qb-inventory']:HasItem(items, amount)
end
end
function QBCore.Functions.Notify(...)
if IsDuplicityVersion() then
local source, text, texttype, length = ...
TriggerClientEvent('QBCore:Notify', source, text, texttype, length)
else
local text, texttype, length, icon = ...
local message = {
action = 'notify',
type = texttype or 'primary',
length = length or 5000,
}
if type(text) == 'table' then
message.text = text.text or 'Placeholder'
message.caption = text.caption or 'Placeholder'
else
message.text = text
end
if icon then
message.icon = icon
end
SendNUIMessage(message)
end
end
function QBCore.Functions.SpawnVehicle(...)
if IsDuplicityVersion() then
local source, model, coords, warp = ...
local ped = GetPlayerPed(source)
model = type(model) == 'string' and joaat(model) or model
if not coords then coords = GetEntityCoords(ped) end
local heading = coords.w and coords.w or 0.0
local veh = CreateVehicle(model, coords.x, coords.y, coords.z, heading, true, true)
while not DoesEntityExist(veh) do Wait(0) end
if warp then
while GetVehiclePedIsIn(ped, false) ~= veh do
Wait(0)
TaskWarpPedIntoVehicle(ped, veh, -1)
end
end
while NetworkGetEntityOwner(veh) ~= source do Wait(0) end
return veh
else
local model, cb, coords, isnetworked, teleportInto = ...
local ped = PlayerPedId()
model = type(model) == 'string' and joaat(model) or model
if not IsModelInCdimage(model) then return end
if coords then
coords = type(coords) == 'table' and vec3(coords.x, coords.y, coords.z) or coords
else
coords = GetEntityCoords(ped)
end
isnetworked = isnetworked == nil or isnetworked
QBCore.Functions.LoadModel(model)
local veh = CreateVehicle(model, coords.x, coords.y, coords.z, coords.w or 0.0, isnetworked, false)
local netid = NetworkGetNetworkIdFromEntity(veh)
SetVehicleHasBeenOwnedByPlayer(veh, true)
SetNetworkIdCanMigrate(netid, true)
SetVehicleNeedsToBeHotwired(veh, false)
SetVehRadioStation(veh, 'OFF')
SetVehicleFuelLevel(veh, 100.0)
SetModelAsNoLongerNeeded(model)
if teleportInto then TaskWarpPedIntoVehicle(PlayerPedId(), veh, -1) end
if cb then cb(veh) end
end
end
function QBCore.Functions.GetClosestPed(...)
if IsDuplicityVersion() then
local source, coords = ...
local ped = GetPlayerPed(source)
local peds = GetAllPeds()
local closestDistance, closestPed = -1, -1
if coords then
coords = type(coords) == 'table' and vector3(coords.x, coords.y, coords.z) or coords
else
coords = GetEntityCoords(ped)
end
for i = 1, #peds do
if peds[i] ~= ped then
local pedCoords = GetEntityCoords(peds[i])
local distance = #(pedCoords - coords)
if closestDistance == -1 or closestDistance > distance then
closestPed = peds[i]
closestDistance = distance
end
end
end
return closestPed, closestDistance
else
local coords, ignoreList = ...
local ped = PlayerPedId()
if coords then
coords = type(coords) == 'table' and vec3(coords.x, coords.y, coords.z) or coords
else
coords = GetEntityCoords(ped)
end
ignoreList = ignoreList or {}
local peds = QBCore.Functions.GetPeds(ignoreList)
local closestDistance, closestPed = -1, -1
for i = 1, #peds do
local pedCoords = GetEntityCoords(peds[i])
local distance = #(pedCoords - coords)
if closestDistance == -1 or closestDistance > distance then
closestPed = peds[i]
closestDistance = distance
end
end
return closestPed, closestDistance
end
end
function QBCore.Functions.GetClosestVehicle(...)
if IsDuplicityVersion() then
local source, coords = ...
local ped = GetPlayerPed(source)
local vehicles = GetAllVehicles()
local closestDistance, closestVehicle = -1, -1
if coords then
coords = type(coords) == 'table' and vector3(coords.x, coords.y, coords.z) or coords
else
coords = GetEntityCoords(ped)
end
for i = 1, #vehicles do
local vehicleCoords = GetEntityCoords(vehicles[i])
local distance = #(vehicleCoords - coords)
if closestDistance == -1 or closestDistance > distance then
closestVehicle = vehicles[i]
closestDistance = distance
end
end
return closestVehicle, closestDistance
else
local coords = ...
local ped = PlayerPedId()
local vehicles = GetGamePool('CVehicle')
local closestDistance, closestVehicle = -1, -1
if coords then
coords = type(coords) == 'table' and vec3(coords.x, coords.y, coords.z) or coords
else
coords = GetEntityCoords(ped)
end
for i = 1, #vehicles do
local vehicleCoords = GetEntityCoords(vehicles[i])
local distance = #(vehicleCoords - coords)
if closestDistance == -1 or closestDistance > distance then
closestVehicle = vehicles[i]
closestDistance = distance
end
end
return closestVehicle, closestDistance
end
end
function QBCore.Functions.GetClosestObject(...)
if IsDuplicityVersion() then
local source, coords = ...
local ped = GetPlayerPed(source)
local objects = GetAllObjects()
local closestDistance, closestObject = -1, -1
if coords then
coords = type(coords) == 'table' and vector3(coords.x, coords.y, coords.z) or coords
else
coords = GetEntityCoords(ped)
end
for i = 1, #objects do
local objectCoords = GetEntityCoords(objects[i])
local distance = #(objectCoords - coords)
if closestDistance == -1 or closestDistance > distance then
closestObject = objects[i]
closestDistance = distance
end
end
return closestObject, closestDistance
else
local coords = ...
local ped = PlayerPedId()
local objects = GetGamePool('CObject')
local closestDistance, closestObject = -1, -1
if coords then
coords = type(coords) == 'table' and vec3(coords.x, coords.y, coords.z) or coords
else
coords = GetEntityCoords(ped)
end
for i = 1, #objects do
local objectCoords = GetEntityCoords(objects[i])
local distance = #(objectCoords - coords)
if closestDistance == -1 or closestDistance > distance then
closestObject = objects[i]
closestDistance = distance
end
end
return closestObject, closestDistance
end
end
function QBCore.Functions.GetClosestPlayer(...)
if IsDuplicityVersion() then
local source, coords = ...
local ped = GetPlayerPed(source)
local players = GetPlayers()
local closestDistance, closestPlayer = -1, -1
if coords then
coords = type(coords) == 'table' and vector3(coords.x, coords.y, coords.z) or coords
else
coords = GetEntityCoords(ped)
end
for i = 1, #players do
local playerId = players[i]
local playerPed = GetPlayerPed(playerId)
if playerPed ~= ped then
local playerCoords = GetEntityCoords(playerPed)
local distance = #(playerCoords - coords)
if closestDistance == -1 or distance < closestDistance then
closestPlayer = playerId
closestDistance = distance
end
end
end
return closestPlayer, closestDistance
else
local coords = ...
local ped = PlayerPedId()
if coords then
coords = type(coords) == 'table' and vec3(coords.x, coords.y, coords.z) or coords
else
coords = GetEntityCoords(ped)
end
local closestPlayers = QBCore.Functions.GetPlayersFromCoords(coords)
local closestDistance, closestPlayer = -1, -1
for i = 1, #closestPlayers do
if closestPlayers[i] ~= PlayerId() and closestPlayers[i] ~= -1 then
local pos = GetEntityCoords(GetPlayerPed(closestPlayers[i]))
local distance = #(pos - coords)
if closestDistance == -1 or closestDistance > distance then
closestPlayer = closestPlayers[i]
closestDistance = distance
end
end
end
return closestPlayer, closestDistance
end
end
local StringCharset = {}
local NumberCharset = {}
for i = 48, 57 do NumberCharset[#NumberCharset + 1] = string.char(i) end
for i = 65, 90 do StringCharset[#StringCharset + 1] = string.char(i) end
for i = 97, 122 do StringCharset[#StringCharset + 1] = string.char(i) end
-- String Functions
function QBCore.Functions.RandomStr(length)
local result = ''
for i = 1, length do
result = result .. StringCharset[math.random(1, #StringCharset)]
end
return result
end
function QBCore.Functions.SplitStr(str, delimiter)
local result = {}
local from = 1
local delim_from, delim_to = string.find(str, delimiter, from)
while delim_from do
result[#result + 1] = string.sub(str, from, delim_from - 1)
from = delim_to + 1
delim_from, delim_to = string.find(str, delimiter, from)
end
result[#result + 1] = string.sub(str, from)
return result
end
function QBCore.Functions.Trim(value)
if not value then return nil end
return (string.gsub(value, '^%s*(.-)%s*$', '%1'))
end
function QBCore.Functions.FirstToUpper(value)
if not value then return nil end
return (value:gsub('^%l', string.upper))
end
function QBCore.Functions.SplitLines(str)
local lines = {}
for line in str:gmatch('[^\r\n]+') do
table.insert(lines, line)
end
return lines
end
function QBCore.Functions.NormalizeString(str)
return str:gsub('[^%w]', ''):lower()
end
-- Number Functions
function QBCore.Functions.RandomInt(length)
local result = ''
for i = 1, length do
result = result .. NumberCharset[math.random(1, #NumberCharset)]
end
return result
end
function QBCore.Functions.Round(value, numDecimalPlaces)
if not numDecimalPlaces then return math.floor(value + 0.5) end
local power = 10 ^ numDecimalPlaces
return math.floor((value * power) + 0.5) / (power)
end
function QBCore.Functions.Clamp(value, min, max)
return math.max(min, math.min(value, max))
end
-- Table Functions
function QBCore.Functions.TableLength(tbl)
local count = 0
for _ in pairs(tbl) do count = count + 1 end
return count
end
function QBCore.Functions.ShuffleTable(tbl)
for i = #tbl, 2, -1 do
local j = math.random(1, i)
tbl[i], tbl[j] = tbl[j], tbl[i]
end
return tbl
end
function QBCore.Functions.DeepCopy(tbl)
if type(tbl) ~= 'table' then return tbl end
local copy = {}
for k, v in pairs(tbl) do
copy[k] = QBCore.Functions.DeepCopy(v)
end
return copy
end
function QBCore.Functions.ContainsKey(tbl, key)
return tbl[key] ~= nil
end
function QBCore.Functions.Contains(tbl, value)
for _, v in pairs(tbl) do
if v == value then return true end
end
return false
end
function QBCore.Functions.MergeTables(tbl1, tbl2)
local merged = QBCore.Functions.DeepCopy(tbl1)
for k, v in pairs(tbl2) do
merged[k] = v
end
return merged
end
function QBCore.Functions.ReverseTable(tbl)
local reversed = {}
for i = #tbl, 1, -1 do
table.insert(reversed, tbl[i])
end
return reversed
end
function QBCore.Functions.RandomWeightedChoice(choices)
local totalWeight = 0
for _, choice in pairs(choices) do
totalWeight = totalWeight + choice.weight
end
local rand = math.random() * totalWeight
local cumulative = 0
for key, choice in pairs(choices) do
cumulative = cumulative + choice.weight
if rand <= cumulative then return key, choice end
end
end
function QBCore.Functions.GetRandomElement(tbl)
return tbl[math.random(1, #tbl)]
end
function QBCore.Functions.PrintTable(tbl, indent)
indent = indent or 0
if type(tbl) == 'table' then
for k, v in pairs(tbl) do
local tblType = type(v)
local formatting = ('%s ^3%s:^0'):format(string.rep(' ', indent), k)
if tblType == 'table' then
print(formatting)
QBCore.Functions.PrintTable(v, indent + 1)
elseif tblType == 'boolean' then
print(('%s^1 %s ^0'):format(formatting, tostring(v)))
elseif tblType == 'function' then
print(('%s^9 %s ^0'):format(formatting, tostring(v)))
elseif tblType == 'number' then
print(('%s^5 %s ^0'):format(formatting, v))
elseif tblType == 'string' then
print(("%s ^2'%s' ^0"):format(formatting, v))
else
print(('%s^2 %s ^0'):format(formatting, tostring(v)))
end
end
else
print(('%s^0 %s'):format(string.rep(' ', indent), tostring(tbl)))
end
end
function QBCore.Functions.Debug(tbl, indent, resource)
local resource_name = resource or GetInvokingResource() or 'qb-core'
print(('\x1b[4m\x1b[36m[ %s : DEBUG]\x1b[0m'):format(resource_name))
QBCore.Functions.PrintTable(tbl, indent)
print('\x1b[4m\x1b[36m[ END DEBUG ]\x1b[0m')
end
function QBCore.Functions.ShowError(resource, msg)
local resource_name = resource or GetInvokingResource() or 'qb-core'
print('\x1b[31m[' .. resource_name .. ':ERROR]\x1b[0m ' .. msg)
end
function QBCore.Functions.ShowSuccess(resource, msg)
local resource_name = resource or GetInvokingResource() or 'qb-core'
print('\x1b[32m[' .. resource_name .. ':LOG]\x1b[0m ' .. msg)
end
function QBCore.Functions.IsFunction(value)
if type(value) == 'table' then
return value.__cfx_functionReference ~= nil and type(value.__cfx_functionReference) == 'string'
end
return type(value) == 'function'
end
+70
View File
@@ -0,0 +1,70 @@
local resourceName = GetCurrentResourceName()
-- Load Config
if IsDuplicityVersion() then
local configData = LoadResourceFile(resourceName, 'shared/json/config.json')
if not configData then return print('^1[QBCore] Failed to Load Config JSON File') end
QBCore.Config = json.decode(configData) or {}
print('^2[QBCore] Loaded Config.json')
end
-- Load Vehicles
local Vehicles = LoadResourceFile(resourceName, 'shared/json/vehicles.json')
if not Vehicles then return print('^1[QBCore] Failed to Load Vehicles JSON File') end
Vehicles = json.decode(Vehicles)
for i = 1, #Vehicles do
local hash = joaat(Vehicles[i].model)
QBCore.Shared.Vehicles[Vehicles[i].model] = {
spawncode = Vehicles[i].model,
name = Vehicles[i].name,
brand = Vehicles[i].brand,
model = Vehicles[i].model,
price = Vehicles[i].price,
category = Vehicles[i].category,
hash = hash,
type = Vehicles[i].type,
shop = Vehicles[i].shop
}
QBCore.Shared.VehicleHashes[hash] = QBCore.Shared.Vehicles[Vehicles[i].model]
end
print('^2[QBCore] Loaded Vehicles.json')
-- Load Jobs
local Jobs = LoadResourceFile(resourceName, 'shared/json/jobs.json')
if not Jobs then return print('^1[QBCore] Failed to Load Jobs JSON File') end
QBCore.Shared.Jobs = json.decode(Jobs) or {}
print('^2[QBCore] Loaded Jobs.json')
-- Load Gangs
local Gangs = LoadResourceFile(resourceName, 'shared/json/gangs.json')
if not Gangs then return print('^1[QBCore] Failed to Load Gangs JSON File') end
QBCore.Shared.Gangs = json.decode(Gangs) or {}
print('^2[QBCore] Loaded Gangs.json')
-- Load Items
local Items = LoadResourceFile(resourceName, 'shared/json/items.json')
if not Items then return print('^1[QBCore] Failed to Load Items JSON File') end
QBCore.Shared.Items = json.decode(Items) or {}
print('^2[QBCore] Loaded Items.json')
-- Load Weapons
local Weapons = LoadResourceFile(resourceName, 'shared/json/weapons.json')
if not Weapons then return print('^1[QBCore] Failed to Load Weapons JSON File') end
Weapons = json.decode(Weapons)
for i = 1, #Weapons do
local weaponHash = joaat(Weapons[i].name)
QBCore.Shared.Weapons[weaponHash] = {
name = Weapons[i].name,
label = Weapons[i].label,
weapontype = Weapons[i].weapontype,
ammotype = Weapons[i].ammotype,
damagereason = Weapons[i].damagereason
}
end
print('^2[QBCore] Loaded Weapons.json')