1
0
Fork 0

Code commit

This commit is contained in:
saibotk 2020-05-30 15:56:35 +02:00
parent 05baae4763
commit ec797a245d
No known key found for this signature in database
GPG key ID: A3299C587D5DF523
5 changed files with 80 additions and 0 deletions

16
addon.json Normal file
View file

@ -0,0 +1,16 @@
{
"ignore": [
".git/*",
".gitignore",
".gitattributes",
"README.md",
"LICENSE",
"out.gma"
],
"tags": [
"fun"
],
"title": "TTT-Silentstep",
"type": "tool",
"workshopid": 1137482209
}

View file

@ -0,0 +1,57 @@
if SERVER then
AddCSLuaFile()
resource.AddFile("materials/vgui/ttt/icon_silentstep.vmt")
resource.AddFile("materials/vgui/ttt/perks/hud_silentstep.png")
util.AddNetworkString("TTTSilentstepBought")
end
ITEM.hud = Material("vgui/ttt/perks/hud_silentstep.png")
ITEM.EquipMenuData = {
type = "item_passive",
name = "item_silentstep_name",
desc = "item_silentstep_desc"
}
ITEM.material = "vgui/ttt/icon_silentstep"
ITEM.CanBuy = {ROLE_TRAITOR, ROLE_DETECTIVE}
if SERVER then
function ITEM:Bought(ply)
net.Start("TTTSilentstepBought")
net.WriteEntity(ply)
net.Broadcast()
end
else
hook.Add("TTT2Initialize", "TTTItemSilentStepLang", function()
LANG.AddToLanguage("English", "item_silentstep_name", "Silent Step")
LANG.AddToLanguage("English", "item_silentstep_desc", "Silent Step Perk.\nLets you walk like a ninja without any steps!")
end)
net.Receive("TTTSilentstepBought", function()
local ply = net.ReadEntity()
if ply == LocalPlayer() then return end
if not ply:HasEquipmentItem("item_ttt_silentstep") then
ply.equipmentItems = ply.equipmentItems or {}
ply.equipmentItems[#ply.equipmentItems + 1] = "item_ttt_silentstep"
end
end)
hook.Add("TTTEndRound", "TTTSilentStepCleanUp", function()
local lcply = LocalPlayer()
for _, v in ipairs(player.GetAll()) do
if v ~= lcply then
v.equipmentItems = {}
end
end
end)
end
hook.Add("PlayerFootstep", "TTTSilentStepNoSound", function(ply)
if ply:HasEquipmentItem("item_ttt_silentstep") then
return true
end
end)

View file

@ -0,0 +1,7 @@
"UnlitGeneric"
{
"$basetexture" "vgui/ttt/icon_silentstep"
"$vertexcolor" 1
"$vertexalpha" 1
"$translucent" 1
}

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB