Functions (Player Control) - ShadowBonnieRUS/GMOD-SB_Advanced_Nextbots_Base GitHub Wiki

Here are descriptions for functions used in base in cl_playercontrol.lua, playercontrol.lua and drive.lua files.

Marks help


🔸 NEXTBOT:ModifyPlayerControlHUD

Allows modify HUD with bot's info.

Arguments: 6

  1. number | X HUD coordinate.
  2. number | Y HUD coordinate.
  3. number | Width of health bar.
  4. number | Height of health bar.
  5. number | X HUD coordinate of crosshair.
  6. number | Y HUD coordinate of crosshair.

Returns: 1

  1. bool | Return true to prevent drawing default HUD.

✏️⚠️🔹🔸 NEXTBOT:GetEntityDriveMode

Sets right drive mode.


🔹🔸 NEXTBOT:ModifyControlPlayerButtons

Allows modify buttons when bot controlled by player.

Arguments: 1

  1. number | Buttons from MoveData.

Returns: 1

  1. any | Return modified buttons (number) or nothing/nil/false to not change.

🔹 NEXTBOT:IsControlledByPlayer

Returns true if bot currently controlled by player.

Arguments: 0
Returns: 1

  1. bool | Is bot controlled by player or not.

🔹 NEXTBOT:StartControlByPlayer

Starts bot control by player.

Arguments: 1

  1. Player | Who will control bot.

Returns: 0


🔹 NEXTBOT:StopControlByPlayer

Stops bot control by player.

Arguments: 0
Returns: 0


🔹 NEXTBOT:ControlPlayerKeyDown

Returns true if key of player who controls bot is downed.

Arguments: 1

  1. number | Key. See IN_ Enums.

Returns: 1

  1. bool | Key is downed.

🔹 NEXTBOT:ControlPlayerKeyPressed

Returns true if player who controls bot has pressed given key at this bot behaviour tick.

Arguments: 1

  1. number | Key. See IN_ Enums.

Returns: 1

  1. bool | Key is downed.