53 lines
1.2 KiB
Lua
53 lines
1.2 KiB
Lua
AddCSLuaFile()
|
|
|
|
--SWEP.Base = "weapon_rp_base"
|
|
|
|
if CLIENT then
|
|
SWEP.PrintName = "Парашют"
|
|
SWEP.DrawAmmo = false
|
|
end
|
|
|
|
SWEP.ViewModel = Model('models/weapons/v_hands.mdl')
|
|
SWEP.ViewModelFOV = 62
|
|
SWEP.Category = "Other"
|
|
SWEP.Spawnable = true
|
|
SWEP.AdminSpawnable = false
|
|
SWEP.HoldType = "normal"
|
|
SWEP.ViewModel = "models/weapons/c_arms.mdl"
|
|
SWEP.WorldModel = ""
|
|
|
|
function SWEP:Initialize()
|
|
if not SERVER then return end
|
|
self.preventWalkPress = 0
|
|
end
|
|
|
|
function SWEP:PrimaryAttack()
|
|
if not IsValid(self.Owner) then return end
|
|
|
|
local ply = self.Owner
|
|
local reloadTime = ix and ix.config.Get("parachuteReloadTime", 20) or 20
|
|
local minVel = ix and ix.config.Get("parachuteMinVelocity", -600) or -600
|
|
|
|
if ply:Alive() and ((ply:GetNW2Int("r_parachute") or 0) <= CurTime()) and ply:IsValid() and not (ply:GetMoveType() == MOVETYPE_NOCLIP or ply:InVehicle() or ply:OnGround() or ply:GetVelocity().z > minVel) then
|
|
ply:SetNW2Int("r_parachute", CurTime() + reloadTime)
|
|
self.preventWalkPress = CurTime() + reloadTime
|
|
end
|
|
end
|
|
|
|
function SWEP:CanSecondaryAttack()
|
|
return false
|
|
end
|
|
|
|
function SWEP:SecondaryAttack()
|
|
|
|
end
|
|
|
|
function SWEP:Reload()
|
|
return false
|
|
end
|
|
|
|
|
|
|
|
|
|
|