Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Feature cfc/fancy-print #7

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions lua/starfall/libs_sh/ply.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ local weapon_methods = instance.Types.Weapon.Methods
local ply_meta, punwrap = instance.Types.Player, instance.Types.Player.Unwrap
local builtins_library = instance.env


local function getPly( this )
local ent = punwrap( this )

Expand All @@ -22,8 +21,7 @@ end
local function canUsePlyCore( ply )
return ply:IsAdmin()
end



--- Gets the slow walking speed of a player. This is when you're using +WALK.
-- @return Slow-walk speed of the player
function player_methods:getSlowWalkSpeed()
Expand Down Expand Up @@ -89,5 +87,12 @@ function builtins_library.getAmmoID( name )
return game.GetAmmoID( name )
end

--- Prints coloured text to the client specified if it meets permissisions ( dont know how to check permissions yet, please let me know! )
-- @param
function player_methods:fPrint( self, cColour, cText )
checktype( self, ply_meta )
local ply = getPly( self )
if player() == ply then chat.AddText( cColour, cText ) end
end

end