46 lines
1,022 B
Lua
46 lines
1,022 B
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()
|
||
|
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
|