Вопрос Одно оружие

  • 36
  • 0
Контакты для связи отсутствуют.
Как сделать чтобы игрок мог брать только одно оружие своего типа(Допустим автомат) и только один пистолет. Остальное оружие будет невозможно подобрать.
 
  • 246
  • 13
  • 47
xd:
local function a(ply, weapon)
    local b = weapon:GetClass()

    if weapon:GetSlot() == 2 and IsValid(ply:GetWeapon("weapon_ar")) then
        return false
    end


    if weapon:GetSlot() == 1 and IsValid(ply:GetWeapon("weapon_pistol")) then
        return false
    end
    return true
end


hook.Add("PlayerCanPickupWeapon", "RestrictWeapons", function(ply, weapon)
    return a(ply, weapon)
end)


hook.Add("PlayerSwitchWeapon", "RestrictWeapons", function(ply, oldWeapon, newWeapon)
    if not a(ply, newWeapon) then
        return true
    end
end)
 
Активность
Пока что здесь никого нет
Сверху Снизу