Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TTT2 support #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions deathnote/lua/autorun/client/cl_deathnote_vgui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,12 @@ function deathnote_gui_ttt(DeathTypes,dn_type)
if GetRoundState() == ROUND_ACTIVE then
for k,v in pairs(player.GetAll()) do
Name = ""
if v:GetRole() == 0 then Name = "I - "..v:Nick() end
if v:GetRole() == 1 then Name = "T - "..v:Nick() end
if v:GetRole() == 2 then Name = "D - "..v:Nick() end
if table.HasValue({0,2}, v:GetRole()) and v:Alive() or !v:Team() == TEAM_SPEC then
if v:GetRole() == 0 then Name = "I - "..v:Nick()
elseif v:GetRole() == 1 then Name = "T - "..v:Nick()
elseif v:GetRole() == 2 then Name = "D - "..v:Nick()
else Name = v:Nick() end
local teammate = TTT2 and v:GetTeam() == LocalPlayer():GetTeam() or v:GetRole() == LocalPlayer():GetRole()
if !teammate and v:Alive() and v:Team() != TEAM_SPEC then
DeathNotePlayerList:AddLine(Name,v:EntIndex()) -- Add lines
end
end
Expand Down
22 changes: 13 additions & 9 deletions deathnote/lua/autorun/deathnote_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,21 @@ if !ConVarExists( "DeathNote_TTT_DNLockOut") then
end

local version = "0.2.0"
http.Fetch("https://raw.githubusercontent.com/BluePentagram/Death_Note/master/version.txt", function( body, len, headers, code)
if GetConVar("DeathNote_Update_Messege"):GetBool() then
local githubversion = body
if githubversion != version then
if SERVER then
print("Deathnote: Your DeathNote version is different, Server Vesion: "..version..", Github Vesion: "..githubversion)
elseif CLIENT then
chat.AddText( Color( 25, 25, 25 ), "Deathnote: ", color_white, "Server DeathNote version is different, Server Vesion: "..version..", Github Vesion: "..githubversion )
-- checking version in the first tick to ensure http library is loaded (https://github.com/Facepunch/garrysmod-issues/issues/1010)
hook.Add("Think", "DeathNote_CheckVersion", function()
http.Fetch("https://raw.githubusercontent.com/BluePentagram/Death_Note/master/version.txt", function( body, len, headers, code)
if GetConVar("DeathNote_Update_Messege"):GetBool() then
local githubversion = body
if githubversion != version then
if SERVER then
print("Deathnote: Your DeathNote version is different, Server Vesion: "..version..", Github Vesion: "..githubversion)
elseif CLIENT then
chat.AddText( Color( 25, 25, 25 ), "Deathnote: ", color_white, "Server DeathNote version is different, Server Vesion: "..version..", Github Vesion: "..githubversion )
end
end
end
end
end)
hook.Remove("Think", "DeathNote_CheckVersion")
end)

DeathnoteCustomDeathCode = [[
Expand Down