MCiLuZiioNz

Untitled

Apr 8th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.08 KB | None | 0 0
  1.       if client:IsTraitor() and GetRoundState() == ROUND_ACTIVE then
  2.          target_traitor = ent:IsTraitor() -- We only set this to true IF THE CLIENT TRAITOR
  3.         -- This means Traitors will still see fake Detectives as Traitors
  4.       end
  5.  
  6.         -- I overrode IsDetective(), fake Detectives will return true
  7.         -- and because we only set target_traitor is the client is a traitor, then everyone else should see fake detectives
  8.       target_detective = GetRoundState() > ROUND_PREP and ent:IsDetective() or false
  9.  
  10.     -- ... some lines of code that are irrelevant
  11.  
  12.     -- You can see, we check if target_traitor first. If it's true, short circuit evaluation means we don't care about
  13.     -- target_detective.
  14.     if target_traitor or target_detective then
  15.       surface.SetTexture(ring_tex)
  16.  
  17.     -- Again we check if target_traitor first, so Traitor players will still always see fake Detectives as Traitors
  18.       if target_traitor then
  19.          surface.SetDrawColor(255, 0, 0, 200)
  20.       else
  21.          surface.SetDrawColor(0, 0, 255, 220)
  22.       end
  23.       surface.DrawTexturedRect(x-32, y-32, 64, 64)
  24.    end
Advertisement
Add Comment
Please, Sign In to add comment