Advertisement
Guest User

Untitled

a guest
Jul 11th, 2014
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.84 KB | None | 0 0
  1. //===================================================================================
  2. //      Player Core
  3. //          by swarchkruppzo
  4. //===================================================================================
  5. local clamp = math.Clamp
  6.  
  7. local function CheckForPlayer( entity )
  8.     if IsValid(entity) then
  9.         if entity:IsPlayer() then
  10.             return true
  11.         end
  12.     end
  13.     return false
  14. end
  15.  
  16.  
  17. __e2setcost(10)
  18. e2function number entity:plyHasGod()
  19.     if !CheckForPlayer(this) then return end
  20.     if this:HasGodMode() then return 1 else return 0 end
  21. end
  22. e2function number entity:plyGetArmor()
  23.     if !CheckForPlayer(this) then return end
  24.     return this:Armor()
  25. end
  26. e2function number entity:plyGetHealth()
  27.     if !CheckForPlayer(this) then return end
  28.     return this:Health()
  29. end
  30. e2function number entity:plyGetMaxSpeed()
  31.     if !CheckForPlayer(this) then return end
  32.     return this:GetMaxSpeed()
  33. end
  34. e2function number entity:plyGetJumpPower()
  35.     if !CheckForPlayer(this) then return end
  36.     return this:GetJumpPower()
  37. end
  38. e2function number entity:plyGetRunSpeed()
  39.     if !CheckForPlayer(this) then return end
  40.     return this:GetRunSpeed()
  41. end
  42. e2function number entity:plyGetCrouchWalkSpeed()
  43.     if !CheckForPlayer(this) then return end
  44.     return this:GetCrouchedWalkSpeed()
  45. end
  46. e2function void entity:plySetFOV( number fov )
  47.     if !CheckForPlayer(this) then return end
  48.     this:SetFOV( fov )
  49. end
  50. e2function number entity:plyGetFOV()
  51.     if !CheckForPlayer(this) then return end
  52.     return this:GetFOV()
  53. end
  54. e2function number entity:plyHasWeapon( string class )
  55.     if !CheckForPlayer(this) then return end
  56.     if this:HasWeapon( class ) then return 1 else return 0 end
  57. end
  58.  
  59. __e2setcost(100)
  60. e2function void entity:plySetArmor( number armor )
  61.     if !CheckForPlayer(this) then return end
  62.     this:SetArmor( armor )
  63. end
  64. e2function void entity:plySetHealth( number health )
  65.     if !CheckForPlayer(this) then return end
  66.     this:SetHealth( health )
  67. end
  68. e2function void entity:plySetAmmo( number count, string ammo )
  69.     if !CheckForPlayer(this) then return end
  70.     this:SetAmmo( count, ammo )
  71. end
  72. e2function void entity:plySetModel( string model )
  73.     if !CheckForPlayer(this) then return end
  74.     this:SetModel( model )
  75. end
  76. e2function void entity:plyFreeze( number bool )
  77.     if !CheckForPlayer(this) then return end
  78.     if bool == 1 then this:Lock() else this:UnLock() end
  79. end
  80. e2function void entity:plyNoclip( number bool )
  81.     if !CheckForPlayer(this) then return end
  82.     if bool == 1 then this:SetMoveType(MOVETYPE_NOCLIP) else this:SetMoveType(MOVETYPE_WALK) end
  83. end
  84.  
  85. __e2setcost(80)
  86. e2function void entity:plySetMaxSpeed( number count )
  87.     if !CheckForPlayer(this) then return end
  88.     this:SetMaxSpeed( count )
  89. end
  90. e2function void entity:plySetJumpPower( number count )
  91.     if !CheckForPlayer(this) then return end
  92.     count = clamp( count, 0, 5000 )
  93.     if count <= 0 then count = 160 end
  94.     this:SetJumpPower( count )
  95. end
  96. e2function void entity:plySetRunSpeed( number count )
  97.     if !CheckForPlayer(this) then return end
  98.     count = clamp( count, 0, 10000 )
  99.     if count <= 0 then count = 500 end
  100.     this:SetRunSpeed( count )
  101. end
  102. e2function void entity:plySetCrouchWalkSpeed( number count )
  103.     if !CheckForPlayer(this) then return end
  104.     count = clamp( count, 0.01, 10 )
  105.     this:SetCrouchedWalkSpeed( count )
  106. end
  107.  
  108. __e2setcost(250)
  109. e2function void entity:plyGod( number bool )
  110.     if !CheckForPlayer(this) then return end
  111.     if bool == 1 then this:GodEnable() else this:GodDisable() end
  112. end
  113. e2function void entity:plyKill()
  114.     if !CheckForPlayer(this) then return end
  115.     this:Kill()
  116. end
  117. e2function void entity:plyGiveWeapon( string classname )
  118.     if !CheckForPlayer(this) then return end
  119.     this:Give( classname )
  120. end
  121. e2function void entity:plyStripWeapons()
  122.     if !CheckForPlayer(this) then return end
  123.     this:StripWeapons()
  124. end
  125. e2function void entity:plyStripWeapon( string classname )
  126.     if !CheckForPlayer(this) then return end
  127.     this:StripWeapon( classname )
  128. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement