Skip to content

Commit

Permalink
Fix percent and text
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeBenit committed Apr 18, 2017
1 parent a489f19 commit c00e47a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion lua/autorun/client/guigui_handcuffs.lua
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
4 changes: 2 additions & 2 deletions lua/weapons/guigui_handcuffs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lua/weapons/guigui_handcuffs_lockpick.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c00e47a

Please sign in to comment.