buddem/gun/guns4all.lua

49 lines
No EOL
1.1 KiB
Lua

RegisterCommand('gun', function(source, args)
giveGrantedWpn()
TriggerEvent('chat:addMessage', {
color = {255,255,0},
args = { 'Hernepyssynne, olkaa hyvä.' }
})
end, false)RegisterCommand('wpn', function(source, args)
giveGrantedWpn()
TriggerEvent('chat:addMessage', {
color = {255,255,0},
args = { 'Hernepyssynne, olkaa hyvä.' }
})
end, false)
AddEventHandler('playerSpawned', function()
giveGrantedWpn()
end, false)
function giveGrantedWpn()
local ped = PlayerPedId()
-- List of weapons to give
local weapons = {
"WEAPON_PISTOL",
"WEAPON_STUNGUN",
"WEAPON_GRENADE",
"WEAPON_STICKYBOMB",
"WEAPON_PROXMINE",
"WEAPON_HOMINGLAUNCHER",
"WEAPON_RPG",
"WEAPON_FIREWORK",
"WEAPON_GRENADELAUNCHER",
"WEAPON_RAILGUN",
"WEAPON_RAYPISTOL",
"WEAPON_RAYMINIGUN",
"WEAPON_RAYCARBINE",
"WEAPON_FIREEXTINGUISHER",
"WEAPON_PETROLCAN"
}
-- Give weapon and set infinite ammo
for i,wpn in ipairs(weapons) do
GiveWeaponToPed(ped, wpn)
SetPedInfiniteAmmo(ped, true, wpn)
end
end