buddem/gun/guns4all.lua

46 lines
1,022 B
Lua
Raw Normal View History

2019-10-24 22:32:40 +03:00
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()
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"
}
for i,wpn in ipairs(weapons) do
GiveWeaponToPed(ped, wpn)
SetPedInfiniteAmmo(ped, true, wpn)
end
end