CUserCmd/TickCount

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(Added details for when this is useful clientside)
m (Revised TickCount note)
Line 1: Line 1:
 
{{Func
 
{{Func
|Description=Returns tick count since joining the server. Sometimes returns 0.
+
|Description=Returns tick count since joining the server. This will always return 0 for bots.
This will return 0 for bots.
+
  
When this is 0 on the client in means that that {{Type|CUserCmd}} is predicted. If you are trying to do CUserCmd:SetWhatever() on the client in a hook like CreateMove you should keep doing so till TickCount returns a number other than 0.
+
Returns 0 clientside during prediction calls. If you are trying to use CUserCmd:SetFoo() on the client in a movement or command hook, keep doing so till TickCount returns a non-zero number to maintain prediction.
 
|Realm=Shared
 
|Realm=Shared
 
|IsClass=Yes
 
|IsClass=Yes
Line 9: Line 8:
 
{{Ret
 
{{Ret
 
|type=number
 
|type=number
|desc=The amount of ticks passed since joining the server
+
|desc=The amount of ticks passed since joining the server.
 
}}
 
}}

Revision as of 03:28, 21 November 2016

 CUserCmd:TickCount( )

Description

Returns tick count since joining the server. This will always return 0 for bots.

Returns 0 clientside during prediction calls. If you are trying to use CUserCmd:SetFoo() on the client in a movement or command hook, keep doing so till TickCount returns a non-zero number to maintain prediction.

Returns

number

The amount of ticks passed since joining the server.
Personal tools
Navigation