diff --git a/.gitignore b/.gitignore index ae9ce91..452cff8 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,6 @@ scripting/sm_give.sp scripting/include/steamtools.inc scripting/L4D2Testing.sp plugins/L4D2Testing.smx -scripting/cancer.sp plugins/sm_give.smx plugins/l4d2_stats_recorder.smx scripting/l4d2_stats_recorder.sp @@ -29,6 +28,7 @@ scripting/l4d_esfp.sp scripting/customstatus.sp plugins/ssh.smx scripting/include/ssh.inc +scripting/include/stats scripting/ssh.sp scripting/l4d2_witch_force_attack_cmd.sp l4d2_stats_plugin/ diff --git a/README.md b/README.md index 9f2fb35..9bfb27c 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,6 @@ Useful things: ## Plugin List ### Created by Me -* #### CSGO - * [csgo-knifehp](#csgo-knifehp) - First plugin I've made - * [CSGOTroll](#csgotroll) - Abandoned friend trolling plugin -* #### L4D2 * [l4d2-manual-director](#l4d2-manual-director) - Spawn specials on demand via director or at your cursor * [l4d2-info-cmd](#l4d2-info-cmd) - Prints a full state of all survivors, useful for external information * [AutoWarpBot](#autowarpbot) - Abandoned diff --git a/plugins/CSGOTroll.smx b/plugins/CSGOTroll.smx deleted file mode 100644 index 5cae2d4..0000000 Binary files a/plugins/CSGOTroll.smx and /dev/null differ diff --git a/plugins/csgo-knifehp.smx b/plugins/csgo-knifehp.smx deleted file mode 100644 index c3192c7..0000000 Binary files a/plugins/csgo-knifehp.smx and /dev/null differ diff --git a/plugins/csgo-misc.smx b/plugins/csgo-misc.smx deleted file mode 100644 index fff0de8..0000000 Binary files a/plugins/csgo-misc.smx and /dev/null differ diff --git a/scripting/CSGOTroll.sp b/scripting/CSGOTroll.sp deleted file mode 100644 index 565415d..0000000 --- a/scripting/CSGOTroll.sp +++ /dev/null @@ -1,112 +0,0 @@ -#pragma semicolon 1 - -#define DEBUG - -#define PLUGIN_AUTHOR "" -#define PLUGIN_VERSION "0.00" - -#include -#include -#include -#include - -EngineVersion g_Game; -ConVar hTrollEnableState, hShotFailPercentage, hTrollTargets, hGunType; -bool TrollTargets[MAXPLAYERS+1], lateLoaded; - -public Plugin myinfo = -{ - name = "", - author = PLUGIN_AUTHOR, - description = "", - version = PLUGIN_VERSION, - url = "" -}; - -public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max) { - if(late) { - lateLoaded = true; - } -} - -public OnPluginStart() -{ - g_Game = GetEngineVersion(); - if(g_Game != Engine_CSGO && g_Game != Engine_CSS) - { - SetFailState("This plugin is for CSGO/CSS only."); - } - //convars - hTrollEnableState = CreateConVar("troll_enable", "1.0", "Enable troll. 0 -> OFF, 1 -> Shots", FCVAR_NONE, true, 0.0, true, 1.0); - hShotFailPercentage = CreateConVar("troll_shot_fail_percentage", "0.4", "The percentage that the troll acts (shots fail). float 0-1", FCVAR_NONE, true, 0.0, true, 1.0); - hTrollTargets = CreateConVar("troll_targets", "", "comma seperated list of steamid64 targets (ex: STEAM_0:0:75141700)", FCVAR_NONE); - hGunType = CreateConVar("troll_shot_mode", "0", "0 -> ALL Weapons, 1 -> AWP", FCVAR_NONE, true, 0.0, true, 1.0); - - if(lateLoaded) FindExistingVictims(); -} - -public void OnClientAuthorized(int client, const char[] auth) { - if(hTrollEnableState.IntValue > 0) { - if(StrContains(auth, "BOT", true) == -1) { - TestForTrollUser(client, auth); - } - } -} -public void OnClientPutInServer(int client) { - SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage); -} -public OnClientDisconnect(int client) { - TrollTargets[client] = false; -} -public void FindExistingVictims() { - for(int i = 1; i <= MaxClients; i++) { - if(IsClientInGame(i) && IsClientAuthorized(i)) { - if(!IsFakeClient(i)) { - char auth[64]; - GetClientAuthId(i, AuthId_Steam2, auth, sizeof(auth)); - TestForTrollUser(i, auth); - } - SDKHook(i, SDKHook_OnTakeDamage, OnTakeDamage); - } - } -} -public bool TestForTrollUser(int client, const char[] auth) { - char targets[32][8]; - char raw_targets[64]; - hTrollTargets.GetString(raw_targets, sizeof(raw_targets)); - ExplodeString(raw_targets, ",", targets, 8, 32, false); - for(int i = 0; i < 8; i++) { - if(StrEqual(targets[i], auth, true)) { - PrintToServer("Troll victim detected with id %d and steamid %s", client, auth); - TrollTargets[client] = true; - return true; - } - } - return false; -} -public Action OnTakeDamage(int victim, int& attacker, int& inflictor, float& damage, int& damagetype, int& weapon, float damageForce[3], float damagePosition[3]) { - if(hTrollEnableState.IntValue == 1) { - if(TrollTargets[attacker]) { - bool try_failure = false; - char weapon_name[64]; - GetClientWeapon(victim, weapon_name, sizeof(weapon_name)); - - if(hGunType.IntValue == 0) { - try_failure = true; - }else{ - if(StrEqual(weapon_name, "weapon_awp", true)) { - try_failure = true; - } - - } - float random_float = GetURandomFloat(); - if(try_failure) { - if(FloatCompare(random_float, hShotFailPercentage.FloatValue) == -1) { - damage = 0.0; - return Plugin_Handled; - } - } - } - } - return Plugin_Continue; -} \ No newline at end of file diff --git a/scripting/csgo-knifehp.sp b/scripting/csgo-knifehp.sp deleted file mode 100644 index 7f2ad7c..0000000 --- a/scripting/csgo-knifehp.sp +++ /dev/null @@ -1,68 +0,0 @@ -#pragma semicolon 1 - -#define DEBUG - -#define PLUGIN_NAME "CSGO Knife Regen" -#define PLUGIN_AUTHOR "jackzmc" -#define PLUGIN_VERSION "1.00" -#define PLUGIN_DESCRIPTION "" - -#include -#include -#include -//#include - -EngineVersion g_Game; - -public Plugin myinfo = -{ - name = PLUGIN_NAME, - author = PLUGIN_AUTHOR, - description = PLUGIN_DESCRIPTION, - version = PLUGIN_VERSION, - url = "" -}; - -ConVar g_bKnifeHPEnabled, g_iKnifeHPMax, g_iKnifeHPRegain; - -public OnPluginStart() -{ - g_Game = GetEngineVersion(); - if (g_Game != Engine_CSGO && g_Game != Engine_CSS) - { - SetFailState("This plugin is for CSGO/CSS only."); - } - - g_bKnifeHPEnabled = CreateConVar("knifehp_enable", "1", "Enable regaining health on knife kill", FCVAR_NONE, true, 0.0, true, 1.0); - g_iKnifeHPMax = CreateConVar("knifehp_max_health", "100", "Maximum health to set an attacker to", FCVAR_NONE, true, 0.0); - g_iKnifeHPRegain = CreateConVar("knifehp_amount", "100", "Amount of health to give attacker", FCVAR_NONE, true, 0.0); - HookEvent("player_death", Event_PlayerDeath); - - AutoExecConfig(true, "csgo_knifehp"); -} - -public void Event_PlayerDeath(Event event, const char[] name, bool dontBroadcast) -{ - if (g_bKnifeHPEnabled.BoolValue) { - char weapon_name[64]; - event.GetString("weapon", weapon_name, sizeof(weapon_name)); - if (StrContains(weapon_name, "knife", false) > -1) { - int attacker = event.GetInt("attacker"); - int client = GetClientOfUserId(attacker); - - //get the new health value (current client hp + the regen amount) - int new_health = GetClientHealth(client) + g_iKnifeHPRegain.IntValue; - //50 + 20 <= max - if (IsClientInGame(client) && IsPlayerAlive(client) && !IsFakeClient(client)) { - if(new_health <= g_iKnifeHPMax.IntValue) { //if the new health is less than max, set it to it - SetEntityHealth(client, new_health); - }else{ //if > max, set it to max - SetEntityHealth(client, g_iKnifeHPMax.IntValue); - } - } - - } - - - } -} \ No newline at end of file diff --git a/scripting/csgo-misc.sp b/scripting/csgo-misc.sp deleted file mode 100644 index f039622..0000000 --- a/scripting/csgo-misc.sp +++ /dev/null @@ -1,60 +0,0 @@ -#pragma semicolon 1 - -#define DEBUG - -#define PLUGIN_AUTHOR "" -#define PLUGIN_VERSION "0.00" - -#include -#include -#include -//#include - -#pragma newdecls required - -public Plugin myinfo = -{ - name = "", - author = PLUGIN_AUTHOR, - description = "", - version = PLUGIN_VERSION, - url = "" -}; - -public void OnPluginStart() -{ - EngineVersion g_Game = GetEngineVersion(); - if(g_Game != Engine_CSGO && g_Game != Engine_CSS) - { - SetFailState("This plugin is for CSGO/CSS only."); - } - RegConsoleCmd("sm_first", Command_FirstPov, "Go back to first person"); - RegConsoleCmd("sm_third", Command_ThirdPov, "Go to third person"); -} -public Action Command_FirstPov(int client, int args) { - if(client == 0) { - ReplyToCommand(client, "This command is for clients only"); - return Plugin_Handled; - } - CheatCommand(client, "firstperson", "", ""); - return Plugin_Handled; -} -public Action Command_ThirdPov(int client, int args) { - if(client == 0) { - ReplyToCommand(client, "This command is for clients only"); - return Plugin_Handled; - } - CheatCommand(client, "thirdperson", "", ""); - return Plugin_Handled; -} - -stock void CheatCommand(int client, char[] command, char[] argument1, char[] argument2) -{ - int userFlags = GetUserFlagBits(client); - SetUserFlagBits(client, ADMFLAG_ROOT); - int flags = GetCommandFlags(command); - SetCommandFlags(command, flags & ~FCVAR_CHEAT); - FakeClientCommand(client, "%s %s %s", command, argument1, argument2); - SetCommandFlags(command, flags); - SetUserFlagBits(client, userFlags); -} \ No newline at end of file