This repository has been archived by the owner on Nov 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
cl_cheat.lua
36 lines (31 loc) · 2.67 KB
/
cl_cheat.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
BR.Cheat = {}
-- Varibles
local allowedWeapons = {}
local allWeapons = {"weapon_doubleaction", "weapon_revolver_mk2", "weapon_specialcarbine_mk2", "weapon_bullpuprifle_mk2", "weapon_marksmanrifle_mk2", "weapon_snspistol_mk2", "weapon_pumpshotgun_mk2", "WEAPON_HAMMER","WEAPON_BAT","WEAPON_GOLFCLUB","WEAPON_CROWBAR","WEAPON_NIGHTSTICK","WEAPON_FLASHLIGHT","WEAPON_FIREEXTINGUISHER","WEAPON_BZGAS","WEAPON_FLARE","WEAPON_BOTTLE","WEAPON_KNUCKLE","WEAPON_HATCHET","WEAPON_MACHETE","WEAPON_DAGGER","WEAPON_PISTOL","WEAPON_COMBATPISTOL","WEAPON_PISTOL50","WEAPON_SNSPISTOL","WEAPON_HEAVYPISTOL","WEAPON_VINTAGEPISTOL","WEAPON_FLAREGUN","WEAPON_MARKSMANPISTOL","WEAPON_REVOLVER","WEAPON_STUNGUN","WEAPON_APPISTOL","WEAPON_MICROSMG","WEAPON_SMG","WEAPON_MACHINEPISTOL","WEAPON_ASSAULTSMG","WEAPON_COMBATPDW","WEAPON_ASSAULTRIFLE","WEAPON_CARBINERIFLE","WEAPON_SPECIALCARBINE","WEAPON_ADVANCEDRIFLE","WEAPON_BULLPUPRIFLE","WEAPON_MUSKET","WEAPON_COMPACTRIFLE","WEAPON_MG","WEAPON_COMBATMG","WEAPON_GUSENBERG","WEAPON_PUMPSHOTGUN","WEAPON_SAWNOFFSHOTGUN","WEAPON_ASSAULTSHOTGUN","WEAPON_BULLPUPSHOTGUN","WEAPON_HEAVYSHOTGUN","WEAPON_SNIPERRIFLE","WEAPON_HEAVYSNIPER","WEAPON_GRENADELAUNCHER","WEAPON_RPG","WEAPON_STINGER","WEAPON_MINIGUN","WEAPON_GRENADE","WEAPON_STICKYBOMB","WEAPON_SMOKEGRENADE","WEAPON_MOLOTOV","WEAPON_PETROLCAN","WEAPON_FIREWORK","WEAPON_PROXMINE","WEAPON_SNOWBALL","WEAPON_BALL","WEAPON_RAILGUN","WEAPON_HOMINGLAUNCHER","WEAPON_COMPACTLAUNCHER","WEAPON_PIPEBOMB","WEAPON_MARKSMANRIFLE","WEAPON_DBSHOTGUN","WEAPON_AUTOSHOTGUN","WEAPON_MINISMG","WEAPON_SWITCHBLADE","WEAPON_BATTLEAXE","WEAPON_POOLCUE","WEAPON_WRENCH","WEAPON_PISTOL_MK2","WEAPON_SMG_MK2","WEAPON_ASSAULTRIFLE_MK2","WEAPON_CARBINERIFLE_MK2","WEAPON_COMBATMG_MK2","WEAPON_HEAVYSNIPER_MK2"}
local weaponToLabel = {
["weapon_doubleaction"] = "WT_REV_DA",
["WEAPON_PISTOL50"] = "WT_PIST_50",
["WEAPON_FLAREGUN"] = "WT_FLAREGUN",
["WEAPON_MICROSMG"] = "WT_SMG_MCR",
["WEAPON_SMG"] = "WT_SMG",
["WEAPON_ASSAULTRIFLE"] = "WT_RIFLE_ASL",
["WEAPON_CARBINERIFLE"] = "WT_RIFLE_CBN",
["WEAPON_GUSENBERG"] = "WT_GUSENBERG",
["WEAPON_PUMPSHOTGUN"] = "WT_SG_PMP"
}
function BR:GiveWeapon(ped, weaponHash)
local varString = type(weaponHash) == "string"
local hash = varString and GetHashKey(weaponHash) or weaponHash
allowedWeapons[hash] = true
GiveWeaponToPed(ped, hash, math.random(10, 40), false, true)
if varString then
ShowAboveRadarMessage(string.format("You picked up 1x ~b~%s~w~.", GetLabelText(weaponToLabel[weaponHash])))
end
end
function BR.Cheat:Timer(ped)
for k,v in pairs(allWeapons) do
if not allowedWeapons[GetHashKey(v)] and HasPedGotWeapon(ped, GetHashKey(v), false) then
RemoveWeaponFromPed(ped, GetHashKey(v))
end
end
end