Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local config = config or {}
- config.WantedTime = 5 // Time in Minutes on how long a player should be wanted for attacking a CP.
- 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
- config.UnWanted = true // If you don't want them to be un-wanted after config.WantedTime then set this to false.
- config.EscapedText = "You have escaped, you are no longer wanted."
- function ILostThisFile3Times(victim, attacker)
- if !attacker:IsPlayer() then return end
- if !victim:IsPlayer() then return end
- if attacker:IsPlayer() and victim:isCP() then
- attacker:setDarkRPVar("wanted", true)
- attacker:setDarkRPVar("wantedReason", config.WantedReason)
- for _,ply in pairs(player.GetAll()) do
- ply:PrintMessage(HUD_PRINTCENTER, attacker:Nick().." "..config.WantedReason)
- -- ply:ChatPrint(attacker:Nick().." "..config.WantedReason)
- end
- if config.UnWanted == true and attacker:isWanted() then
- timer.Simple(config.WantedTime, function()
- attacker:ChatPrint(config.EscapedText or "You have Escaped")
- attacker:setDarkRPVar("wanted", false)
- end)
- end
- end
- end
- hook.Add("PlayerHurt", "IForgotToSaveThisFile3Times", ILostThisFile3Times)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement