add sborka
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
|
||||
include("entities/lvs_tank_wheeldrive/modules/cl_attachable_playermodels.lua")
|
||||
|
||||
function ENT:DrawDriver()
|
||||
if IsValid(self:GetNWEntity("UAV")) then
|
||||
local pod = self:GetNWEntity("UAV"):GetDriverSeat()
|
||||
|
||||
if not IsValid( pod ) then self:RemovePlayerModel( "driver" ) return self:SetBodygroup(1,0) end
|
||||
|
||||
local plyL = LocalPlayer()
|
||||
local ply = pod:GetDriver()
|
||||
|
||||
if not IsValid( ply ) then self:RemovePlayerModel( "driver" ) return self:SetBodygroup(1,0) end
|
||||
|
||||
local model = self:CreatePlayerModel( ply, "driver" )
|
||||
model:SetSequence( "cidle_knife" )
|
||||
model:SetRenderOrigin( LocalToWorld(Vector(-30,0,-5),Angle(0,0,0),(self:LocalToWorld(Vector(0,0,0))),self:GetAngles()) )
|
||||
model:SetRenderAngles( self:LocalToWorldAngles(Angle(0,0,0)) )
|
||||
model:DrawModel()
|
||||
|
||||
self:SetBodygroup(1,1)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function ENT:PreDraw()
|
||||
self:DrawDriver()
|
||||
|
||||
return true
|
||||
end
|
||||
@@ -0,0 +1,2 @@
|
||||
include("shared.lua")
|
||||
include("cl_attached_playermodels.lua")
|
||||
@@ -0,0 +1,45 @@
|
||||
AddCSLuaFile( "shared.lua" )
|
||||
AddCSLuaFile( "cl_init.lua" )
|
||||
AddCSLuaFile( "cl_attached_playermodels.lua" )
|
||||
include("shared.lua")
|
||||
|
||||
function ENT:OnSpawn( PObj )
|
||||
PObj:SetMass(100)
|
||||
local DriverSeat = self:AddDriverSeat( Vector(-50,50,-5), Angle(0,-90,0) )
|
||||
DriverSeat.HidePlayer = true
|
||||
DriverSeat.ExitPos = Vector(-20,0,20)
|
||||
end
|
||||
|
||||
function ENT:Use( ply )
|
||||
if IsValid(self:GetNWEntity("UAV")) then
|
||||
if self:GetNWEntity("UAV"):GetAI() then return end
|
||||
ply:EnterVehicle(self:GetNWEntity("UAV"):GetDriverSeat())
|
||||
self:GetNWEntity("UAV"):AlignView( ply )
|
||||
|
||||
if hook.Run( "LVS.CanPlayerDrive", ply, self ) ~= false then
|
||||
ply:EnterVehicle( self:GetNWEntity("UAV"):GetDriverSeat() )
|
||||
self:GetNWEntity("UAV"):AlignView( ply )
|
||||
else
|
||||
hook.Run( "LVS.OnPlayerCannotDrive", ply, self )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:Explode()
|
||||
if self.ExplodedAlready then return end
|
||||
|
||||
self.ExplodedAlready = true
|
||||
|
||||
if IsValid(self:GetNWEntity("UAV")) then
|
||||
local Driver = self:GetNWEntity("UAV"):GetDriver()
|
||||
|
||||
if IsValid( Driver ) then
|
||||
self:HurtPlayer( Driver, Driver:Health() + Driver:Armor(), self.FinalAttacker, self.FinalInflictor )
|
||||
end
|
||||
self:GetNWEntity("UAV"):SetlvsLockedStatus(true)
|
||||
end
|
||||
|
||||
self:OnFinishExplosion()
|
||||
|
||||
self:Remove()
|
||||
end
|
||||
@@ -0,0 +1,34 @@
|
||||
|
||||
ENT.Base = "lvs_base_wheeldrive_trailer"
|
||||
|
||||
ENT.PrintName = "[LVS] UAV Control"
|
||||
ENT.Author = "Shermann Wolf"
|
||||
ENT.Information = ""
|
||||
ENT.Category = "[LVS]"
|
||||
|
||||
ENT.Spawnable = false
|
||||
ENT.AdminSpawnable = false
|
||||
|
||||
ENT.MDL = "models/sw/shared/uav_control.mdl"
|
||||
|
||||
ENT.AITEAM = 0
|
||||
|
||||
ENT.MaxHealth = 250
|
||||
|
||||
function ENT:CalcMainActivity( ply )
|
||||
if ply ~= self:GetDriver() then return self:CalcMainActivityPassenger( ply ) end
|
||||
|
||||
if ply.m_bWasNoclipping then
|
||||
ply.m_bWasNoclipping = nil
|
||||
ply:AnimResetGestureSlot( GESTURE_SLOT_CUSTOM )
|
||||
|
||||
if CLIENT then
|
||||
ply:SetIK( true )
|
||||
end
|
||||
end
|
||||
|
||||
ply.CalcIdeal = ACT_STAND
|
||||
ply.CalcSeqOverride = ply:LookupSequence( "cidle_knife" )
|
||||
|
||||
return ply.CalcIdeal, ply.CalcSeqOverride
|
||||
end
|
||||
Reference in New Issue
Block a user