Advertisement
Guest User

Untitled

a guest
Jun 26th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. function FGod( ply, dmginfo )
  2. if(ply:GetNetworkedVar("FGod") == 1) then
  3. dmginfo:ScaleDamage( 0 )
  4. end
  5. end
  6. hook.Add("EntityTakeDamage", "FGod", FGod)
  7.  
  8. hook.Add("PhysgunDrop", "ply_physgunfreeze", function(pl, ent)
  9. hook.Remove( "PhysgunDrop", "ulxPlayerDrop" )
  10.  
  11. ent._physgunned = false
  12.  
  13. if( ent:IsPlayer() && ( pl:IsUserGroup( "superadmin" ) or pl:IsUserGroup( "YourSecondAdminGroupHere" )) ) then --Mark add the admin groups here, just add insert this again "or pl:IsUserGroup( "YetAnotherGroup" )"
  14.  
  15.  
  16. if(pl:KeyDown(IN_ATTACK2)) then
  17. ent:Freeze(true)
  18. ent:SetNetworkedVar("FGod", 1)
  19. else
  20. ent:Freeze(false)
  21. ent:SetNetworkedVar("FGod", 0)
  22. ent:SetMoveType(MOVETYPE_WALK)
  23. end
  24.  
  25.  
  26.  
  27. if SERVER then
  28.  
  29. if !ent:Alive() then
  30. ent:Spawn()
  31. self:PlayerSpawn(ent)
  32. ent:SetPos(pl:GetEyeTrace().HitPos)
  33. end
  34. end
  35.  
  36. else
  37. ent:Freeze(false)
  38. ent:SetNetworkedVar("FGod", 0)
  39. ent:SetMoveType(MOVETYPE_WALK)
  40.  
  41. return
  42. end
  43. end)
  44.  
  45. hook.Add( "PhysgunPickup", "ply_physgunned", function(pl, ent)
  46. ent._physgunned = true
  47. end)
  48.  
  49. function playerDies( pl, weapon, killer )
  50. if(pl._physgunned) then
  51. return false
  52. else
  53. return true
  54. end
  55. end
  56. hook.Add( "CanPlayerSuicide", "playerNoDeath", playerDies )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement