Update sv_player.lua

This commit is contained in:
rain-rain-bob-sss 2023-08-28 16:59:19 +08:00 committed by GitHub
parent 43933fe474
commit 13de11739c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -307,7 +307,7 @@ function GM:PurchaseProp(ply, cmd, args)
local ea=ply:EyeAngles()
ea[1]=0
ea[3]=0
ent:SetAngles(ea)
ent:SetAngles(-ea)
ent:SetPos(tr.HitPos + Vector(0, 0, (ent:OBBCenter():Distance(ent:OBBMins()) + 5)))
ent:CPPISetOwner(ply)
ent:Spawn()
@ -316,6 +316,26 @@ function GM:PurchaseProp(ply, cmd, args)
ent:SetNWInt("CurrentPropHealth", math.floor(Prop.Health))
ent:SetNWInt("BasePropHealth", math.floor(Prop.Health))
ent:SetNWInt("FM_Price", math.floor(Prop.Price))
ent.IsFloodProp=true
pcall(function()
local b=Prop.Buoyancy
if(b)then
ent:GetPhysicsObject():SetBuoyancyRatio(b/100)
end
local m=Prop.Mass
if(m)then
ent:GetPhysicsObject():SetMass(m)
end
local pm=Prop.PhysMaterial
if(pm)then
ent:GetPhysicsObject():SetMaterial(pm)
end
local gl=Prop.GameFlags
if(gl)then
ent:GetPhysicsObject():AddGameFlag(gl)
end
ent:GetPhysicsObject():Sleep()
end)
local undofunc=function(t,ent,money)
if(ent:IsValid() and (not ent.flood_trashed))then
ply:AddCash(money)