Skip to content

Commit

Permalink
你说的对
Browse files Browse the repository at this point in the history
  • Loading branch information
cH1yoi committed Dec 21, 2024
1 parent 0e8e104 commit 66e8d30
Show file tree
Hide file tree
Showing 5 changed files with 356 additions and 83 deletions.
Binary file modified addons/sourcemod/plugins/optional/l4d_tank_control_eq.smx
Binary file not shown.
42 changes: 37 additions & 5 deletions addons/sourcemod/scripting/include/l4d_tank_control_eq.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
#endif
#define _l4d_tank_control_eq_included

/**
* @brief Retrieves the selected tank's client index.
*
* @return Client id of the selected tank, -1 if no one is selected.
*/
native int GetTankSelection();

/**
Expand Down Expand Up @@ -40,19 +35,46 @@ native ArrayList GetTankPool();

/**
* @brief Sets the tank to a specific player
*
* @param steamId Steam ID of the player to set as tank
* @return True if successful, false otherwise
*/
native bool SetTank(const char[] steamId);

/**
* @brief Gets the current tank queue
*
* @return ArrayList containing steam IDs in queue order, must be freed by caller.
*/
native ArrayList GetTankQueue();

/**
* @brief Adds a player to the tank queue at specified position
*
* @param steamId Steam ID of the player to add
* @param position Position in queue (0 = end, 1 = first, etc)
* @return True if successful, false if player already in queue
*/
native bool AddToTankQueue(const char[] steamId, int position = 0);

/**
* @brief Removes a player from the tank queue
*
* @param steamId Steam ID of the player to remove
* @return True if successful, false if player not in queue
*/
native bool RemoveFromTankQueue(const char[] steamId);

/**
* @brief Called when plugin tries to offer tank to a bot
*
* @param sQueuedTank Steam ID of queued tank
*/
forward void TankControl_OnTryOfferingTankBot(char sQueuedTank[64]);

/**
* @brief Called when a tank is selected
*
* @param sQueuedTank Steam ID of selected tank
*/
forward void TankControl_OnTankSelection(char sQueuedTank[64]);
Expand All @@ -64,16 +86,23 @@ forward void OnTankControlReset();

/**
* @brief Called when choosing tank
*
* @return Plugin_Handled to override tank selection, Plugin_Continue to allow default behavior
*/
forward Action OnChooseTank();

/**
* @brief Called when tank is given to a player
*
* @param steamId Steam ID of the player who received tank
*/
forward void OnTankGiven(const char[] steamId);

/**
* @brief Called when the tank queue is modified
*/
forward void OnTankQueueChanged();

public SharedPlugin __pl_l4d_tank_control_eq =
{
name = "l4d_tank_control_eq",
Expand All @@ -91,7 +120,10 @@ public void __pl_l4d_tank_control_eq_SetNTVOptional()
MarkNativeAsOptional("GetTankSelection");
MarkNativeAsOptional("GetWhosHadTank");
MarkNativeAsOptional("GetWhosNotHadTank");
MarkNativeAsOptional("GetTankQueue");
MarkNativeAsOptional("ClearWhosHadTank");
MarkNativeAsOptional("AddToTankQueue");
MarkNativeAsOptional("RemoveFromTankQueue");
MarkNativeAsOptional("GetTankPool");
MarkNativeAsOptional("SetTank");
}
Expand Down
Loading

0 comments on commit 66e8d30

Please sign in to comment.