Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //===================================================================================
- // Player Core
- // by swarchkruppzo
- //===================================================================================
- local clamp = math.Clamp
- local function CheckForPlayer( entity )
- if IsValid(entity) then
- if entity:IsPlayer() then
- return true
- end
- end
- return false
- end
- __e2setcost(10)
- e2function number entity:plyHasGod()
- if !CheckForPlayer(this) then return end
- if this:HasGodMode() then return 1 else return 0 end
- end
- e2function number entity:plyGetArmor()
- if !CheckForPlayer(this) then return end
- return this:Armor()
- end
- e2function number entity:plyGetHealth()
- if !CheckForPlayer(this) then return end
- return this:Health()
- end
- e2function number entity:plyGetMaxSpeed()
- if !CheckForPlayer(this) then return end
- return this:GetMaxSpeed()
- end
- e2function number entity:plyGetJumpPower()
- if !CheckForPlayer(this) then return end
- return this:GetJumpPower()
- end
- e2function number entity:plyGetRunSpeed()
- if !CheckForPlayer(this) then return end
- return this:GetRunSpeed()
- end
- e2function number entity:plyGetCrouchWalkSpeed()
- if !CheckForPlayer(this) then return end
- return this:GetCrouchedWalkSpeed()
- end
- e2function void entity:plySetFOV( number fov )
- if !CheckForPlayer(this) then return end
- this:SetFOV( fov )
- end
- e2function number entity:plyGetFOV()
- if !CheckForPlayer(this) then return end
- return this:GetFOV()
- end
- e2function number entity:plyHasWeapon( string class )
- if !CheckForPlayer(this) then return end
- if this:HasWeapon( class ) then return 1 else return 0 end
- end
- __e2setcost(100)
- e2function void entity:plySetArmor( number armor )
- if !CheckForPlayer(this) then return end
- this:SetArmor( armor )
- end
- e2function void entity:plySetHealth( number health )
- if !CheckForPlayer(this) then return end
- this:SetHealth( health )
- end
- e2function void entity:plySetAmmo( number count, string ammo )
- if !CheckForPlayer(this) then return end
- this:SetAmmo( count, ammo )
- end
- e2function void entity:plySetModel( string model )
- if !CheckForPlayer(this) then return end
- this:SetModel( model )
- end
- e2function void entity:plyFreeze( number bool )
- if !CheckForPlayer(this) then return end
- if bool == 1 then this:Lock() else this:UnLock() end
- end
- e2function void entity:plyNoclip( number bool )
- if !CheckForPlayer(this) then return end
- if bool == 1 then this:SetMoveType(MOVETYPE_NOCLIP) else this:SetMoveType(MOVETYPE_WALK) end
- end
- __e2setcost(80)
- e2function void entity:plySetMaxSpeed( number count )
- if !CheckForPlayer(this) then return end
- this:SetMaxSpeed( count )
- end
- e2function void entity:plySetJumpPower( number count )
- if !CheckForPlayer(this) then return end
- count = clamp( count, 0, 5000 )
- if count <= 0 then count = 160 end
- this:SetJumpPower( count )
- end
- e2function void entity:plySetRunSpeed( number count )
- if !CheckForPlayer(this) then return end
- count = clamp( count, 0, 10000 )
- if count <= 0 then count = 500 end
- this:SetRunSpeed( count )
- end
- e2function void entity:plySetCrouchWalkSpeed( number count )
- if !CheckForPlayer(this) then return end
- count = clamp( count, 0.01, 10 )
- this:SetCrouchedWalkSpeed( count )
- end
- __e2setcost(250)
- e2function void entity:plyGod( number bool )
- if !CheckForPlayer(this) then return end
- if bool == 1 then this:GodEnable() else this:GodDisable() end
- end
- e2function void entity:plyKill()
- if !CheckForPlayer(this) then return end
- this:Kill()
- end
- e2function void entity:plyGiveWeapon( string classname )
- if !CheckForPlayer(this) then return end
- this:Give( classname )
- end
- e2function void entity:plyStripWeapons()
- if !CheckForPlayer(this) then return end
- this:StripWeapons()
- end
- e2function void entity:plyStripWeapon( string classname )
- if !CheckForPlayer(this) then return end
- this:StripWeapon( classname )
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement