Advertisement
Guest User

Auto Wanted v2 - I forgot to remove a line last time, rip.

a guest
Mar 2nd, 2015
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.33 KB | None | 0 0
  1. local config = config or {}
  2.  
  3. config.WantedTime = 5 // Time in Minutes on how long a player should be wanted for attacking a CP.
  4. config.WantedReason = "Is wanted for attacking a Police Officer" // It auto-includes the attackers name. So it will be: Bot01 Is wanted for attacking a Police Officer
  5. config.UnWanted = true // If you don't want them to be un-wanted after config.WantedTime then set this to false.
  6. config.EscapedText = "You have escaped, you are no longer wanted."
  7.  
  8.  
  9. function ILostThisFile3Times(victim, attacker)
  10.  
  11. if !attacker:IsPlayer() then return end
  12.  
  13. if !victim:IsPlayer() then return end
  14.  
  15. if attacker:IsPlayer() and victim:isCP() then
  16.    attacker:setDarkRPVar("wanted", true)
  17.    attacker:setDarkRPVar("wantedReason", config.WantedReason)
  18.    
  19.    for _,ply in pairs(player.GetAll()) do
  20.        ply:PrintMessage(HUD_PRINTCENTER, attacker:Nick().." "..config.WantedReason)
  21.     --  ply:ChatPrint(attacker:Nick().." "..config.WantedReason)
  22.    end
  23.        
  24. if config.UnWanted == true and attacker:isWanted() then
  25.        timer.Simple(config.WantedTime, function()
  26.        attacker:ChatPrint(config.EscapedText or "You have Escaped")
  27.         attacker:setDarkRPVar("wanted", false)
  28.        
  29.        end)
  30. end
  31.        
  32.        
  33.        
  34.    end
  35. end
  36. hook.Add("PlayerHurt", "IForgotToSaveThisFile3Times", ILostThisFile3Times)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement