Files
wnsrc/gamemodes/darkrp/schema/items/stackable/sh_zip_tie.lua
lifestorm df294d03aa Upload
2024-08-04 23:54:45 +03:00

78 lines
2.0 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

--[[
| 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 = "Lastik Kelepçe"
ITEM.description = "İnsanları kısıtlamak için kullanılan turuncu bir lastik kelepçe."
ITEM.price = 80
ITEM.model = "models/items/crossbowrounds.mdl"
ITEM.category = "Combine"
ITEM.maxStackSize = 10
ITEM.factions = {FACTION_CP, FACTION_OTA, FACTION_RESISTANCE}
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
local ragdoll = nil
if (target:IsRagdoll() and target.ixPlayer) then
ragdoll = target
target = target.ixPlayer
end
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(ragdoll or target, function()
itemTable.bBeingUsed = false
if (!(ix.fights and target:GetFight())) then
target:SetRestricted(true)
target:SetNetVar("tying")
target:NotifyLocalized("fTiedUp")
client:NotifyLocalized("Hedefe başarıyla bağlandı.")
target:SetWalkSpeed(target:GetWalkSpeed()/3)
itemTable:Remove()
else
target:SetAction()
target:SetNetVar("tying")
end
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