<commit_before>/**
 * [INS] Supply Point Manager
 *
 * This plugin will set the supply points (tokens) for players on connect to server.
 * Will determine and give highest possible supply to player, based on settings completed.
 *
 * 0.3 = Fixed translations.
 * 0.2 = "ALPHA" Added Join and Rejoin cvars
 * 0.1 = Initial build. CVar and Token testing
*/

#include <sourcemod>

new ConVar:g_S_Enabled;
new ConVar:g_S_Base_Points;
new ConVar:g_S_Rejoin;
new ConVar:g_S_Join;
new Handle:g_S_KV_Players;

public Plugin myinfo =
{
  name = "[INS] Supply Point Manager",
  author = "GiZZoR",
  description = "Set player supply points",
  version = "0.3",
  url = "https://github.com/GiZZoR/ins-sm-plugins"
};

public void OnPluginStart()
{
  // Hook to start of round, for storing players Supply
  HookEvent("round_start", S_RoundStarted);

  // Hook (& Command) to explicitly set a player's supply points. Applies _before_ player spawns in world.
  HookEvent("player_team", Event_PlayerTeam, EventHookMode_Post);
  RegAdminCmd("sm_supply", Command_Supply, ADMFLAG_BAN,"Sets the supply points of a target");

  // "Boolean": sm_supply_enabled; Enable/disable plugin. Default: 1 (Enabled)
  g_S_Enabled = CreateConVar("sm_supply_enabled" , "1", "Sets whether the plugin is enabled", FCVAR_NONE, true, 0.0, true, 1.0);

  // "Int": sm_supply_base; Number of supply points to give players. Default: 12
  g_S_Base_Points = CreateConVar("sm_supply_base" , "12", "Base / Starting supply points", FCVAR_NONE);

  // "Boolean": sm_supply_restore; Enable/disable restoring player's gained supply points. Default: 1 (Enabled)
  g_S_Rejoin = CreateConVar("sm_supply_restore", "1", "Restore points gained by player on reconnect", FCVAR_NONE, true, 0.0, true, 1.0);

  // "Int": sm_supply_join; Enable/disable setting supply points for new players. Default: 0 (Disabled)
  // Options:
  // 0 - Disabled (Default)
  // 1 - Give new player base supply as set in sm_supply_base. Note: You may want to set this per game mode in server_<mode>.cfg
  // 2 - Give new player the same supply as lowest member in team (Useful for multiple rounds of coop play)
  // 3 - Give new player the team average of supply points (sum all players supply points divided by players)
  g_S_Join = CreateConVar("sm_supply_join", "0", "0 - Disabled; 1 - sm_supply_base; 2 - Team Lowest; 3 - Team Average", FCVAR_NONE, true, 0.0, true, 3.0);
  LoadTranslations("common.phrases");<commit_msg>Enabled tracking<commit_after>/**
 * [INS] Supply Point Manager
 *
 * This plugin will set the supply points (tokens) for players on connect to server.
 * Will determine and give highest possible supply to player, based on settings completed.
 *
 * 0.3 = Fixed translations.
 * 0.2 = "ALPHA" Added Join and Rejoin cvars
 * 0.1 = Initial build. CVar and Token testing
*/

#include <sourcemod>

new ConVar:g_S_Enabled;
new ConVar:g_S_Base_Points;
new ConVar:g_S_Rejoin;
new ConVar:g_S_Join;
new Handle:g_S_KV_Players;

public Plugin myinfo =
{
  name = "[INS] Supply Point Manager",
  author = "GiZZoR",
  description = "Set player supply points",
  version = "0.3",
  url = "https://github.com/GiZZoR/ins-sm-plugins"
};

public void OnPluginStart()
{
  // Hook to start of round, for storing players Supply
  HookEvent("round_start", S_RoundStarted);

  // Hook (& Command) to explicitly set a player's supply points. Applies _before_ player spawns in world.
  HookEvent("player_team", Event_PlayerTeam, EventHookMode_Post);
  RegAdminCmd("sm_supply", Command_Supply, ADMFLAG_BAN,"Sets the supply points of a target");

  // "Boolean": sm_supply_enabled; Enable/disable plugin. Default: 1 (Enabled)
  g_S_Enabled = CreateConVar("sm_supply_enabled" , "1", "Sets whether the plugin is enabled", FCVAR_NONE, true, 0.0, true, 1.0);

  // "Int": sm_supply_base; Number of supply points to give players. Default: 12
  g_S_Base_Points = CreateConVar("sm_supply_base" , "12", "Base / Starting supply points", FCVAR_NOTIFY);

  // "Boolean": sm_supply_restore; Enable/disable restoring player's gained supply points. Default: 1 (Enabled)
  g_S_Rejoin = CreateConVar("sm_supply_restore", "1", "Restore points gained by player on reconnect", FCVAR_NONE, true, 0.0, true, 1.0);

  // "Int": sm_supply_join; Enable/disable setting supply points for new players. Default: 0 (Disabled)
  // Options:
  // 0 - Disabled (Default)
  // 1 - Give new player base supply as set in sm_supply_base. Note: You may want to set this per game mode in server_<mode>.cfg
  // 2 - Give new player the same supply as lowest member in team (Useful for multiple rounds of coop play)
  // 3 - Give new player the team average of supply points (sum all players supply points divided by players)
  g_S_Join = CreateConVar("sm_supply_join", "0", "0 - Disabled; 1 - sm_supply_base; 2 - Team Lowest; 3 - Team Average", FCVAR_NONE, true, 0.0, true, 3.0);
  LoadTranslations("common.phrases");
{'fraction_non_alphanumeric': 0.10986318153971819, 'fraction_numerical': 0.015519705942413723, 'mean_word_length': 4.323913043478261, 'pattern_counts': {'":': 8, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6425656', 'n_tokens_mistral': 1649, 'n_tokens_neox': 1572, 'n_words': 562}