mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-18 22:23:46 +03:00
Upload
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Worek z tkaniny ze sznurkiem"
|
||||
ITEM.description = "Worek płócienny ściągany sznurkiem, idealnie nadający się na czyjąś głowę."
|
||||
ITEM.price = 8
|
||||
ITEM.model = "models/props_junk/garbage_bag001a.mdl" -- < the "real" models dont have proper collisions
|
||||
ITEM.maxStackSize = 10
|
||||
ITEM.functions.Use = {
|
||||
OnRun = function(itemTable)
|
||||
local client = itemTable.player
|
||||
local data = {}
|
||||
data.start = client:GetShootPos()
|
||||
data.endpos = data.start + client:GetAimVector() * 96
|
||||
data.filter = client
|
||||
local target = util.TraceLine(data).Entity
|
||||
|
||||
if (IsValid(target) and target:IsPlayer() and target:GetCharacter() and target:IsRestricted()) then
|
||||
itemTable.bBeingUsed = true
|
||||
|
||||
client:SetAction("Nakładanie worka...", 2)
|
||||
|
||||
client:DoStaredAction(target, function()
|
||||
target:NotifyLocalized("Ktoś założył worek na twoją głowę!")
|
||||
|
||||
itemTable:Remove()
|
||||
|
||||
net.Start("WNBagEnter")
|
||||
net.WriteString(target:SteamID64())
|
||||
net.Broadcast()
|
||||
|
||||
target:SetNetVar("WNBagged", true)
|
||||
end, 3, function()
|
||||
client:SetAction()
|
||||
target:SetAction()
|
||||
target:SetNetVar("WNBagged", true)
|
||||
|
||||
itemTable.bBeingUsed = false
|
||||
end)
|
||||
elseif (IsValid(target) and target:IsPlayer() and !target:IsRestricted()) then
|
||||
client:NotifyLocalized("Character should be tied up first")
|
||||
else
|
||||
client:NotifyLocalized("plyNotValid")
|
||||
end
|
||||
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(itemTable)
|
||||
return !IsValid(itemTable.entity) or itemTable.bBeingUsed
|
||||
end
|
||||
}
|
||||
|
||||
function ITEM:CanTransfer(inventory, newInventory)
|
||||
return !self.bBeingUsed
|
||||
end
|
||||
@@ -0,0 +1,71 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Trytka"
|
||||
ITEM.description = "Jednorazowe zaciski Zip służące do skuwania innych."
|
||||
ITEM.price = 8
|
||||
ITEM.model = "models/items/crossbowrounds.mdl"
|
||||
ITEM.functions.Use = {
|
||||
OnRun = function(itemTable)
|
||||
local client = itemTable.player
|
||||
local data = {}
|
||||
data.start = client:GetShootPos()
|
||||
data.endpos = data.start + client:GetAimVector() * 96
|
||||
data.filter = client
|
||||
local target = util.TraceLine(data).Entity
|
||||
|
||||
if (IsValid(target) and target:IsPlayer() and target:GetCharacter()
|
||||
and !target:GetNetVar("tying") and !target:IsRestricted()) then
|
||||
itemTable.bBeingUsed = true
|
||||
|
||||
client:SetAction("@tying", 5)
|
||||
|
||||
client:DoStaredAction(target, function()
|
||||
target:SetRestricted(true)
|
||||
target:SetNetVar("tying")
|
||||
target:NotifyLocalized("fTiedUp")
|
||||
|
||||
if (target:IsCombine()) then
|
||||
Schema:AddCombineDisplayMessage("@cLosingContact", Color(255, 255, 255, 255))
|
||||
Schema:AddCombineDisplayMessage("@cLostContact", Color(255, 0, 0, 255))
|
||||
end
|
||||
|
||||
itemTable:Remove()
|
||||
|
||||
target:SetWalkSpeed(target:GetWalkSpeed()/3)
|
||||
|
||||
net.Start("WNZipTieEnter")
|
||||
net.WriteString(target:SteamID64())
|
||||
net.Broadcast()
|
||||
end, 5, function()
|
||||
client:SetAction()
|
||||
|
||||
target:SetAction()
|
||||
target:SetNetVar("tying")
|
||||
|
||||
itemTable.bBeingUsed = false
|
||||
end)
|
||||
|
||||
target:SetNetVar("tying", true)
|
||||
target:SetAction("@fBeingTied", 5)
|
||||
else
|
||||
itemTable.player:NotifyLocalized("plyNotValid")
|
||||
end
|
||||
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(itemTable)
|
||||
return !IsValid(itemTable.entity) or itemTable.bBeingUsed
|
||||
end
|
||||
}
|
||||
|
||||
function ITEM:CanTransfer(inventory, newInventory)
|
||||
return !self.bBeingUsed
|
||||
end
|
||||
Reference in New Issue
Block a user