HolyLib Wiki

CBaseClient

CBaseClient

Metatable function Description
__index Used to find the functions on the metatable and access saved variables
__newindex Used to allow one to save variables on the object

Methods

CBaseClient:ActivatePlayer()
CBaseClient:AddToQueueList()
Removes the client from the server's client list and adds it to the internal queue client list. Does nothing if there is currently no active server.
Throws an error if the client is a HLTV client.
CBaseClient:AddToServerList()
Adds the client to the server's client list and removes it from the internal queue client list. Does nothing if there is currently no active server.
Throws an error if the client is a HLTV client.
CBaseClient:Clear()
Clear the client/frees the CBaseClient for the next player to use.
Know what your doing when using it!
CBaseClient:ClientPrint( string message )
Prints the given message into the client's console. It won't add \n to the end, you have to add it yourself.
CBaseClient:DemoRestart()
CBaseClient:Disconnect( string reason, boolean silent = false, boolean nogameevent = false )
Disconnects the client.
CBaseClient:ExecuteStringCommand( string command )
Executes the given command as if the client himself ran it.
CBaseClient:FillServerInfo( number playerSlot = -1 )
Fills a SVC_ServerInfo net message with the server's info and sends it to the client.
CBaseClient:FireGameEvent( IGameEvent event )
Fires/sends the given gameevent to this specific client. If the gameevent module is disabled, it will throw a lua error!
CBaseClient:FreeBaselines()
string CBaseClient:GetAddress( )
Returns the address as ip:port This function errors if the client doesn't have a valid CNetChannel
number CBaseClient:GetAvgLatency( number flow )
This function errors if the client doesn't have a valid CNetChannel
number CBaseClient:GetAvgLoss( number flow )
This function errors if the client doesn't have a valid CNetChannel
number CBaseClient:GetChokedPackets( )
This function errors if the client doesn't have a valid CNetChannel
This function errors if the client doesn't have a valid CNetChannel
number CBaseClient:GetClearTime( )
This function errors if the client doesn't have a valid CNetChannel
number CBaseClient:GetClientChallenge( )
Returns the client challenge number.
number CBaseClient:GetConnectTime( )
This function errors if the client doesn't have a valid CNetChannel
number CBaseClient:GetFriendsID( )
Returns the friend id.
string CBaseClient:GetFriendsName( )
Returns the friend name.
number CBaseClient:GetInReliableState( )
This function errors if the client doesn't have a valid CNetChannel
number CBaseClient:GetInSequenceNr( )
This function errors if the client doesn't have a valid CNetChannel
number CBaseClient:GetLastReceived( )
This function errors if the client doesn't have a valid CNetChannel
number CBaseClient:GetMaxAckTickCount( )
This function errors if the client doesn't have a valid CNetChannel
This function errors if the client doesn't have a valid CNetChannel
string CBaseClient:GetName( )
Returns the name of the client.
This function errors if the client doesn't have a valid CNetChannel
number CBaseClient:GetOutSequenceNr( )
This function errors if the client doesn't have a valid CNetChannel
This function errors if the client doesn't have a valid CNetChannel
number CBaseClient:GetPlayerSlot( )
Returns the slot of the client.
Use this for gameserver.GetClient and sourcetv.GetClient.
This function errors if the client doesn't have a valid CNetChannel
number CBaseClient:GetRate( )
This function errors if the client doesn't have a valid CNetChannel
number CBaseClient:GetSignonState( )
string CBaseClient:GetSteamID( )
Returns the steamid of the client.
Returns the reliable stream used by net messages. This function errors if the client doesn't have a valid CNetChannel
number CBaseClient:GetStreamSocket( )
This function errors if the client doesn't have a valid CNetChannel
Returns the unreliable stream used by net messages. This function errors if the client doesn't have a valid CNetChannel
bf_write CBaseClient:GetStreamVoice( )
Returns the voice stream used by the voice chat. This function errors if the client doesn't have a valid CNetChannel
table CBaseClient:GetTable( )
Returns the lua table used by newindex and index
number CBaseClient:GetTimeConnected( )
This function errors if the client doesn't have a valid CNetChannel
number CBaseClient:GetTimeout( )
This function errors if the client doesn't have a valid CNetChannel
number CBaseClient:GetUpdateRate( )
number CBaseClient:GetUserID( )
Returns the userid of the client.
boolean CBaseClient:HasNetChannel( )
Returns true if the client has a valid CNetChannel.
number CBaseClient:HasQueuedPackets( )
This function errors if the client doesn't have a valid CNetChannel
CBaseClient:Inactivate()
Inactivates the client.
Know what your doing when using it!
boolean CBaseClient:IsActive( )
boolean CBaseClient:IsConnected( )
boolean CBaseClient:IsFakeClient( )
boolean CBaseClient:IsHearingClient( number playerSlot )
Works like voicechat.IsHearingClient but only takes the direct player slot.
boolean CBaseClient:IsHLTV( )
boolean CBaseClient:IsInvalid( )
Returns true if the client is invalid.
Unlike CBaseClient:IsValid, which obeys gameserver_rawclients, this function always reflects whether the underlying client pointer is truly invalid.
boolean CBaseClient:IsProximityHearingClient( number playerSlot )
Works like voicechat.IsProximityHearingClient but only takes the direct player slot.
boolean CBaseClient:IsSpawned( )
boolean CBaseClient:IsValid( )
Returns true if the client is valid.
CBaseClient:MoveIntoClient( CBaseClient target )
Moves this client's state into the given target client. Throws an error if either client is a HLTV client.
CBaseClient:OnRequestFullUpdate()
Forces the client to go through a full update(also fires the gameevent).
boolean CBaseClient:ProcessStream( )
Processes all pending incoming net messages.
Returns true on success. This function errors if the client doesn't have a valid CNetChannel
CBaseClient:Reconnect()
Reconnects the client. Unlike the reconnect command, the client won't lose/change their slot.
CBaseClient:RemoveFromAllLists()
Removes the client from the server's client list and from the internal queue client list. Does nothing if there is currently no active server.
Throws an error if the client is a HLTV client.
boolean CBaseClient:SendLua( string code )
Sends the given code to the client to be executed.
CBaseClient:SendNetMsg( number type, string name, bf_write buffer )
Same as gameserver.BroadcastMessage but it only sends it to the specific player.
CBaseClient:SendServerInfo()
CBaseClient:SendSignonData()
CBaseClient:SetMaxBufferSize( boolean reliable = false, number bytes, boolean voice = false )
Resizes the specified buffer to the given size in bytes. This function errors if the client doesn't have a valid CNetChannel
All data inside that stream is discarded, make sure everything was sent out.
CBaseClient:SetMaxRoutablePayloadSize( number playloadSize )
CBaseClient:SetName( string name )
Sets the new name of the client.
CBaseClient:SetRate( number rate )
CBaseClient:SetReportThisFakeClient( boolean reportClient = false )
boolean CBaseClient:SetSignonState( number signOnState, number spawnCount, boolean rawSet = false )
Sets the SignOnState for the given client. This function does normally not directly set the SignOnState.
Instead it calls the responsible function for the given SignOnState like for SIGNONSTATE_PRESPAWN it will call SpawnPlayer on the client.
Set the rawSet to true if you want to directly set the SignOnState.
boolean CBaseClient:SetSteamID( string steamID64 )
Sets the SteamID of the client.
CBaseClient:SetTimeout( number seconds )
Sets the time in seconds before the client is marked as timing out. This function errors if the client doesn't have a valid CNetChannel
CBaseClient:SetUpdateRate( number rate )
CBaseClient:SetUserCVar( string convar, string value )
boolean CBaseClient:ShouldSendMessages( number tick )
CBaseClient:SpawnPlayer()
boolean CBaseClient:Transmit( boolean onlyReliable = false, number fragments = -1, boolean freeSubChannels = false )
Transmit any pending data to the client.
Returns true on success. This function errors if the client doesn't have a valid CNetChannel Transmitting data to the client causes the client's prediction to reset and cause prediction errors!
CBaseClient:UpdateAcknowledgedFramecount( number frameCount )
CBaseClient:UpdateSendState()
CBaseClient:UpdateUserSettings( bf_write buffer )
CBaseClient:WriteGameSounds( bf_write buffer )
Writes the client's pending game sounds into the given buffer. If the bitbuf module is disabled, it will throw a lua error!