Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma semicolon 1
- #pragma tabsize 0
- #define PLUGIN_VERSION "0.3.0"
- #define DMG_FALL (1 << 5)
- #define HIDEHUD_RADAR 1 << 12
- #define DMG_HEADSHOT (1 << 30)
- #define MAX_BUTTONS 25
- #include <sourcemod>
- #include <SDKTools>
- #include <csgocolors>
- #include <sdkhooks>
- #undef REQUIRE_EXTENSIONS
- #include <cstrike>
- #define REQUIRE_EXTENSIONS
- #define MAX_SPAWNS 99999
- /* Console variables */
- ConVar cvar_dm_enabled;
- ConVar cvar_dm_valvedm;
- ConVar cvar_dm_welcomemsg;
- ConVar cvar_dm_free_for_all;
- ConVar cvar_dm_hide_radar;
- ConVar cvar_dm_display_panel;
- ConVar cvar_dm_display_panel_damage;
- ConVar cvar_dm_sounds_bodyshots;
- ConVar cvar_dm_sounds_headshots;
- ConVar cvar_dm_headshot_only;
- ConVar cvar_dm_headshot_only_allow_world;
- ConVar cvar_dm_headshot_only_allow_knife;
- ConVar cvar_dm_headshot_only_allow_taser;
- ConVar cvar_dm_headshot_only_allow_nade;
- ConVar cvar_dm_remove_objectives;
- ConVar cvar_dm_respawning;
- ConVar cvar_dm_respawn_time;
- ConVar cvar_dm_gun_menu_mode;
- ConVar cvar_dm_los_spawning;
- ConVar cvar_dm_los_attempts;
- ConVar cvar_dm_spawn_distance;
- ConVar cvar_dm_spawn_time;
- ConVar cvar_dm_no_knife_damage;
- ConVar cvar_dm_remove_weapons;
- ConVar cvar_dm_replenish_ammo;
- ConVar cvar_dm_replenish_clip;
- ConVar cvar_dm_replenish_reserve;
- ConVar cvar_dm_replenish_grenade;
- ConVar cvar_dm_replenish_hegrenade;
- ConVar cvar_dm_replenish_grenade_kill;
- ConVar cvar_dm_hp_start;
- ConVar cvar_dm_hp_max;
- ConVar cvar_dm_hp_kill;
- ConVar cvar_dm_hp_hs;
- ConVar cvar_dm_hp_knife;
- ConVar cvar_dm_hp_nade;
- ConVar cvar_dm_hp_messages;
- ConVar cvar_dm_ap_max;
- ConVar cvar_dm_ap_kill;
- ConVar cvar_dm_ap_hs;
- ConVar cvar_dm_ap_knife;
- ConVar cvar_dm_ap_nade;
- ConVar cvar_dm_ap_messages;
- ConVar cvar_dm_nade_messages;
- ConVar cvar_dm_armor;
- ConVar cvar_dm_armor_full;
- ConVar cvar_dm_zeus;
- ConVar cvar_dm_nades_incendiary;
- ConVar cvar_dm_nades_molotov;
- ConVar cvar_dm_nades_decoy;
- ConVar cvar_dm_nades_flashbang;
- ConVar cvar_dm_nades_he;
- ConVar cvar_dm_nades_smoke;
- Handle mp_ct_default_primary;
- Handle mp_t_default_primary;
- Handle mp_ct_default_secondary;
- Handle mp_t_default_secondary;
- Handle mp_t_default_melee;
- Handle mp_ct_default_melee;
- Handle mp_startmoney;
- Handle mp_playercashawards;
- Handle mp_teamcashawards;
- Handle mp_friendlyfire;
- Handle mp_autokick;
- Handle mp_tkpunish;
- Handle mp_teammates_are_enemies;
- Handle ff_damage_reduction_bullets;
- Handle ff_damage_reduction_grenade;
- Handle ff_damage_reduction_other;
- Handle ammo_grenade_limit_default;
- Handle ammo_grenade_limit_flashbang;
- Handle ammo_grenade_limit_total;
- Handle mp_roundtime_defuse;
- Handle mp_warmuptime;
- Handle mp_warmup;
- Handle g_timer = INVALID_HANDLE;
- bool removeWeapons=0;
- int backup_mp_startmoney;
- int backup_mp_playercashawards;
- int backup_mp_teamcashawards;
- int backup_mp_friendlyfire;
- int backup_mp_autokick;
- int backup_mp_tkpunish;
- int backup_mp_teammates_are_enemies;
- int backup_ammo_grenade_limit_default;
- int backup_ammo_grenade_limit_flashbang;
- int backup_ammo_grenade_limit_total;
- new g_LastButtons[MAXPLAYERS+1];
- float backup_ff_damage_reduction_bullets;
- float backup_ff_damage_reduction_grenade;
- float backup_ff_damage_reduction_other;
- bool enabled = true;
- bool valveDM;
- bool welcomemsg;
- bool ffa=true;
- bool hideradar;
- bool displayPanel;
- bool displayPanelDamage;
- bool bdSounds;
- bool hsSounds;
- bool hsOnly;
- bool hsOnly_AllowWorld;
- bool hsOnly_AllowKnife;
- bool hsOnly_AllowTaser;
- bool hsOnly_AllowNade;
- bool removeObjectives;
- bool roundEnded = false;
- /* Health Variables */
- int startHP;
- int maxHP;
- int HPPerKill;
- int HPPerHeadshotKill;
- int HPPerKnifeKill;
- int HPPerNadeKill;
- int defaultColor[4] = { 255, 255, 255, 255 };
- int tColor[4] = { 255, 0, 0, 200 };
- int ctColor[4] = { 0, 0, 255, 200 };
- new Handle:sm_deathmatch_primary = INVALID_HANDLE;
- new Handle:sm_deathmatch_secondary = INVALID_HANDLE;
- new Handle:sm_deathmatch_blockdrop = INVALID_HANDLE;
- new Handle:sm_deathmatch_noscope = INVALID_HANDLE;
- new Handle:sm_deathmatch_health = INVALID_HANDLE;
- new Handle:sm_deathmatch_armor = INVALID_HANDLE;
- new Handle:sm_deathmatch_respawn_time = INVALID_HANDLE;
- //spawn vars
- float spawnDistanceFromEnemies;
- float spawnProtectionTime;
- float respawnTime;
- bool respawning;
- bool lineOfSightSpawning;
- int lineOfSightAttempts;
- int spawnPointCount = 0;
- int spawnWeaponPointCount = 0;
- bool inEditMode = false;
- bool spawnPointOccupied[MAX_SPAWNS] = {false, ...};
- float spawnPositions[MAX_SPAWNS][3];
- float spawnAngles[MAX_SPAWNS][3];
- float spawnWeaponPositions[40][3];
- float spawnWeaponAngles[40][3];
- int weaponCount;
- ArrayList weapons;
- float eyeOffset[3] = { 0.0, 0.0, 64.0 }; /* CSGO offset. */
- float spawnPointOffset[3] = { 0.0, 0.0, 20.0 };
- int lastEditorSpawnPoint[MAXPLAYERS + 1] = { -1, ... };
- char primaryWeapon[MAXPLAYERS + 1][24];
- char secondaryWeapon[MAXPLAYERS + 1][24];
- int infoMessageCount[MAXPLAYERS + 1] = { 2, ... };
- bool firstWeaponSelection[MAXPLAYERS + 1] = { true, ... };
- bool weaponsGivenThisRound[MAXPLAYERS + 1] = { false, ... };
- bool newWeaponsSelected[MAXPLAYERS + 1] = { false, ... };
- bool rememberChoice[MAXPLAYERS + 1] = { false, ... };
- bool playerMoved[MAXPLAYERS + 1] = { false, ... };
- /* Spawn stats */
- int numberOfPlayerSpawns = 0;
- int losSearchAttempts = 0;
- int losSearchSuccesses = 0;
- int losSearchFailures = 0;
- int distanceSearchAttempts = 0;
- int distanceSearchSuccesses = 0;
- int distanceSearchFailures = 0;
- int spawnPointSearchFailures = 0;
- //
- int i_PlayerCount;
- bool b_MaxClients;
- public Plugin myinfo =
- {
- name = "Skin Deathmatch",
- author = "ElectricStalin",
- description = "",
- version = PLUGIN_VERSION,
- url = "",
- };
- public OnPluginStart()
- {
- //ServerCommand("mp_warmuptime 999999");
- RetrieveVariables();
- SetNoSpawnWeapons();
- sm_deathmatch_primary = CreateConVar("sm_deathmatch_primary", "", "ID of the primary weapon (Default: weapon_awp)");
- sm_deathmatch_secondary = CreateConVar("sm_deathmatch_secondary", "weapon_glock", "ID of the primary weapon (Default: weapon_revolver)");
- sm_deathmatch_blockdrop = CreateConVar("sm_deathmatch_blockdrop", "0", "Block the drop of weapon (1 = yes, 0 = no)(Default: 1)");
- sm_deathmatch_noscope = CreateConVar("sm_deathmatch_noscope", "0", "Noscope mode (1 = yes, 0 = no)(Default: 0)");
- sm_deathmatch_health = CreateConVar("sm_deathmatch_health", "100", "Players Health on spawn (Default: 100)");
- sm_deathmatch_armor = CreateConVar("sm_deathmatch_armor", "0", "Player Armor on spawn (Default: 0)");
- sm_deathmatch_respawn_time = CreateConVar("sm_deathmatch_respawn_time", "3.0", "Time between the player's death and his respawn (Default: 3.0)");
- /* Hook Events */
- HookEvent("player_team", Event_PlayerTeam);
- HookEvent("round_prestart", Event_RoundPrestart, EventHookMode_PostNoCopy);
- HookEvent("round_end", Event_RoundEnd, EventHookMode_PostNoCopy);
- HookEvent("player_spawn", Event_PlayerSpawn, EventHookMode_Post);
- HookEvent("player_death", Event_PlayerDeath);
- HookEvent("bomb_pickup", Event_BombPickup);
- HookEvent("round_start", OnRoundStart, EventHookMode_PostNoCopy);
- AddCommandListener(OnCommandDrop, "drop");
- /* Let's not waste our time here... */
- if(GetEngineVersion() != Engine_CSGO)
- {
- SetFailState("ERROR: This plugin is designed only for CS:GO.");
- }
- /* Load translations for multi-language */
- LoadTranslations("deathmatch.phrases");
- LoadTranslations("common.phrases");
- /* Create spawns directory if necessary. */
- char spawnsPath[PLATFORM_MAX_PATH];
- BuildPath(Path_SM, spawnsPath, sizeof(spawnsPath), "configs/deathmatch/spawns");
- if (!DirExists(spawnsPath))
- CreateDirectory(spawnsPath, 711);
- /* Find Offsets */
- /*ownerOffset = FindSendPropInfo("CBaseCombatWeapon", "m_hOwnerEntity");
- healthOffset = FindSendPropInfo("CCSPlayerResource", "m_iHealth");
- armorOffset = FindSendPropInfo("CCSPlayer", "m_ArmorValue");
- helmetOffset = FindSendPropInfo("CCSPlayer", "m_bHasHelmet");
- ammoTypeOffset = FindSendPropInfo("CBaseCombatWeapon", "m_iPrimaryAmmoType");
- ammoOffset = FindSendPropInfo("CCSPlayer", "m_iAmmo");
- ragdollOffset = FindSendPropInfo("CCSPlayer", "m_hRagdoll");*/
- /* Create arrays to store available weapons loaded by config */
- /*primaryWeaponsAvailable = CreateArray(24);
- secondaryWeaponsAvailable = CreateArray(10);
- weaponSkipMap = new StringMap();*/
- /* Create trie to store menu names for weapons */
- //BuildWeaponMenuNames();
- /* Create trie to store weapon limits and counts */
- //weaponLimits = CreateTrie();
- //weaponCounts = CreateTrie();
- /* Create Menus */
- //optionsMenu1 = BuildOptionsMenu(true);
- //optionsMenu2 = BuildOptionsMenu(false);
- /* Create Console Variables */
- //CreateConVar("dm_m5_version", PLUGIN_VERSION, PLUGIN_NAME, FCVAR_SPONLY | FCVAR_REPLICATED | FCVAR_NOTIFY | FCVAR_DONTRECORD);
- cvar_dm_enabled = CreateConVar("dm_enabled", "1", "Enable Deathmatch.");
- cvar_dm_valvedm = CreateConVar("dm_enable_valve_deathmatch", "0", "Enable compatibility for Valve's Deathmatch (game_type 1 & game_mode 2) or Custom (game_type 3 & game_mode 0).");
- cvar_dm_welcomemsg = CreateConVar("dm_welcomemsg", "1", "Display a message saying that your server is running Deathmatch.");
- cvar_dm_free_for_all = CreateConVar("dm_free_for_all", "0", "Free for all mode.");
- cvar_dm_hide_radar = CreateConVar("dm_hide_radar", "0", "Hides the radar from players.");
- cvar_dm_display_panel = CreateConVar("dm_display_panel", "0", "Display a panel showing health of the victim.");
- cvar_dm_display_panel_damage = CreateConVar("dm_display_panel_damage", "0", "Display a panel showing damage done to a player. Requires dm_display_panel set to 1.");
- cvar_dm_sounds_bodyshots = CreateConVar("dm_sounds_bodyshots", "1", "Enable the sounds of bodyshots.");
- cvar_dm_sounds_headshots = CreateConVar("dm_sounds_headshots", "1", "Enable the sounds of headshots.");
- cvar_dm_headshot_only = CreateConVar("dm_headshot_only", "0", "Headshot only mode.");
- cvar_dm_headshot_only_allow_world = CreateConVar("dm_headshot_only_allow_world", "0", "Enable world damage during headshot only mode.");
- cvar_dm_headshot_only_allow_knife = CreateConVar("dm_headshot_only_allow_knife", "0", "Enable knife damage during headshot only mode.");
- cvar_dm_headshot_only_allow_taser = CreateConVar("dm_headshot_only_allow_taser", "0", "Enable taser damage during headshot only mode.");
- cvar_dm_headshot_only_allow_nade = CreateConVar("dm_headshot_only_allow_nade", "0", "Enable grenade damage during headshot only mode.");
- cvar_dm_remove_objectives = CreateConVar("dm_remove_objectives", "1", "Remove objectives (disables bomb sites, and removes c4 and hostages).");
- cvar_dm_respawning = CreateConVar("dm_respawning", "1", "Enable respawning.");
- cvar_dm_respawn_time = CreateConVar("dm_respawn_time", "2.0", "Respawn time.");
- cvar_dm_gun_menu_mode = CreateConVar("dm_gun_menu_mode", "1", "Gun menu mode. 1) Enabled. 2) Primary weapons only. 3) Secondary weapons only. 4) Random weapons only. 5) Disabled.");
- cvar_dm_los_spawning = CreateConVar("dm_los_spawning", "1", "Enable line of sight spawning. If enabled, players will be spawned at a point where they cannot see enemies, and enemies cannot see them.");
- cvar_dm_los_attempts = CreateConVar("dm_los_attempts", "10", "Maximum number of attempts to find a suitable line of sight spawn point.");
- cvar_dm_spawn_distance = CreateConVar("dm_spawn_distance", "0.0", "Minimum distance from enemies at which a player can spawn.");
- cvar_dm_spawn_time = CreateConVar("dm_spawn_time", "1.0", "Spawn protection time.");
- cvar_dm_no_knife_damage = CreateConVar("dm_no_knife_damage", "0", "Knives do NO damage to players.");
- cvar_dm_remove_weapons = CreateConVar("dm_remove_weapons", "1", "Remove ground weapons.");
- cvar_dm_replenish_ammo = CreateConVar("dm_replenish_ammo", "1", "Replenish ammo on reload.");
- cvar_dm_replenish_clip = CreateConVar("dm_replenish_clip", "0", "Replenish ammo clip on kill.");
- cvar_dm_replenish_reserve = CreateConVar("dm_replenish_reserve", "0", "Replenish ammo reserve on kill.");
- cvar_dm_replenish_grenade = CreateConVar("dm_replenish_grenade", "0", "Unlimited player grenades.");
- cvar_dm_replenish_hegrenade = CreateConVar("dm_replenish_hegrenade", "0", "Unlimited hegrenades.");
- cvar_dm_replenish_grenade_kill = CreateConVar("dm_replenish_grenade_kill", "0", "Give players their grenade back on successful kill.");
- cvar_dm_hp_start = CreateConVar("dm_hp_start", "100", "Spawn Health Points (HP).");
- cvar_dm_hp_max = CreateConVar("dm_hp_max", "100", "Maximum Health Points (HP).");
- cvar_dm_hp_kill = CreateConVar("dm_hp_kill", "5", "Health Points (HP) per kill.");
- cvar_dm_hp_hs = CreateConVar("dm_hp_hs", "10", "Health Points (HP) per headshot kill.");
- cvar_dm_hp_knife = CreateConVar("dm_hp_knife", "50", "Health Points (HP) per knife kill.");
- cvar_dm_hp_nade = CreateConVar("dm_hp_nade", "30", "Health Points (HP) per nade kill.");
- cvar_dm_hp_messages = CreateConVar("dm_hp_messages", "1", "Display HP messages.");
- cvar_dm_ap_max = CreateConVar("dm_ap_max", "100", "Maximum Armor Points (AP).");
- cvar_dm_ap_kill = CreateConVar("dm_ap_kill", "5", "Armor Points (AP) per kill.");
- cvar_dm_ap_hs = CreateConVar("dm_ap_hs", "10", "Armor Points (AP) per headshot kill.");
- cvar_dm_ap_knife = CreateConVar("dm_ap_knife", "50", "Armor Points (AP) per knife kill.");
- cvar_dm_ap_nade = CreateConVar("dm_ap_nade", "30", "Armor Points (AP) per nade kill.");
- cvar_dm_ap_messages = CreateConVar("dm_ap_messages", "1", "Display AP messages.");
- cvar_dm_nade_messages = CreateConVar("dm_nade_messages", "1", "Display grenade messages.");
- cvar_dm_armor = CreateConVar("dm_armor", "0", "Give players chest armor.");
- cvar_dm_armor_full = CreateConVar("dm_armor_full", "1", "Give players head and chest armor.");
- cvar_dm_zeus = CreateConVar("dm_zeus", "0", "Give players a taser.");
- cvar_dm_nades_incendiary = CreateConVar("dm_nades_incendiary", "0", "Number of incendiary grenades to give each player.");
- cvar_dm_nades_molotov = CreateConVar("dm_nades_molotov", "0", "Number of molotov grenades to give each player.");
- cvar_dm_nades_decoy = CreateConVar("dm_nades_decoy", "0", "Number of decoy grenades to give each player.");
- cvar_dm_nades_flashbang = CreateConVar("dm_nades_flashbang", "0", "Number of flashbang grenades to give each player.");
- cvar_dm_nades_he = CreateConVar("dm_nades_he", "0", "Number of HE grenades to give each player.");
- cvar_dm_nades_smoke = CreateConVar("dm_nades_smoke", "0", "Number of smoke grenades to give each player.");
- /* Load DM Config */
- LoadConfig();
- /* Listen For Client Commands */
- //AddCommandListener(Event_Say, "say");
- //AddCommandListener(Event_Say, "say_team");
- /* Hook Client Messages */
- //HookUserMessage(GetUserMessageId("TextMsg"), Event_TextMsg, true);
- //HookUserMessage(GetUserMessageId("HintText"), Event_HintText, true);
- //HookUserMessage(GetUserMessageId("RadioText"), Event_RadioText, true);
- /* Hook Events */
- HookEvent("player_team", Event_PlayerTeam);
- HookEvent("round_prestart", Event_RoundPrestart, EventHookMode_PostNoCopy);
- HookEvent("round_start", Event_RoundStart, EventHookMode_PostNoCopy);
- HookEvent("round_end", Event_RoundEnd, EventHookMode_PostNoCopy);
- HookEvent("player_spawn", Event_PlayerSpawn, EventHookMode_Post);
- HookEvent("player_death", Event_PlayerDeath);
- HookEvent("bomb_pickup", Event_BombPickup);
- /* Hook Sound Events */
- AddNormalSoundHook(view_as<NormalSHook>(Event_Sound));
- /* Create Global Timers */
- CreateTimer(0.5, UpdateSpawnPointStatus, INVALID_HANDLE, TIMER_REPEAT);
- /* Find Offsets */
- //g_iWeapons_Clip1Offset = FindSendPropInfo("CBaseCombatWeapon", "m_iClip1");
- /*if (g_iWeapons_Clip1Offset == -1)
- {
- SetFailState("[DM] Error - Unable to get offset for CBaseCombatWeapon::m_iClip1");
- }
- healthOffset = FindSendPropInfo("CCSPlayer", "m_iHealth");
- if (healthOffset == -1)
- {
- SetFailState("[DM] Error - Unable to get offset for CCSPlayer::m_iHealth");
- }
- armorOffset = FindSendPropInfo("CCSPlayer", "m_ArmorValue");
- if (armorOffset == -1)
- {
- SetFailState("[DM] Error - Unable to get offset for CCSPlayer::m_ArmorValue");
- }
- */
- /* SDK Hooks For Clients */
- for (int i = 1; i <= MaxClients; i++)
- {
- if (IsClientInGame(i))
- {
- OnClientPutInServer(i);
- }
- }
- /* Update and retrieve */
- RetrieveVariables();
- UpdateState();
- }
- public void OnMapStart()
- {
- //RetrieveVariables();
- EnableFFA();
- LoadMapConfig();
- SetBuyZones("Disable");
- i_PlayerCount = 0;
- b_MaxClients = false;
- }
- public void OnMapEnd()
- {
- i_PlayerCount = 0;
- b_MaxClients = false;
- }
- void LoadMapConfig()
- {
- char map[64];
- GetCurrentMap(map, sizeof(map));
- /*Player spawn config loading*/
- char path[PLATFORM_MAX_PATH];
- BuildPath(Path_SM, path, sizeof(path), "configs/sdm/spawns/%s.txt", map);
- spawnPointCount = 0;
- /* Open file */
- Handle file = OpenFile(path, "r");
- if (file == INVALID_HANDLE)
- return;
- /* Read file */
- char buffer[256];
- char parts[6][16];
- while (!IsEndOfFile(file) && ReadFileLine(file, buffer, sizeof(buffer)))
- {
- ExplodeString(buffer, " ", parts, 6, 16);
- spawnPositions[spawnPointCount][0] = StringToFloat(parts[0]);
- spawnPositions[spawnPointCount][1] = StringToFloat(parts[1]);
- spawnPositions[spawnPointCount][2] = StringToFloat(parts[2]);
- spawnAngles[spawnPointCount][0] = StringToFloat(parts[3]);
- spawnAngles[spawnPointCount][1] = StringToFloat(parts[4]);
- spawnAngles[spawnPointCount][2] = StringToFloat(parts[5]);
- spawnPointCount++;
- }
- /* Close file */
- CloseHandle(file);
- /*Weapons spawn config loading*/
- BuildPath(Path_SM, path, sizeof(path), "configs/sdm/weapon_spawn/%s.txt", map);
- spawnWeaponPointCount = 0;
- /* Open file */
- file = OpenFile(path, "r");
- if (file == INVALID_HANDLE)
- return;
- /* Read file */
- while (!IsEndOfFile(file) && ReadFileLine(file, buffer, sizeof(buffer)))
- {
- ExplodeString(buffer, " ", parts, 6, 16);
- spawnWeaponPositions[spawnWeaponPointCount][0] = StringToFloat(parts[0]);
- spawnWeaponPositions[spawnWeaponPointCount][1] = StringToFloat(parts[1]);
- spawnWeaponPositions[spawnWeaponPointCount][2] = StringToFloat(parts[2])+55.0;
- spawnWeaponAngles[spawnWeaponPointCount][0] = StringToFloat(parts[3]);
- spawnWeaponAngles[spawnWeaponPointCount][1] = StringToFloat(parts[4]);
- spawnWeaponAngles[spawnWeaponPointCount][2] = StringToFloat(parts[5]);
- spawnWeaponPointCount++;
- }
- /* Close file */
- CloseHandle(file);
- /*Weapons names config loading*/
- BuildPath(Path_SM, path, sizeof(path), "configs/sdm/weapons.txt");
- int count = 0;
- weapons = new ArrayList(ByteCountToCells(64));
- /* Open file */
- file = OpenFile(path, "r");
- if (file == INVALID_HANDLE)
- return;
- /* Read file */
- while (!IsEndOfFile(file) && ReadFileLine(file, buffer, sizeof(buffer)))
- {
- count++;
- weapons.PushString(buffer);
- LogError("Loaded from file '%s'",buffer);
- }
- /* Close file */
- CloseHandle(file);
- }
- public OnClientDisconnect_Post(client)
- {
- g_LastButtons[client] = 0;
- i_PlayerCount = i_PlayerCount - 1;
- }
- void RetrieveVariables()
- {
- /* Retrieve Native Console Variables */
- mp_ct_default_primary = FindConVar("mp_ct_default_primary");
- mp_t_default_primary = FindConVar("mp_t_default_primary");
- mp_ct_default_secondary = FindConVar("mp_ct_default_secondary");
- mp_t_default_secondary = FindConVar("mp_t_default_secondary");
- mp_t_default_melee = FindConVar("mp_t_default_melee");
- mp_ct_default_melee = FindConVar("mp_t_default_melee");
- mp_startmoney = FindConVar("mp_startmoney");
- mp_playercashawards = FindConVar("mp_playercashawards");
- mp_teamcashawards = FindConVar("mp_teamcashawards");
- mp_friendlyfire = FindConVar("mp_friendlyfire");
- mp_autokick = FindConVar("mp_autokick");
- mp_tkpunish = FindConVar("mp_tkpunish");
- mp_teammates_are_enemies = FindConVar("mp_teammates_are_enemies");
- ff_damage_reduction_bullets = FindConVar("ff_damage_reduction_bullets");
- ff_damage_reduction_grenade = FindConVar("ff_damage_reduction_grenade");
- ff_damage_reduction_other = FindConVar("ff_damage_reduction_other");
- ammo_grenade_limit_default = FindConVar("ammo_grenade_limit_default");
- ammo_grenade_limit_flashbang = FindConVar("ammo_grenade_limit_flashbang");
- ammo_grenade_limit_total = FindConVar("ammo_grenade_limit_total");
- mp_roundtime_defuse = FindConVar("mp_roundtime_defuse");
- mp_warmuptime = FindConVar("mp_warmuptime");
- mp_warmup = FindConVar("mp_warmup");
- /* Retrieve Native Console Variable Values */
- backup_mp_startmoney = GetConVarInt(mp_startmoney);
- backup_mp_playercashawards = GetConVarInt(mp_playercashawards);
- backup_mp_teamcashawards = GetConVarInt(mp_teamcashawards);
- backup_mp_friendlyfire = GetConVarInt(mp_friendlyfire);
- backup_mp_autokick = GetConVarInt(mp_autokick);
- backup_mp_tkpunish = GetConVarInt(mp_tkpunish);
- backup_mp_teammates_are_enemies = GetConVarInt(mp_teammates_are_enemies);
- backup_ff_damage_reduction_bullets = GetConVarFloat(ff_damage_reduction_bullets);
- backup_ff_damage_reduction_grenade = GetConVarFloat(ff_damage_reduction_grenade);
- backup_ff_damage_reduction_other = GetConVarFloat(ff_damage_reduction_other);
- backup_ammo_grenade_limit_default = GetConVarInt(ammo_grenade_limit_default);
- backup_ammo_grenade_limit_flashbang = GetConVarInt(ammo_grenade_limit_flashbang);
- backup_ammo_grenade_limit_total = GetConVarInt(ammo_grenade_limit_total);
- }
- public Action:OnCommandDrop(client, const String:command[], argc)
- {
- int BlockDrop = GetConVarInt(sm_deathmatch_blockdrop);
- if(BlockDrop == 1)
- return Plugin_Handled;
- return Plugin_Continue;
- }
- // Players Actions
- public OnClientPutInServer(client)
- {
- SDKHook(client, SDKHook_WeaponDrop, OnWeaponDrop);
- SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
- i_PlayerCount++;
- g_timer = CreateTimer(15.0, Timer_check, client, TIMER_REPEAT);
- //WarmupCheck();
- }
- stock bool IsValidClient(int client)
- {
- if (!(0 < client <= MaxClients)) return false;
- if (!IsClientInGame(client)) return false;
- return true;
- }
- public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon)
- {
- if (!IsClientConnected(client) || !IsClientInGame(client) || !IsPlayerAlive(client)) return Plugin_Continue;
- if(!(buttons & IN_ATTACK2))
- {
- return Plugin_Continue;
- }
- decl String:sWeapon[32];
- GetClientWeapon(client, sWeapon, sizeof(sWeapon));
- int NoScope = GetConVarInt(sm_deathmatch_noscope);
- if(NoScope == 1){
- if(StrEqual(sWeapon, "weapon_awp", false) || StrEqual(sWeapon, "weapon_scout", false))
- {
- buttons &= ~IN_ATTACK2;
- return Plugin_Changed;
- }
- }
- for (new i = 0; i < MAX_BUTTONS; i++)
- {
- new button = (1 << i);
- if ((buttons & button))
- {
- if (!(g_LastButtons[client] & button))
- {
- OnButtonPress(client, button);
- }
- }
- else if ((g_LastButtons[client] & button))
- {
- OnButtonRelease(client, button);
- }
- }
- g_LastButtons[client] = buttons;
- return Plugin_Continue;
- }
- //Hook Callbacks
- /////////////////////////////////////////
- public OnRoundStart(Handle:event, const String:name[], bool:dontBroadcast)
- {
- SpawnWeapons();
- }
- ////////////////////////////////////////////////////
- public Event_PlayerDeath(Event:event, const String:name[], bool:dontBroadcast)
- {
- if (enabled)
- {
- int client = GetClientOfUserId(event.GetInt("userid"));
- if (respawning)
- {
- CreateTimer(respawnTime, Respawn, GetClientSerial(client));
- }
- }
- }
- public void Event_PlayerTeam(Event event, const char[] name, bool dontBroadcast)
- {
- int client = GetClientOfUserId(event.GetInt("userid"));
- /* If the player joins spectator, close any open menu, and remove their ragdoll. */
- if ((client != 0) && (GetClientTeam(client) == CS_TEAM_SPECTATOR))
- {
- CancelClientMenu(client);
- }
- if (enabled && respawning)
- CreateTimer(respawnTime, Respawn, GetClientSerial(client));
- }
- public Action:OnTakeDamage(client, &attacker, &inflictor, &Float:damage, &damagetype)
- {
- if (damagetype & DMG_FALL)
- return Plugin_Handled;
- return Plugin_Continue;
- }
- public Action:OnWeaponDrop(client, weapon)
- {
- // или GetEdictClassname(index, weapon, sizeof(weapon));
- if (IsClientInGame(client) && IsPlayerAlive(client))
- return Plugin_Handled;
- return Plugin_Continue;
- }
- // Events
- /*public Action Event_PlayerSpawn(Handle event, char[] name, bool dontBroadcast)
- {
- int client = GetClientOfUserId(GetEventInt(event, "userid"));
- int PlayerHealth = GetConVarInt(sm_deathmatch_health);
- int PlayerArmor = GetConVarInt(sm_deathmatch_armor);
- SetEntityHealth(client, PlayerHealth);
- SetEntProp(client, Prop_Send, "m_ArmorValue", PlayerArmor, 1);
- CreateTimer(0.1, GiveGuns, client);
- }*/
- public Action Event_WeaponReload(Handle event, char[] name, bool dontBroadcast)
- {
- int client = GetClientOfUserId(GetEventInt(event, "userid"));
- new PlayerWeaponIndex;
- PlayerWeaponIndex = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
- SetEntProp(PlayerWeaponIndex, Prop_Send, "m_iPrimaryReserveAmmoCount", 100);
- return Plugin_Continue;
- }
- // Timer Callbacks
- public Action GiveGuns(Handle timer, any client)
- {
- /*decl String:PrimaryID[512];
- decl String:SecondaryID[512];
- GetConVarString(sm_deathmatch_primary, PrimaryID, sizeof(PrimaryID));
- GetConVarString(sm_deathmatch_secondary, SecondaryID, sizeof(SecondaryID));
- int HavePrimary = GetPlayerWeaponSlot(client, 0);
- if (HavePrimary != -1)
- {
- RemovePlayerItem(client, HavePrimary);
- RemoveEdict(HavePrimary);
- }
- int HaveSecondary = GetPlayerWeaponSlot(client, 1);
- if (HaveSecondary != -1)
- {
- RemovePlayerItem(client, HaveSecondary);
- RemoveEdict(HaveSecondary);
- }
- GivePlayerItem(client, PrimaryID, 0);
- GivePlayerItem(client, SecondaryID, 0);*/
- }
- public Action Event_RoundPrestart(Event event, const char[] name, bool dontBroadcast)
- {
- roundEnded = false;
- }
- public Action Event_RoundEnd(Event event, const char[] name, bool dontBroadcast)
- {
- roundEnded = true;
- }
- public Action:RespawnPlayer(Handle:Timer, any:client)
- {
- decl String:game[40];
- GetGameFolderName(game, sizeof(game));
- if(StrEqual(game, "cstrike") || StrEqual(game, "csgo"))
- {
- new team = GetClientTeam(client);
- if(team == 2 || team == 3)
- {
- CS_RespawnPlayer(client);
- }
- }
- }
- public Action Respawn(Handle timer, any serial)
- {
- int client = GetClientFromSerial(serial);
- if (!roundEnded && IsValidClient(client) && (GetClientTeam(client) != CS_TEAM_SPECTATOR) && !IsPlayerAlive(client))
- {
- /* We set this here rather than in Event_PlayerSpawn to catch the spawn sounds which occur before Event_PlayerSpawn is called (even with EventHookMode_Pre). */
- playerMoved[client] = false;
- CS_RespawnPlayer(client);
- }
- }
- public Action:deleteWeapon(Handle:timer, any:weapon)
- {
- /*if (weapon && IsValidEdict(weapon) && IsValidEntity(weapon))
- RemoveEdict(weapon);*/
- }
- void EnableFFA()
- {
- SetConVarInt(mp_teammates_are_enemies, 1);
- SetConVarInt(mp_friendlyfire, 1);
- SetConVarInt(mp_autokick, 0);
- SetConVarInt(mp_tkpunish, 0);
- SetConVarFloat(ff_damage_reduction_bullets, 1.0);
- SetConVarFloat(ff_damage_reduction_grenade, 1.0);
- SetConVarFloat(ff_damage_reduction_other, 1.0);
- SetConVarFloat(mp_roundtime_defuse, 6.0);
- SetConVarFloat(mp_warmuptime, 999999.0);
- }
- /*public bool:OnClientConnect(client, String:rejectmsg[], maxlen)
- {
- CreateTimer(15.0, Timer_check, client);
- return true;
- }*/
- public void Event_PlayerSpawn(Event event, const char[] name, bool dontBroadcast)
- {
- if (enabled)
- {
- int client = GetClientOfUserId(event.GetInt("userid"));
- if (GetClientTeam(client) != CS_TEAM_SPECTATOR)
- {
- if (!IsFakeClient(client))
- {
- if (welcomemsg && infoMessageCount[client] > 0)
- {
- PrintHintText(client, "This server is running:\n <font color='#00FF00'>Deathmatch</font> ");
- //CPrintToChat(client, "[\x04DM\x01] This server is running \x04Deathmatch \x01v%s");
- }
- /* Hide radar. */
- if (ffa || hideradar)
- {
- CreateTimer(0.0, RemoveRadar, GetClientSerial(client));
- }
- }
- /* Teleport player to custom spawn point. */
- if (spawnPointCount > 0)
- {
- MovePlayer(client);
- }
- /* Enable player spawn protection. */
- if (spawnProtectionTime > 0.0)
- {
- EnableSpawnProtection(client);
- }
- /* Set health. */
- if (startHP != 100)
- {
- SetEntityHealth(client, startHP);
- }
- /* Remove C4. */
- if (removeObjectives)
- {
- StripC4(client);
- }
- }
- }
- }
- void MovePlayer(int client)
- {
- numberOfPlayerSpawns++; /* Stats */
- int clientTeam = GetClientTeam(client);
- int spawnPoint;
- bool spawnPointFound = false;
- float enemyEyePositions[MAXPLAYERS+1][3];
- int numberOfEnemies = 0;
- /* Retrieve enemy positions if required by LoS/distance spawning (at eye level for LoS checking). */
- if (lineOfSightSpawning || (spawnDistanceFromEnemies > 0.0))
- {
- for (int i = 1; i <= MaxClients; i++)
- {
- if (IsClientInGame(i) && (GetClientTeam(i) != CS_TEAM_SPECTATOR) && IsPlayerAlive(i))
- {
- bool enemy = (ffa || (GetClientTeam(i) != clientTeam));
- if (enemy)
- {
- GetClientEyePosition(i, enemyEyePositions[numberOfEnemies]);
- numberOfEnemies++;
- }
- }
- }
- }
- if (lineOfSightSpawning)
- {
- losSearchAttempts++; /* Stats */
- /* Try to find a suitable spawn point with a clear line of sight. */
- for (int i = 0; i < lineOfSightAttempts; i++)
- {
- spawnPoint = GetRandomInt(0, spawnPointCount - 1);
- if (spawnPointOccupied[spawnPoint])
- continue;
- if (spawnDistanceFromEnemies > 0.0)
- {
- if (!IsPointSuitableDistance(spawnPoint, enemyEyePositions, numberOfEnemies))
- continue;
- }
- float spawnPointEyePosition[3];
- AddVectors(spawnPositions[spawnPoint], eyeOffset, spawnPointEyePosition);
- bool hasClearLineOfSight = true;
- for (int j = 0; j < numberOfEnemies; j++)
- {
- Handle trace = TR_TraceRayFilterEx(spawnPointEyePosition, enemyEyePositions[j], MASK_PLAYERSOLID_BRUSHONLY, RayType_EndPoint, TraceEntityFilterPlayer);
- if (!TR_DidHit(trace))
- {
- hasClearLineOfSight = false;
- CloseHandle(trace);
- break;
- }
- CloseHandle(trace);
- }
- if (hasClearLineOfSight)
- {
- spawnPointFound = true;
- break;
- }
- }
- /* Stats */
- if (spawnPointFound)
- losSearchSuccesses++;
- else
- losSearchFailures++;
- }
- /* First fallback. Find a random unccupied spawn point at a suitable distance. */
- if (!spawnPointFound && (spawnDistanceFromEnemies > 0.0))
- {
- distanceSearchAttempts++; /* Stats */
- for (int i = 0; i < 100; i++)
- {
- spawnPoint = GetRandomInt(0, spawnPointCount - 1);
- if (spawnPointOccupied[spawnPoint])
- continue;
- if (!IsPointSuitableDistance(spawnPoint, enemyEyePositions, numberOfEnemies))
- continue;
- spawnPointFound = true;
- break;
- }
- /* Stats */
- if (spawnPointFound)
- distanceSearchSuccesses++;
- else
- distanceSearchFailures++;
- }
- /* Final fallback. Find a random unoccupied spawn point. */
- if (!spawnPointFound)
- {
- for (int i = 0; i < 100; i++)
- {
- spawnPoint = GetRandomInt(0, spawnPointCount - 1);
- if (!spawnPointOccupied[spawnPoint])
- {
- spawnPointFound = true;
- break;
- }
- }
- }
- if (spawnPointFound)
- {
- TeleportEntity(client, spawnPositions[spawnPoint], spawnAngles[spawnPoint], NULL_VECTOR);
- spawnPointOccupied[spawnPoint] = true;
- playerMoved[client] = true;
- }
- if (!spawnPointFound) spawnPointSearchFailures++; /* Stats */
- }
- bool IsPointSuitableDistance(int spawnPoint, float[][3] enemyEyePositions, int numberOfEnemies)
- {
- for (int i = 0; i < numberOfEnemies; i++)
- {
- float distance = GetVectorDistance(spawnPositions[spawnPoint], enemyEyePositions[i], true);
- if (distance < spawnDistanceFromEnemies)
- return false;
- }
- return true;
- }
- public bool TraceEntityFilterPlayer(int entity, int contentsMask)
- {
- if ((entity > 0) && (entity <= MaxClients)) return false;
- return true;
- }
- void SetPlayerColor(int client, const int color[4])
- {
- SetEntityRenderMode(client, (color[3] == 255) ? RENDER_NORMAL : RENDER_TRANSCOLOR);
- SetEntityRenderColor(client, color[0], color[1], color[2], color[3]);
- }
- public Action RemoveRadar(Handle timer, any serial)
- {
- int client = GetClientFromSerial(serial);
- if (IsValidClient(client) && IsPlayerAlive(client))
- {
- SetEntProp(client, Prop_Send, "m_iHideHUD", HIDEHUD_RADAR);
- }
- }
- public Action DisableSpawnProtection(Handle timer, any client)
- {
- if (IsValidClient(client) && (GetClientTeam(client) != CS_TEAM_SPECTATOR) && IsPlayerAlive(client))
- {
- /* Enable damage */
- SetEntProp(client, Prop_Data, "m_takedamage", 2, 1);
- /* Set player color */
- SetPlayerColor(client, defaultColor);
- }
- }
- public void Event_BombPickup(Event event, const char[] name, bool dontBroadcast)
- {
- if (enabled && removeObjectives)
- {
- int client = GetClientOfUserId(event.GetInt("userid"));
- StripC4(client);
- }
- }
- bool StripC4(int client)
- {
- if (IsClientInGame(client) && (GetClientTeam(client) == CS_TEAM_T) && IsPlayerAlive(client))
- {
- int c4Index = GetPlayerWeaponSlot(client, CS_SLOT_C4);
- if (c4Index != -1)
- {
- char weapon[24];
- GetClientWeapon(client, weapon, sizeof(weapon));
- /* If the player is holding C4, switch to the best weapon before removing it. */
- if (StrEqual(weapon, "weapon_c4"))
- {
- if (GetPlayerWeaponSlot(client, CS_SLOT_PRIMARY) != -1)
- ClientCommand(client, "slot1");
- else if (GetPlayerWeaponSlot(client, CS_SLOT_SECONDARY) != -1)
- ClientCommand(client, "slot2");
- else
- ClientCommand(client, "slot3");
- }
- RemovePlayerItem(client, c4Index);
- AcceptEntityInput(c4Index, "Kill");
- return true;
- }
- }
- return false;
- }
- void EnableSpawnProtection(int client)
- {
- int clientTeam = GetClientTeam(client);
- /* Disable damage */
- SetEntProp(client, Prop_Data, "m_takedamage", 0, 1);
- /* Set player color */
- if (clientTeam == CS_TEAM_T)
- SetPlayerColor(client, tColor);
- else if (clientTeam == CS_TEAM_CT)
- SetPlayerColor(client, ctColor);
- /* Create timer to remove spawn protection */
- CreateTimer(spawnProtectionTime, DisableSpawnProtection, client);
- }
- void RemoveHostages()
- {
- int maxEntities = GetMaxEntities();
- char class[24];
- for (int i = MaxClients + 1; i < maxEntities; i++)
- {
- if (IsValidEdict(i))
- {
- GetEdictClassname(i, class, sizeof(class));
- if (StrEqual(class, "hostage_entity"))
- AcceptEntityInput(i, "Kill");
- }
- }
- }
- void SetBuyZones(const char[] status)
- {
- int maxEntities = GetMaxEntities();
- char class[24];
- for (int i = MaxClients + 1; i < maxEntities; i++)
- {
- if (IsValidEdict(i))
- {
- GetEdictClassname(i, class, sizeof(class));
- if (StrEqual(class, "func_buyzone"))
- AcceptEntityInput(i, status);
- }
- }
- }
- void LoadConfig()
- {
- Handle keyValues = CreateKeyValues("Deathmatch Config");
- char path[PLATFORM_MAX_PATH];
- BuildPath(Path_SM, path, sizeof(path), "configs/sdm/sdm.ini");
- if (!FileToKeyValues(keyValues, path))
- SetFailState("The configuration file could not be read.");
- char key[25];
- char value[25];
- if (!KvJumpToKey(keyValues, "Options"))
- SetFailState("The configuration file is corrupt (\"Options\" section could not be found).");
- KvGetString(keyValues, "dm_enabled", value, sizeof(value), "yes");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_enabled, value);
- KvGetString(keyValues, "dm_enable_valve_deathmatch", value, sizeof(value), "no");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_valvedm, value);
- KvGetString(keyValues, "dm_welcomemsg", value, sizeof(value), "yes");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_welcomemsg, value);
- KvGetString(keyValues, "dm_free_for_all", value, sizeof(value), "no");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_free_for_all, value);
- KvGetString(keyValues, "dm_hide_radar", value, sizeof(value), "no");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_hide_radar, value);
- KvGetString(keyValues, "dm_display_panel", value, sizeof(value), "no");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_display_panel, value);
- KvGetString(keyValues, "dm_display_panel_damage", value, sizeof(value), "no");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_display_panel_damage, value);
- KvGetString(keyValues, "dm_sounds_bodyshots", value, sizeof(value), "no");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_sounds_bodyshots, value);
- KvGetString(keyValues, "dm_sounds_headshots", value, sizeof(value), "no");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_sounds_headshots, value);
- KvGetString(keyValues, "dm_headshot_only", value, sizeof(value), "no");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_headshot_only, value);
- KvGetString(keyValues, "dm_headshot_only_allow_world", value, sizeof(value), "no");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_headshot_only_allow_world, value);
- KvGetString(keyValues, "dm_headshot_only_allow_knife", value, sizeof(value), "no");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_headshot_only_allow_knife, value);
- KvGetString(keyValues, "dm_headshot_only_allow_taser", value, sizeof(value), "no");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_headshot_only_allow_taser, value);
- KvGetString(keyValues, "dm_headshot_only_allow_nade", value, sizeof(value), "no");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_headshot_only_allow_nade, value);
- KvGetString(keyValues, "dm_remove_objectives", value, sizeof(value), "yes");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_remove_objectives, value);
- KvGetString(keyValues, "dm_respawning", value, sizeof(value), "yes");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_respawning, value);
- KvGetString(keyValues, "dm_respawn_time", value, sizeof(value), "2.0");
- SetConVarString(cvar_dm_respawn_time, value);
- KvGetString(keyValues, "dm_gun_menu_mode", value, sizeof(value), "1");
- SetConVarString(cvar_dm_gun_menu_mode, value);
- KvGetString(keyValues, "dm_line_of_sight_spawning", value, sizeof(value), "yes");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_los_spawning, value);
- KvGetString(keyValues, "dm_line_of_sight_attempts", value, sizeof(value), "10");
- SetConVarString(cvar_dm_los_attempts, value);
- KvGetString(keyValues, "dm_spawn_distance_from_enemies", value, sizeof(value), "0.0");
- SetConVarString(cvar_dm_spawn_distance, value);
- KvGetString(keyValues, "dm_spawn_protection_time", value, sizeof(value), "1.0");
- SetConVarString(cvar_dm_spawn_time, value);
- KvGetString(keyValues, "dm_no_knife_damage", value, sizeof(value), "no");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_no_knife_damage, value);
- KvGetString(keyValues, "dm_remove_weapons", value, sizeof(value), "yes");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_remove_weapons, value);
- KvGetString(keyValues, "dm_replenish_ammo", value, sizeof(value), "yes");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_replenish_ammo, value);
- KvGetString(keyValues, "dm_replenish_clip", value, sizeof(value), "no");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_replenish_clip, value);
- KvGetString(keyValues, "dm_replenish_reserve", value, sizeof(value), "no");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_replenish_reserve, value);
- KvGetString(keyValues, "dm_replenish_grenade", value, sizeof(value), "no");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_replenish_grenade, value);
- KvGetString(keyValues, "dm_replenish_hegrenade", value, sizeof(value), "no");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_replenish_hegrenade, value);
- KvGetString(keyValues, "dm_replenish_grenade_kill", value, sizeof(value), "no");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_replenish_grenade_kill, value);
- KvGetString(keyValues, "dm_display_grenade_messages", value, sizeof(value), "yes");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_nade_messages, value);
- KvGetString(keyValues, "dm_player_hp_start", value, sizeof(value), "100");
- SetConVarString(cvar_dm_hp_start, value);
- KvGetString(keyValues, "dm_player_hp_max", value, sizeof(value), "100");
- SetConVarString(cvar_dm_hp_max, value);
- KvGetString(keyValues, "dm_hp_per_kill", value, sizeof(value), "5");
- SetConVarString(cvar_dm_hp_kill, value);
- KvGetString(keyValues, "dm_hp_per_headshot_kill", value, sizeof(value), "10");
- SetConVarString(cvar_dm_hp_hs, value);
- KvGetString(keyValues, "dm_hp_per_knife_kill", value, sizeof(value), "50");
- SetConVarString(cvar_dm_hp_knife, value);
- KvGetString(keyValues, "dm_hp_per_nade_kill", value, sizeof(value), "30");
- SetConVarString(cvar_dm_hp_nade, value);
- KvGetString(keyValues, "dm_display_hp_messages", value, sizeof(value), "yes");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_hp_messages, value);
- KvGetString(keyValues, "dm_player_ap_max", value, sizeof(value), "100");
- SetConVarString(cvar_dm_ap_max, value);
- KvGetString(keyValues, "dm_ap_per_kill", value, sizeof(value), "5");
- SetConVarString(cvar_dm_ap_kill, value);
- KvGetString(keyValues, "dm_ap_per_headshot_kill", value, sizeof(value), "10");
- SetConVarString(cvar_dm_ap_hs, value);
- KvGetString(keyValues, "dm_ap_per_knife_kill", value, sizeof(value), "50");
- SetConVarString(cvar_dm_ap_knife, value);
- KvGetString(keyValues, "dm_ap_per_nade_kill", value, sizeof(value), "30");
- SetConVarString(cvar_dm_ap_nade, value);
- KvGetString(keyValues, "dm_display_ap_messages", value, sizeof(value), "yes");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_ap_messages, value);
- KvGoBack(keyValues);
- /*if (!KvJumpToKey(keyValues, "Weapons"))
- SetFailState("The configuration file is corrupt (\"Weapons\" section could not be found).");
- if (!KvJumpToKey(keyValues, "Primary"))
- SetFailState("The configuration file is corrupt (\"Primary\" section could not be found).");
- if (KvGotoFirstSubKey(keyValues, false))
- {
- do {
- KvGetSectionName(keyValues, key, sizeof(key));
- int limit = KvGetNum(keyValues, NULL_STRING, -1);
- if(limit == 0) {continue;}
- PushArrayString(primaryWeaponsAvailable, key);
- SetTrieValue(weaponLimits, key, limit);
- } while (KvGotoNextKey(keyValues, false));
- }
- KvGoBack(keyValues);
- KvGoBack(keyValues);
- if (!KvJumpToKey(keyValues, "Secondary"))
- SetFailState("The configuration file is corrupt (\"Secondary\" section could not be found).");
- if (KvGotoFirstSubKey(keyValues, false))
- {
- do {
- KvGetSectionName(keyValues, key, sizeof(key));
- int limit = KvGetNum(keyValues, NULL_STRING, -1);
- if(limit == 0) {continue;}
- PushArrayString(secondaryWeaponsAvailable, key);
- SetTrieValue(weaponLimits, key, limit);
- } while (KvGotoNextKey(keyValues, false));
- }
- KvGoBack(keyValues);
- KvGoBack(keyValues);
- if (!KvJumpToKey(keyValues, "Misc"))
- SetFailState("The configuration file is corrupt (\"Misc\" section could not be found).");
- KvGetString(keyValues, "armor (chest)", value, sizeof(value), "no");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_armor, value);
- KvGetString(keyValues, "armor (full)", value, sizeof(value), "yes");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_armor_full, value);
- KvGetString(keyValues, "zeus", value, sizeof(value), "no");
- value = (StrEqual(value, "yes")) ? "1" : "0";
- SetConVarString(cvar_dm_zeus, value);
- KvGoBack(keyValues);
- if (!KvJumpToKey(keyValues, "Grenades"))
- SetFailState("The configuration file is corrupt (\"Grenades\" section could not be found).");
- KvGetString(keyValues, "incendiary", value, sizeof(value), "0");
- SetConVarString(cvar_dm_nades_incendiary, value);
- KvGetString(keyValues, "molotov", value, sizeof(value), "0");
- SetConVarString(cvar_dm_nades_incendiary, value);
- KvGetString(keyValues, "decoy", value, sizeof(value), "0");
- SetConVarString(cvar_dm_nades_decoy, value);
- KvGetString(keyValues, "flashbang", value, sizeof(value), "0");
- SetConVarString(cvar_dm_nades_flashbang, value);
- KvGetString(keyValues, "he", value, sizeof(value), "0");
- SetConVarString(cvar_dm_nades_he, value);
- KvGetString(keyValues, "smoke", value, sizeof(value), "0");
- SetConVarString(cvar_dm_nades_smoke, value);
- KvGoBack(keyValues);*/
- /* if (KvJumpToKey(keyValues, "TeamData") && KvGotoFirstSubKey(keyValues, false)) {
- do {
- KvGetSectionName(keyValues, key, sizeof(key));
- KvGetString(keyValues, NULL_STRING, value, sizeof(value), "");
- int team = 0;
- if (StrEqual(value, "CT", false))
- {
- team = CS_TEAM_CT;
- }
- else if (StrEqual(value, "T", false))
- {
- team = CS_TEAM_T;
- }
- weaponSkipMap.SetValue(key, team);
- } while (KvGotoNextKey(keyValues, false));
- KvGoBack(keyValues);
- }*/
- CloseHandle(keyValues);
- }
- void UpdateState()
- {
- int old_enabled = enabled;
- enabled = GetConVarBool(cvar_dm_enabled);
- valveDM = GetConVarBool(cvar_dm_valvedm);
- welcomemsg = GetConVarBool(cvar_dm_welcomemsg);
- ffa = GetConVarBool(cvar_dm_free_for_all);
- hideradar = GetConVarBool(cvar_dm_hide_radar);
- displayPanel = GetConVarBool(cvar_dm_display_panel);
- displayPanelDamage = GetConVarBool(cvar_dm_display_panel_damage);
- bdSounds = GetConVarBool(cvar_dm_sounds_bodyshots);
- hsSounds = GetConVarBool(cvar_dm_sounds_headshots);
- hsOnly = GetConVarBool(cvar_dm_headshot_only);
- hsOnly_AllowWorld = GetConVarBool(cvar_dm_headshot_only_allow_world);
- hsOnly_AllowKnife = GetConVarBool(cvar_dm_headshot_only_allow_knife);
- hsOnly_AllowTaser = GetConVarBool(cvar_dm_headshot_only_allow_taser);
- hsOnly_AllowNade = GetConVarBool(cvar_dm_headshot_only_allow_nade);
- removeObjectives = GetConVarBool(cvar_dm_remove_objectives);
- respawning = GetConVarBool(cvar_dm_respawning);
- respawnTime = GetConVarFloat(cvar_dm_respawn_time);
- //gunMenuMode = GetConVarInt(cvar_dm_gun_menu_mode);
- lineOfSightSpawning = GetConVarBool(cvar_dm_los_spawning);
- lineOfSightAttempts = GetConVarInt(cvar_dm_los_attempts);
- spawnDistanceFromEnemies = GetConVarFloat(cvar_dm_spawn_distance);
- spawnProtectionTime = GetConVarFloat(cvar_dm_spawn_time);
- removeWeapons = GetConVarBool(cvar_dm_remove_weapons);
- //replenishReserve = GetConVarBool(cvar_dm_replenish_reserve);
- startHP = GetConVarInt(cvar_dm_hp_start);
- maxHP = GetConVarInt(cvar_dm_hp_max);
- //displayHPMessages = GetConVarBool(cvar_dm_hp_messages);
- //maxAP = GetConVarInt(cvar_dm_ap_max);
- //displayAPMessages = GetConVarBool(cvar_dm_ap_messages);
- //displayGrenadeMessages = GetConVarBool(cvar_dm_nade_messages);
- //armorChest = GetConVarBool(cvar_dm_armor);
- //armorFull = GetConVarBool(cvar_dm_armor_full);
- //zeus = GetConVarBool(cvar_dm_zeus);
- //incendiary = GetConVarInt(cvar_dm_nades_incendiary);
- if (respawnTime < 0.0) respawnTime = 0.0;
- //if (gunMenuMode < 1) gunMenuMode = 1;
- //if (gunMenuMode > 5) gunMenuMode = 5;
- //if (lineOfSightAttempts < 0) lineOfSightAttempts = 0;
- //if (spawnDistanceFromEnemies < 0.0) spawnDistanceFromEnemies = 0.0;
- //if (spawnProtectionTime < 0.0) spawnProtectionTime = 0.0;
- if (startHP < 1) startHP = 1;
- if (maxHP < 1) maxHP = 1;
- if (HPPerKill < 0) HPPerKill = 0;
- if (HPPerHeadshotKill < 0) HPPerHeadshotKill = 0;
- if (HPPerKnifeKill < 0) HPPerKnifeKill = 0;
- if (HPPerNadeKill < 0) HPPerNadeKill = 0;
- //if (maxAP < 0) maxAP = 0;
- //if (APPerKill < 0) APPerKill = 0;
- //if (APPerHeadshotKill < 0) APPerHeadshotKill = 0;
- //if (APPerKnifeKill < 0) APPerKnifeKill = 0;
- //if (APPerNadeKill < 0) APPerNadeKill = 0;
- //if (incendiary < 0) incendiary = 0;
- /*if (molotov < 0) molotov = 0;
- if (decoy < 0) decoy = 0;
- if (flashbang < 0) flashbang = 0;
- if (he < 0) he = 0;
- if (smoke < 0) smoke = 0;*/
- if (enabled && !old_enabled)
- {
- /*for (int i = 1; i <= MaxClients; i++)
- {
- if (IsClientConnected(i))
- ResetClientSettings(i);
- }*/
- RespawnAll();
- SetBuyZones("Disable");
- char status[10];
- status = (removeObjectives) ? "Disable" : "Enable";
- SetObjectives(status);
- //SetCashState();
- SetNoSpawnWeapons();
- }
- else if (!enabled && old_enabled)
- {
- /*for (int i = 1; i <= MaxClients; i++)
- DisableSpawnProtection(INVALID_HANDLE, i);
- CancelMenu(optionsMenu1);
- CancelMenu(optionsMenu2);
- for (int i = 1; i <= MaxClients; i++)
- {
- if (primaryMenus[i] != INVALID_HANDLE)
- CancelMenu(primaryMenus[i]);
- }
- for (int i = 1; i <= MaxClients; i++)
- {
- if (secondaryMenus[i] != INVALID_HANDLE)
- CancelMenu(secondaryMenus[i]);
- }*/
- SetBuyZones("Enable");
- SetObjectives("Enable");
- //RestoreCashState();
- //RestoreGrenadeState();
- }
- if (enabled)
- {
- /*if (gunMenuMode != old_gunMenuMode)
- {
- if (gunMenuMode == 5)
- {
- for (int i = 1; i <= MaxClients; i++)
- CancelClientMenu(i);
- }
- /* Only if the plugin was enabled before the state update do we need to update the client's gun mode settings. If it was disabled before, then */
- /* the entire client settings (including gun mode settings) are reset above. */
- /*if (old_enabled)
- {
- for (int i = 1; i <= MaxClients; i++)
- {
- if (IsClientConnected(i))
- SetClientGunModeSettings(i);
- }
- }
- }*/
- if (removeObjectives)
- RemoveC4();
- //SetGrenadeState();
- if (ffa)
- EnableFFA();
- //else
- //DisableFFA();
- }
- }
- /* Updates the occupation status of all spawn points. */
- public Action UpdateSpawnPointStatus(Handle timer)
- {
- if (enabled && (spawnPointCount > 0))
- {
- /* Retrieve player positions. */
- float playerPositions[MAXPLAYERS+1][3];
- int numberOfAlivePlayers = 0;
- for (int i = 1; i <= MaxClients; i++)
- {
- if (IsClientInGame(i) && (GetClientTeam(i) != CS_TEAM_SPECTATOR) && IsPlayerAlive(i))
- {
- GetClientAbsOrigin(i, playerPositions[numberOfAlivePlayers]);
- numberOfAlivePlayers++;
- }
- }
- /* Check each spawn point for occupation by proximity to alive players */
- for (int i = 0; i < spawnPointCount; i++)
- {
- spawnPointOccupied[i] = false;
- for (int j = 0; j < numberOfAlivePlayers; j++)
- {
- float distance = GetVectorDistance(spawnPositions[i], playerPositions[j], true);
- if (distance < 10000.0)
- {
- spawnPointOccupied[i] = true;
- break;
- }
- }
- }
- }
- return Plugin_Continue;
- }
- public Action Event_RoundStart(Event event, const char[] name, bool dontBroadcast)
- {
- if (enabled)
- {
- if (removeObjectives)
- RemoveHostages();
- //if (removeWeapons)
- // RemoveGroundWeapons(INVALID_HANDLE);
- }
- }
- public Action Event_Sound(int clients[64], int &numClients, char sample[PLATFORM_MAX_PATH], int &entity, int &channel, float &volume, int &level, int &pitch, int &flags)
- {
- if (enabled)
- {
- if (spawnPointCount > 0)
- {
- int client;
- if ((entity > 0) && (entity <= MaxClients))
- client = entity;
- //else
- //client = GetEntDataEnt2(entity, ownerOffset);
- /* Block ammo pickup sounds. */
- if (StrContains(sample, "pickup") != -1)
- return Plugin_Stop;
- /* Block all sounds originating from players not yet moved. */
- if ((client > 0) && (client <= MaxClients) && !playerMoved[client])
- return Plugin_Stop;
- }
- if (ffa)
- {
- if (StrContains(sample, "friendlyfire") != -1)
- return Plugin_Stop;
- }
- if (!hsSounds)
- {
- if (StrContains(sample, "physics/flesh/flesh_bloody") != -1 || StrContains(sample, "player/bhit_helmet") != -1 || StrContains(sample, "player/headshot") != -1)
- return Plugin_Stop;
- }
- if (!bdSounds)
- {
- if (StrContains(sample, "physics/body") != -1 || StrContains(sample, "physics/flesh") != -1 || StrContains(sample, "player/kevlar") != -1)
- return Plugin_Stop;
- }
- }
- return Plugin_Continue;
- }
- void RespawnAll()
- {
- for (int i = 1; i <= MaxClients; i++)
- Respawn(INVALID_HANDLE, i);
- }
- void SetObjectives(const char[] status)
- {
- int maxEntities = GetMaxEntities();
- char class[24];
- for (int i = MaxClients + 1; i < maxEntities; i++)
- {
- if (IsValidEdict(i))
- {
- GetEdictClassname(i, class, sizeof(class));
- if (StrEqual(class, "func_bomb_target") || StrEqual(class, "func_hostage_rescue"))
- AcceptEntityInput(i, status);
- }
- }
- }
- void SetNoSpawnWeapons()
- {
- SetConVarString(mp_ct_default_primary, "");
- SetConVarString(mp_t_default_primary, "");
- SetConVarString(mp_ct_default_secondary, "weapon_glock");
- SetConVarString(mp_t_default_secondary, "weapon_glock");
- SetConVarString(mp_t_default_melee, "");
- SetConVarString(mp_t_default_melee, "");
- }
- void RemoveC4()
- {
- for (int i = 1; i <= MaxClients; i++)
- {
- if (StripC4(i))
- break;
- }
- }
- void CreateWeapon(int i)
- {
- new index;
- char buffer[64];
- weapons.GetString(i,buffer,sizeof(buffer));
- TrimString(buffer);
- index=CreateEntityByName(buffer);
- if (index < 1)
- {
- LogError("Error during creating '%s'",buffer);
- return;
- }
- SetEntProp(index, Prop_Send, "m_iItemDefinitionIndex", GetWeaponIndex(i));
- DispatchKeyValueVector(index, "origin", spawnWeaponPositions[i]);
- //DispatchKeyValue(index, "ammo", "90");
- DispatchKeyValue(index, "spawnflags", "1");
- DispatchSpawn(index);
- //SetEntProp(index, Prop_Send, "m_iPrimaryReserveAmmoCount", 90);
- //SetEntData(index, FindSendPropInfo("CBaseCombatWeapon", "m_iClip1"), 90);
- //DispatchKeyValue(index, "ammo", "90");
- SetPrimaryAmmo(index, 90);
- // SetWeaponAmmo(GetWeaponAmmoOffset(buffer), 90);
- SetSkin(index);
- }
- void SpawnWeapons()
- {
- for(int i=0;i<spawnWeaponPointCount;i++)
- {
- CreateWeapon(i);
- }
- }
- int GetWeaponIndex(int i)
- {
- int result;
- char buffer[64];
- weapons.GetString(i,buffer,sizeof(buffer));
- TrimString(buffer);
- if (StrEqual(buffer, "weapon_deagle"))
- result=1;
- else if (StrEqual(buffer, "weapon_elite"))
- result=2;
- else if (StrEqual(buffer, "weapon_fiveseven"))
- result=3;
- else if (StrEqual(buffer, "weapon_glock"))
- result=4;
- else if (StrEqual(buffer, "weapon_ak47"))
- result=7;
- else if (StrEqual(buffer, "weapon_aug"))
- result=8;
- else if (StrEqual(buffer, "weapon_awp"))
- result=9;
- else if (StrEqual(buffer, "weapon_famas"))
- result=10;
- else if (StrEqual(buffer, "weapon_g3sg1"))
- result=11;
- else if (StrEqual(buffer, "weapon_galil"))
- result=13;
- else if (StrEqual(buffer, "weapon_m249"))
- result=14;
- else if (StrEqual(buffer, "weapon_m4a1"))
- result=16;
- else if (StrEqual(buffer, "weapon_mac10"))
- result=17;
- else if (StrEqual(buffer, "weapon_p90"))
- result=19;
- else if (StrEqual(buffer, "weapon_ump45"))
- result=24;
- else if (StrEqual(buffer, "weapon_xm1014"))
- result=25;
- else if (StrEqual(buffer, "weapon_bizon"))
- result=26;
- else if (StrEqual(buffer, "weapon_mag7"))
- result=27;
- else if (StrEqual(buffer, "weapon_negev"))
- result=28;
- else if (StrEqual(buffer, "weapon_sawedoff"))
- result=29;
- else if (StrEqual(buffer, "weapon_tec9"))
- result=30;
- else if (StrEqual(buffer, "weapon_p2000"))
- result=32;
- else if (StrEqual(buffer, "weapon_mp7"))
- result=33;
- else if (StrEqual(buffer, "weapon_mp9"))
- result=34;
- else if (StrEqual(buffer, "weapon_nova"))
- result=35;
- else if (StrEqual(buffer, "weapon_p250"))
- result=36;
- else if (StrEqual(buffer, "weapon_scar20"))
- result=38;
- else if (StrEqual(buffer, "weapon_sg556"))
- result=39;
- else if (StrEqual(buffer, "weapon_ssg08"))
- result=40;
- return result;
- }
- public Action:Timer_check(Handle:timer, any:client)
- {
- PrintToChatAll("Check1");
- if(IsClientInGame(client))
- {
- if(GetClientCount(true) == GetMaxHumanPlayers())
- {
- SetConVarFloat(mp_warmup, 5.0);
- KillTimer(g_timer);
- PrintToChatAll("Check2");
- }
- }
- else if(!IsClientConnected(client))
- {
- KillTimer(g_timer);
- }
- }
- void SetSkin(int entity)
- {
- SetEntProp(entity,Prop_Send,"m_iItemIDLow",-1);
- SetEntProp(entity,Prop_Send,"m_nFallbackPaintKit",217);
- SetEntPropFloat(entity,Prop_Send,"m_flFallbackWear",0.1);
- // if(g_paints[theindex][pattern] >= 0)
- //SetEntProp(entity,Prop_Send,"m_nFallbackSeed",g_paints[theindex][pattern]);
- SetEntProp(entity,Prop_Send,"m_nFallbackStatTrak", 1337);
- // if(g_paints[theindex][quality] != -2)
- //SetEntProp(entity,Prop_Send,"m_iEntityQuality",g_paints[theindex][quality]);
- }
- OnButtonPress(client, button)
- {
- // do stuff
- }
- OnButtonRelease(client, button)
- {
- // do stuff
- }
- stock SetPrimaryAmmo(weap, ammo)
- {
- //new myweapons = FindSendPropInfo("CCSPlayer", "m_hMyWeapons");
- //new weap = GetEntDataEnt2(client, myweapons+ (slot*4));
- if(IsValidEntity(weap))
- return SetEntData(weap, FindSendPropInfo("CBaseCombatWeapon", "m_iClip1"), ammo);
- return 0;
- }
- /*stock SetWeaponAmmo(slot, ammo)
- {
- new ammoOffset = FindSendPropInfo("CCSPlayer", "m_iAmmo");
- return SetEntData(client, ammoOffset+(slot*4), ammo);
- }*/
- public GetWeaponAmmoOffset(String:Weapon[])
- {
- if(StrEqual(Weapon, "weapon_deagle", false))
- {
- return 1;
- }
- else if(StrEqual(Weapon, "weapon_ak47", false) || StrEqual(Weapon, "weapon_aug", false) || StrEqual(Weapon, "weapon_g3sg1", false) || StrEqual(Weapon, "weapon_scout", false))
- {
- return 2;
- }
- else if(StrEqual(Weapon, "weapon_famas", false) || StrEqual(Weapon, "weapon_galil", false) || StrEqual(Weapon, "weapon_m4a1", false) || StrEqual(Weapon, "weapon_sg550", false) || StrEqual(Weapon, "weapon_sg552", false))
- {
- return 3;
- }
- else if(StrEqual(Weapon, "weapon_m249", false))
- {
- return 4;
- }
- else if(StrEqual(Weapon, "weapon_awp", false))
- {
- return 5;
- }
- else if(StrEqual(Weapon, "weapon_elite", false) || StrEqual(Weapon, "weapon_glock", false) || StrEqual(Weapon, "weapon_mp5navy", false) || StrEqual(Weapon, "weapon_tmp", false))
- {
- return 6;
- }
- else if(StrEqual(Weapon, "weapon_xm1014", false) || StrEqual(Weapon, "weapon_m3", false))
- {
- return 7;
- }
- else if(StrEqual(Weapon, "weapon_mac10", false) || StrEqual(Weapon, "weapon_ump45", false) || StrEqual(Weapon, "weapon_usp", false))
- {
- return 8;
- }
- else if(StrEqual(Weapon, "weapon_p228", false))
- {
- return 9;
- }
- else if(StrEqual(Weapon, "weapon_fiveseven", false) || StrEqual(Weapon, "weapon_p90", false))
- {
- return 10;
- }
- else if(StrEqual(Weapon, "weapon_hegrenade", false))
- {
- return 11;
- }
- else if(StrEqual(Weapon, "weapon_flashbang", false))
- {
- return 12;
- }
- else if(StrEqual(Weapon, "weapon_smokegrenade", false))
- {
- return 13;
- }
- return -1;
- }
- public Action WarmupCheck()
- {
- if(!b_MaxClients)
- {
- if(i_PlayerCount == MAXPLAYERS)
- {
- ServerCommand("mp_warmuptime 0");
- ServerCommand("mp_restartgame 1");
- b_MaxClients = true;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement