C# 클래스 GarrysModLuaShared.Classes.CUserCmd

A class used to store the player inputs, such as mouse movement, view angles, IN buttons pressed and analog movement, the data from this class is then transfered to a CMoveData during actual movement simulation. Can be modified during CreateMove, StartCommand hook and used in read only with SetupMove hook and Player.GetCurrentCommand.
상속: LuaObject
파일 보기 프로젝트 열기: OmegaExtern/gmod-csharp-binary-module

공개 메소드들

메소드 설명
CUserCmd ( int index ) : GarrysModLuaShared.Enums
ClearButtons ( ) : void

Removes all keys from the command. Doesn't prevent movement, see ClearMovement for this.

ClearMovement ( ) : void

Clears the movement from the command.

CommandNumber ( ) : double

Returns an increasing number representing the index of the user cmd. The value returned is occasionally 0 inside CreateMove hook, so it's advised to check for a non-zero value if you wish to get the correct number.

GetButtons ( ) : IN

Returns a bitflag indicating which buttons are pressed.

GetForwardMove ( ) : double

The speed the client wishes to move forward with, negative if the clients wants to move backwards.

GetImpulse ( ) : double

Gets the current impulse from the client, usually 0.

GetMouseWheel ( ) : double

Returns the scroll delta as whole number.

GetMouseX ( ) : int

Returns the delta of the angular horizontal mouse movement of the player.

GetMouseY ( ) : int

Returns the delta of the angular vertical mouse movement of the player.

GetSideMove ( ) : double

The speed the client wishes to move sideways with, positive if it wants to move right, negative if it wants to move left.

GetUpMove ( ) : double

The speed the client wishes to move up with, negative if the clients wants to move down.

GetViewAngles ( ) : Angle

Gets the direction the client wants to move in.

KeyDown ( IN key ) : bool

Returns true if the specified button(s) is pressed.

RemoveKey ( IN button ) : void

Removed a key bit from the current key bitflag.

SelectWeapon ( Weapon weapon ) : void

Forces the associated player to select a weapon. This is used internally in the default HL2 weapon selection HUD. NOTE: Due to a bug, you will have to force this function to run until Player.GetActiveWeapon returns the chosen weapon, although it is also advised to add a time limit in case the switch fails for any reason. NOTE 2: This is the ideal function to use to create a custom weapon selection HUD, as it allows prediction to run properly for WEAPON.Deploy hook and PlayerSwitchWeapon hook.

SetButtons ( IN buttons ) : void

Sets the buttons bitflag.

SetForwardMove ( double speed ) : void

Sets speed the client wishes to move forward with, negative if the clients wants to move backwards.

SetImpulse ( double impulse ) : void

Sets the impulse to be send together with the command.

SetMouseWheel ( double delta ) : void

Sets the scroll delta.

SetMouseX ( int x ) : void

Sets the delta of the angular horizontal mouse movement of the player.

SetMouseY ( int y ) : void

Sets the delta of the angular vertical mouse movement of the player.

SetSideMove ( double speed ) : void

Sets speed the client wishes to move sidewards with, positive to move right, negative to move left.

SetUpMove ( double speed ) : void

Sets speed the client wishes to move upwards with, negative to move down.

SetViewAngles ( Angle viewAngle ) : void

Sets the direction the client wants to move in.

TickCount ( ) : double

Returns tick count since joining the server. Sometimes returns 0.

메소드 상세

CUserCmd() 공개 메소드

public CUserCmd ( int index ) : GarrysModLuaShared.Enums
index int
리턴 GarrysModLuaShared.Enums

ClearButtons() 공개 메소드

Removes all keys from the command. Doesn't prevent movement, see ClearMovement for this.
public ClearButtons ( ) : void
리턴 void

ClearMovement() 공개 메소드

Clears the movement from the command.
public ClearMovement ( ) : void
리턴 void

CommandNumber() 공개 메소드

Returns an increasing number representing the index of the user cmd. The value returned is occasionally 0 inside CreateMove hook, so it's advised to check for a non-zero value if you wish to get the correct number.
public CommandNumber ( ) : double
리턴 double

GetButtons() 공개 메소드

Returns a bitflag indicating which buttons are pressed.
public GetButtons ( ) : IN
리턴 IN

GetForwardMove() 공개 메소드

The speed the client wishes to move forward with, negative if the clients wants to move backwards.
public GetForwardMove ( ) : double
리턴 double

GetImpulse() 공개 메소드

Gets the current impulse from the client, usually 0.
public GetImpulse ( ) : double
리턴 double

GetMouseWheel() 공개 메소드

Returns the scroll delta as whole number.
public GetMouseWheel ( ) : double
리턴 double

GetMouseX() 공개 메소드

Returns the delta of the angular horizontal mouse movement of the player.
public GetMouseX ( ) : int
리턴 int

GetMouseY() 공개 메소드

Returns the delta of the angular vertical mouse movement of the player.
public GetMouseY ( ) : int
리턴 int

GetSideMove() 공개 메소드

The speed the client wishes to move sideways with, positive if it wants to move right, negative if it wants to move left.
public GetSideMove ( ) : double
리턴 double

GetUpMove() 공개 메소드

The speed the client wishes to move up with, negative if the clients wants to move down.
public GetUpMove ( ) : double
리턴 double

GetViewAngles() 공개 메소드

Gets the direction the client wants to move in.
public GetViewAngles ( ) : Angle
리턴 Angle

KeyDown() 공개 메소드

Returns true if the specified button(s) is pressed.
public KeyDown ( IN key ) : bool
key IN Bitflag representing which button to check.
리턴 bool

RemoveKey() 공개 메소드

Removed a key bit from the current key bitflag.
public RemoveKey ( IN button ) : void
button IN Bitflag to be removed from the key bitflag.
리턴 void

SelectWeapon() 공개 메소드

Forces the associated player to select a weapon. This is used internally in the default HL2 weapon selection HUD. NOTE: Due to a bug, you will have to force this function to run until Player.GetActiveWeapon returns the chosen weapon, although it is also advised to add a time limit in case the switch fails for any reason. NOTE 2: This is the ideal function to use to create a custom weapon selection HUD, as it allows prediction to run properly for WEAPON.Deploy hook and PlayerSwitchWeapon hook.
public SelectWeapon ( Weapon weapon ) : void
weapon Weapon The weapon entity to select.
리턴 void

SetButtons() 공개 메소드

Sets the buttons bitflag.
public SetButtons ( IN buttons ) : void
buttons IN Bitflag representing which buttons are "down".
리턴 void

SetForwardMove() 공개 메소드

Sets speed the client wishes to move forward with, negative if the clients wants to move backwards.
public SetForwardMove ( double speed ) : void
speed double The new speed to request.
리턴 void

SetImpulse() 공개 메소드

Sets the impulse to be send together with the command.
public SetImpulse ( double impulse ) : void
impulse double The impulse to send.
리턴 void

SetMouseWheel() 공개 메소드

Sets the scroll delta.
public SetMouseWheel ( double delta ) : void
delta double The scroll delta.
리턴 void

SetMouseX() 공개 메소드

Sets the delta of the angular horizontal mouse movement of the player.
public SetMouseX ( int x ) : void
x int Angular horizontal move delta.
리턴 void

SetMouseY() 공개 메소드

Sets the delta of the angular vertical mouse movement of the player.
public SetMouseY ( int y ) : void
y int Angular vertical move delta.
리턴 void

SetSideMove() 공개 메소드

Sets speed the client wishes to move sidewards with, positive to move right, negative to move left.
public SetSideMove ( double speed ) : void
speed double The new speed to request.
리턴 void

SetUpMove() 공개 메소드

Sets speed the client wishes to move upwards with, negative to move down.
public SetUpMove ( double speed ) : void
speed double The new speed to request.
리턴 void

SetViewAngles() 공개 메소드

Sets the direction the client wants to move in.
public SetViewAngles ( Angle viewAngle ) : void
viewAngle Angle New view angles.
리턴 void

TickCount() 공개 메소드

Returns tick count since joining the server. Sometimes returns 0.
public TickCount ( ) : double
리턴 double