master
E. Almqvist 5 years ago
parent 495a0d0023
commit f0f4154e1b
  1. 7
      entities/entities/q_node/init.lua
  2. 10
      gamemode/engine/lib/sh_node.lua
  3. 16
      plugins/plugin_spawnvehicles.lua

@ -29,12 +29,7 @@ function ENT:OnTakeDamage( dmgInfo )
local attacker = dmgInfo:GetAttacker()
local wep = attacker:GetActiveWeapon()
if( IsValid( wep ) && IsValid( attacker ) ) then
Quantum.Node.Gather( attacker, wep:GetClass(), self )
self:SetHealth( self:Health() - dmgInfo:GetDamage() )
if( self:Health() <= 0 ) then
Quantum.Node.Remove( self )
end
Quantum.Node.Gather( attacker, wep:GetClass(), self, dmgInfo )
end
end
end

@ -126,7 +126,7 @@ if SERVER then
end
end
function Quantum.Node.Gather( pl, tool, ent )
function Quantum.Node.Gather( pl, tool, ent, dmgInfo )
local nodeTbl = ent.node
if( ent.node != nil ) then
@ -144,6 +144,14 @@ if SERVER then
end
if( canGather ) then
if( dmgInfo != nil ) then
self:SetHealth( self:Health() - dmgInfo:GetDamage() )
if( self:Health() <= 0 ) then
Quantum.Node.Remove( self )
end
end
local loot, amount = randomizeLootTable( nodeTbl.give, nodeTbl.giveprobability )
if( loot != nil ) then
Quantum.Server.Inventory.GiveItem( pl, loot, amount )

@ -6,6 +6,8 @@ if SERVER then
plugin.vechilesTypes = {
["jeep"] = function( pos, ang )
local ent = simfphys.SpawnVehicleSimple( "sim_fphys_jeep", pos, ang )
ent:SetFuel( 99999 )
print( ent:IsInitialized() )
return ent
end,
["duke"] = function( pos, ang )
@ -14,20 +16,6 @@ if SERVER then
end,
["couch"] = function( pos, ang )
local ent = simfphys.SpawnVehicleSimple( "sim_fphys_couch", pos, ang )
return ent
end,
["heli"] = function( pos, ang )
local ent = ents.Create( "wac_hc_littlebird_mh6" )
if( !IsValid(ent) ) then
Quantum.Error( "Failed to create WAC helicopter" )
return
end
ent:SetPos( pos )
ent:SetAngles( Angle( 0, 0, 0 ) )
ent:Spawn()
ent:Activate()
return ent
end
}

Loading…
Cancel
Save