From f24e387978b16b42e33edc84cd00358756ab5992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillaume=20B=C3=89NIT?= Date: Sun, 16 Apr 2017 18:43:40 +0200 Subject: [PATCH 1/3] Fix lockpick --- lua/weapons/guigui_handcuffs_lockpick.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/weapons/guigui_handcuffs_lockpick.lua b/lua/weapons/guigui_handcuffs_lockpick.lua index 869a4c8..20808bb 100644 --- a/lua/weapons/guigui_handcuffs_lockpick.lua +++ b/lua/weapons/guigui_handcuffs_lockpick.lua @@ -43,7 +43,7 @@ function SWEP:PrimaryAttack() local wep = ent:GetActiveWeapon():GetClass() if wep == "guigui_handcuffed" then timer.Simple(0.4, function() PrintMessage(4, math.random(0,24).." %") timer.Simple(0.4, function() PrintMessage(4, math.random(25,79).." %") timer.Simple(0.4, function() PrintMessage(4, math.random(50,74).." %") timer.Simple(0.4, function() PrintMessage(4, math.random(75,99).." %") end) end) end) end) - timer.Simple( 2, function() if ply:GetPos():DistToSqr(ent:GetPos())<2500 then RemoveHandcuff(ent, ply, 1) ply:StripWeapon("Handcuffs_lockpick") end end ) + timer.Simple( 2, function() if ply:GetPos():DistToSqr(ent:GetPos())<2500 then RemoveHandcuff(ent, ply, 1) ply:StripWeapon("guigui_handcuffs_lockpick") end end ) end end end From a489f192ec56edce3c73e11499079040f0028ff2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillaume=20B=C3=89NIT?= Date: Tue, 18 Apr 2017 13:17:34 +0200 Subject: [PATCH 2/3] Fix #4 --- lua/autorun/client/guigui_handcuffs.lua | 2 ++ lua/autorun/server/guigui_handcuffs.lua | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/autorun/client/guigui_handcuffs.lua b/lua/autorun/client/guigui_handcuffs.lua index 2f61186..27d2de1 100644 --- a/lua/autorun/client/guigui_handcuffs.lua +++ b/lua/autorun/client/guigui_handcuffs.lua @@ -1,3 +1,5 @@ +CreateConVar("Handcuffs_ShowHeadText", "0", {FCVAR_ARCHIVE, FCVAR_SERVER_CAN_EXECUTE, FCVAR_REPLICATED }, "Show head text") + surface.CreateFont("HandcuffsHUD", { font = "Arial", size = 50, antialias = true, diff --git a/lua/autorun/server/guigui_handcuffs.lua b/lua/autorun/server/guigui_handcuffs.lua index 0478362..ad991d7 100644 --- a/lua/autorun/server/guigui_handcuffs.lua +++ b/lua/autorun/server/guigui_handcuffs.lua @@ -1,4 +1,3 @@ -CreateConVar("Handcuffs_ShowHeadText", "0", {FCVAR_ARCHIVE, FCVAR_SERVER_CAN_EXECUTE, FCVAR_REPLICATED }, "Show head text") CreateConVar("Handcuffs_StrictWeapons", "0", {FCVAR_ARCHIVE, FCVAR_SERVER_CAN_EXECUTE, FCVAR_REPLICATED }, "Strict weapons") function Handcuff(ent, ply) From c00e47a48cbfbe3afb13cadc7ccc15f8f1dbf3f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillaume=20B=C3=89NIT?= Date: Tue, 18 Apr 2017 13:21:40 +0200 Subject: [PATCH 3/3] Fix percent and text --- lua/autorun/client/guigui_handcuffs.lua | 3 ++- lua/weapons/guigui_handcuffs.lua | 4 ++-- lua/weapons/guigui_handcuffs_lockpick.lua | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lua/autorun/client/guigui_handcuffs.lua b/lua/autorun/client/guigui_handcuffs.lua index 27d2de1..5638955 100644 --- a/lua/autorun/client/guigui_handcuffs.lua +++ b/lua/autorun/client/guigui_handcuffs.lua @@ -1,6 +1,7 @@ CreateConVar("Handcuffs_ShowHeadText", "0", {FCVAR_ARCHIVE, FCVAR_SERVER_CAN_EXECUTE, FCVAR_REPLICATED }, "Show head text") -surface.CreateFont("HandcuffsHUD", { font = "Arial", +surface.CreateFont("HandcuffsHUD", { + font = "Arial", size = 50, antialias = true, weight = 750, diff --git a/lua/weapons/guigui_handcuffs.lua b/lua/weapons/guigui_handcuffs.lua index 68eedd8..2c342de 100644 --- a/lua/weapons/guigui_handcuffs.lua +++ b/lua/weapons/guigui_handcuffs.lua @@ -42,7 +42,7 @@ function SWEP:PrimaryAttack() local wep = ent:GetActiveWeapon():GetClass() if wep == "guigui_handcuffed" then return false end if guigui_handcuff_wep(wep) then - timer.Simple(0.4, function() PrintMessage(4, math.random(0,24).." %") timer.Simple(0.4, function() PrintMessage(4, math.random(25,79).." %") timer.Simple(0.4, function() PrintMessage(4, math.random(50,74).." %") timer.Simple(0.4, function() PrintMessage(4, math.random(75,99).." %") end) end) end) end) + ply:PrintMessage(4, "...") timer.Simple(2, function() if ply:GetPos():DistToSqr(ent:GetPos())<2500 and ply:GetActiveWeapon():GetClass() == "guigui_handcuffs" then Handcuff(ent, ply) end end) end end @@ -57,7 +57,7 @@ function SWEP:SecondaryAttack() if ent:IsValid() and ent:IsPlayer() then local wep = ent:GetActiveWeapon():GetClass() if wep == "guigui_handcuffed" then - timer.Simple(0.4, function() PrintMessage(4, math.random(0,24).." %") timer.Simple(0.4, function() PrintMessage(4, math.random(25,79).." %") timer.Simple(0.4, function() PrintMessage(4, math.random(50,74).." %") timer.Simple(0.4, function() PrintMessage(4, math.random(75,99).." %") end) end) end) end) + ply:PrintMessage(4, "...") timer.Simple(2, function() if ply:GetPos():DistToSqr(ent:GetPos())<2500 and ply:GetActiveWeapon():GetClass() == "guigui_handcuffs" then RemoveHandcuff(ent, ply) end end) end end diff --git a/lua/weapons/guigui_handcuffs_lockpick.lua b/lua/weapons/guigui_handcuffs_lockpick.lua index 20808bb..b38ce39 100644 --- a/lua/weapons/guigui_handcuffs_lockpick.lua +++ b/lua/weapons/guigui_handcuffs_lockpick.lua @@ -42,8 +42,8 @@ function SWEP:PrimaryAttack() if ent:IsValid() and ent:IsPlayer() then local wep = ent:GetActiveWeapon():GetClass() if wep == "guigui_handcuffed" then - timer.Simple(0.4, function() PrintMessage(4, math.random(0,24).." %") timer.Simple(0.4, function() PrintMessage(4, math.random(25,79).." %") timer.Simple(0.4, function() PrintMessage(4, math.random(50,74).." %") timer.Simple(0.4, function() PrintMessage(4, math.random(75,99).." %") end) end) end) end) - timer.Simple( 2, function() if ply:GetPos():DistToSqr(ent:GetPos())<2500 then RemoveHandcuff(ent, ply, 1) ply:StripWeapon("guigui_handcuffs_lockpick") end end ) + ply:PrintMessage(4, "...") + timer.Simple(2, function() if ply:GetPos():DistToSqr(ent:GetPos())<2500 then RemoveHandcuff(ent, ply, 1) ply:StripWeapon("guigui_handcuffs_lockpick") end end ) end end end