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},
|
2019-10-24 23:56:49 +03:00
|
|
|
args = { 'Hernepyssynne, olkaa hyvä.' }
|
|
|
|
})
|
2019-10-24 22:32:40 +03:00
|
|
|
end, false)
|
|
|
|
AddEventHandler('playerSpawned', function()
|
|
|
|
giveGrantedWpn()
|
|
|
|
end, false)
|
|
|
|
|
2019-10-24 23:49:22 +03:00
|
|
|
|
|
|
|
|
2019-10-24 22:32:40 +03:00
|
|
|
function giveGrantedWpn()
|
2019-10-24 23:49:22 +03:00
|
|
|
|
2019-10-24 22:32:40 +03:00
|
|
|
local ped = PlayerPedId()
|
2019-10-24 23:49:22 +03:00
|
|
|
|
|
|
|
-- List of weapons to give
|
2019-10-24 22:32:40 +03:00
|
|
|
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"
|
|
|
|
}
|
|
|
|
|
2019-10-24 23:49:22 +03:00
|
|
|
-- Give weapon and set infinite ammo
|
2019-10-24 22:32:40 +03:00
|
|
|
for i,wpn in ipairs(weapons) do
|
|
|
|
GiveWeaponToPed(ped, wpn)
|
|
|
|
SetPedInfiniteAmmo(ped, true, wpn)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|