-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathantipropkill.lua
More file actions
50 lines (42 loc) · 1.44 KB
/
antipropkill.lua
File metadata and controls
50 lines (42 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
if CLIENT then
net.Receive( "PrintColor", function()
chat.AddText( unpack( net.ReadTable() ) )
end )
else
util.AddNetworkString( "PrintColor" )
local Meta = FindMetaTable( "Player" )
function Meta:PrintColor( ... )
net.Start( "PrintColor" )
net.WriteTable( { ... } )
net.Send( self )
end
function antiPropDamage (victim, attacker)
if (attacker:IsValid()) then
if (attacker:GetClass() == "prop_physics" or attacker:IsWorld() or attacker:GetClass() == "prop_vehicle_jeep") then
owner = attacker:GetCPPIOwner()
attacker:EnableMotion(false)
attacker:SetColor( Color( 255, 0, 0, 255 ) )
return false
else
if (attacker:IsPlayer()) then
if (attacker:InVehicle()) then
owner = attacker:GetCPPIOwner()
attacker:EnableMotion(false)
attacker:SetColor( Color( 255, 0, 0, 255 ) )
return false
end
else
return true
end
end
end
if (owner != nil) then
for k, v in pairs( player.GetAll() ) do
if ucl.query(v, "ulx asay", false) then
v:PrintColor( Color( 255, 0, 0 ), "Prop Protection ", Color( 255, 255, 255 ), "| ", victim:Nick(), " was almost prop-killed by ", owner, "!" )
end
end
end
end
hook.Add("PlayerShouldTakeDamage", "nopropdamage", antiPropDamage)
end