TheDenVxUA

Untitled

Jul 31st, 2019
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.06 KB | None | 0 0
  1. AddCSLuaFile( "cl_init.lua" )
  2. AddCSLuaFile( "shared.lua" )
  3. include('shared.lua')
  4.  
  5. function ENT:Initialize()
  6.     self.Entity:SetModel("models/props_c17/Frame002a.mdl")
  7.     self.Entity:SetModelScale(0.55,0)
  8.     self.Entity:PhysicsInit( SOLID_VPHYSICS )
  9.     self.Entity:SetMoveType( MOVETYPE_VPHYSICS )
  10.     self.Entity:SetSolid( SOLID_VPHYSICS )
  11.     self.Entity:SetUseType( SIMPLE_USE )
  12.     self.Bounty = 0
  13. end
  14.  
  15. function ENT:UpdateReward(Bounty)
  16.     net.Start("UpdateBountyPoster")
  17.         net.WriteEntity(self)
  18.         net.WriteFloat(Bounty)
  19.     net.Broadcast()
  20.     self.Bounty = Bounty
  21. end
  22.  
  23. function ENT:Use(activator, caller )
  24.     if self.Entity.Touched and self.Entity.Touched > CurTime() then return ; end
  25.     self.Entity.Touched = CurTime() + 1;
  26.        
  27.     local Player = self.Player
  28.     if !IsValid(Player) then self:Remove() return end
  29.     if self.PlacedBy and self.PlacedBy == activator then
  30.         DarkRP.notify(activator, 1, 4, "You can't start a bounty placed by yourself!")
  31.         return
  32.     end
  33.    
  34.     if activator.Bounty then
  35.         DarkRP.notify(activator, 1, 4, "You have already started a bounty, finish it, then come back!")
  36.         return
  37.     end
  38.    
  39.     local PBounty = activator.PBountyCD[Player:UniqueID()]
  40.     if PBounty and PBounty > CurTime() then
  41.         local TimeLeft = math.Round(PBounty-CurTime())
  42.         DarkRP.notify(activator, 1, 4, "You can start a bounty on this player again in: " .. TimeLeft .. " seconds.")
  43.         return
  44.     end
  45.    
  46.     if activator:CanBountyHunt() and Player != activator then  
  47.         activator.Bounty = Player
  48.         Player.HuntedBy = activator
  49.         net.Start("SendBounty")
  50.             net.WriteString(Player:Nick())
  51.             net.WriteFloat(Player.Kills)
  52.             net.WriteString(Player:GetModel())
  53.             net.WriteFloat(self.Bounty)
  54.         net.Send(activator)
  55.        
  56.         DarkRP.notify(activator, 1, 4, "Bounty on " .. Player:Nick() .. "s head started.")
  57.         hook.Call("bh_startbounty", GAMEMODE, activator, Player)
  58.        
  59.         Player:CleanUpPosters()  
  60.     end
  61. end
  62.  
  63. function ENT:Think()
  64. end
  65.  
  66. function ENT:Touch(TouchEnt)
  67.     if self.Entity.Touched and self.Entity.Touched > CurTime() then return ; end
  68.     self.Entity.Touched = CurTime() + 1;
  69. end
Advertisement
Add Comment
Please, Sign In to add comment