Add url to plugin info & update all to 1.11

This commit is contained in:
Jackz 2022-07-05 22:31:01 -05:00
parent d41a10f61e
commit de69e0c535
No known key found for this signature in database
GPG key ID: E0BBD94CF657F603
41 changed files with 59 additions and 113 deletions

View file

@ -1,12 +1,7 @@
#pragma semicolon 1
#pragma newdecls required
#define PLUGIN_NAME "L4D2 FF Kick Protection"
#define PLUGIN_DESCRIPTION "Prevents assholes from friendly firing when being kicked."
#define PLUGIN_AUTHOR "jackzmc"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_URL ""
#include <sourcemod>
#include <sdktools>
@ -16,11 +11,11 @@ static int disableFFClient, ffDamageCount; //client to disable FF for
static ConVar forceKickFFThreshold;
public Plugin myinfo = {
name = PLUGIN_NAME,
author = PLUGIN_AUTHOR,
description = PLUGIN_DESCRIPTION,
name = "L4D2 FF Kick Protection",
author = "jackzmc",
description = "Prevents friendly firing from players being voted off and admins from being kicked",
version = PLUGIN_VERSION,
url = PLUGIN_URL
url = "https://github.com/Jackzmc/sourcemod-plugins"
};
public void OnPluginStart() {
@ -57,14 +52,6 @@ public void Event_PlayerTeam(Event event, const char[] name, bool dontBroadcast)
}
}
}
/*
Dropped BabybackRibs from server (Disconnect by user.)
L 02/16/2022 - 10:38:53: [SM] Exception reported: No valid ban method flags specified
L 02/16/2022 - 10:38:53: [SM] Blaming: L4D2FFKickProtection.smx
L 02/16/2022 - 10:38:53: [SM] Call stack trace:
L 02/16/2022 - 10:38:53: [SM] [0] BanClient
L 02/16/2022 - 10:38:53: [SM] [1] Line 78, s:\Jackz\Documents\Sourcepawn\scripting\L4D2FFKickProtection.sp::VoteStart Potential vote being called
*/
public Action VoteStart(int client, const char[] command, int argc) {
if(!IsClientInGame(client)) {
PrintToServer("Preventing vote from user not in game: %N", client);

View file

@ -50,7 +50,7 @@ static ConVar hLaserNotice, hFinaleTimer, hFFNotice, hMPGamemode, hPingDropThres
static int iFinaleStartTime, botDropMeleeWeapon[MAXPLAYERS+1], iHighPingCount[MAXPLAYERS+1];
ReserveMode reserveMode;
static bool isHighPingIdle[MAXPLAYERS+1], isL4D1Survivors;
static Handle hTakeOverBot, hGoAwayFromKeyboard;
static Handle hGoAwayFromKeyboard;
static StringMap SteamIDs;
static char lastSound[MAXPLAYERS+1][64], gamemode[32];
@ -61,7 +61,7 @@ public Plugin myinfo = {
author = "Includes: Notice on laser use, Timer for gauntlet runs",
description = "jackzmc",
version = PLUGIN_VERSION,
url = ""
url = "https://github.com/Jackzmc/sourcemod-plugins"
};
//TODO: On pickup ammo pack, mark dropped kit/defib
@ -280,11 +280,12 @@ public void CVC_FFNotice(ConVar convar, const char[] oldValue, const char[] newV
}
}
public Action Event_RoundEnd(Event event, const char[] name, bool dontBroadcast) {
public void Event_RoundEnd(Event event, const char[] name, bool dontBroadcast) {
LasersUsed.Clear();
}
public Action Command_RespawnAll(int client, int args) {
L4D_CreateRescuableSurvivors();
return Plugin_Handled;
}
public Action Command_SwapPlayer(int client, int args) {
if(args < 1) {
@ -362,6 +363,7 @@ public Action Command_ListClientModels(int client, int args) {
ReplyToCommand(client, "%N's model: %s", i, model);
}
}
return Plugin_Handled;
}
public Action Command_PlaySound(int client, int args) {
if(args < 2) {
@ -571,7 +573,7 @@ int AddWeaponSlot(int target, int slot, DataPack pack) {
public Action Timer_RequipWeapon(Handle hdl, DataPack pack) {
pack.Reset();
int client = GetClientOfUserId(pack.ReadCell());
if(client == 0) return;
if(client == 0) return Plugin_Handled;
int weapon, pistolSlotItem = -1;
@ -588,6 +590,7 @@ public Action Timer_RequipWeapon(Handle hdl, DataPack pack) {
if(isDualWield && pistolSlotItem != -1 && HasEntProp(pistolSlotItem, Prop_Send, "m_isDualWielding")) {
SetEntProp(pistolSlotItem, Prop_Send, "m_isDualWielding", 1);
}
return Plugin_Handled;
}
public Action Cmd_SetSurvivor(int client, int args) {
@ -661,7 +664,7 @@ public void Event_PlayerDisconnect(Event event, const char[] name, bool dontBroa
}
int disabledItem[2048];
//Can also probably prevent kit drop to pick them up
public Action Event_WeaponDrop(Event event, const char[] name, bool dontBroadcast) {
public void Event_WeaponDrop(Event event, const char[] name, bool dontBroadcast) {
int client = GetClientOfUserId(event.GetInt("userid"));
int weapon = event.GetInt("propid");
char newWpn[32];
@ -678,6 +681,7 @@ public Action Event_OnWeaponEquip(int client, int weapon) {
}
public Action Timer_AllowKitPickup(Handle h, int entity) {
disabledItem[entity] = 0;
return Plugin_Handled;
}
public void OnMapStart() {
AddFileToDownloadsTable("sound/custom/meow1.mp3");
@ -713,7 +717,7 @@ public void OnSceneStageChanged(int scene, SceneStages stage) {
}
}
///AFK BOT WEAPON FIX
public Action Event_BotPlayerSwap(Event event, const char[] name, bool dontBroadcast) {
public void Event_BotPlayerSwap(Event event, const char[] name, bool dontBroadcast) {
int bot = GetClientOfUserId(event.GetInt("bot"));
if(StrEqual(name, "player_bot_replace")) {
//Bot replaced player, hook any drop events
@ -798,6 +802,7 @@ public Action Timer_TPBots(Handle timer, int user) {
}
}
return Plugin_Handled;
}
//FRIENDLY FIRE NOTICE
public void Event_PlayerHurt(Event event, const char[] name, bool dontBroadcast) {

View file

@ -15,7 +15,7 @@ public Plugin myinfo =
author = "jackzmc",
description = "",
version = PLUGIN_VERSION,
url = ""
url = "https://github.com/Jackzmc/sourcemod-plugins"
};
enum struct Log {

View file

@ -18,7 +18,7 @@ public Plugin myinfo =
author = "jackzmc",
description = "Manages bans via MySQL",
version = PLUGIN_VERSION,
url = ""
url = "https://github.com/Jackzmc/sourcemod-plugins"
};
static Database g_db;

View file

@ -270,9 +270,9 @@ typeset SteamWorksHTTPDataReceived
typeset SteamWorksHTTPBodyCallback
{
function void (const char sData[]);
function void (const char sData[], any value);
function void (const int data[], any value, int datalen);
function void (const char[] sData);
function void (const char[] sData, any value);
function void (const int[] data, any value, int datalen);
};
#else

View file

@ -27,7 +27,7 @@ public Plugin myinfo =
author = PLUGIN_AUTHOR,
description = PLUGIN_DESCRIPTION,
version = PLUGIN_VERSION,
url = ""
url = "https://github.com/Jackzmc/sourcemod-plugins"
};
//TODO: Transition state
@ -128,19 +128,19 @@ public Action PrintGameInfo(int client, int args) {
ReplyToCommand(client,"%d,0,%s,%d,%d,%s,%s,%s,%s,%s,%d,%s,%s", i, name, bot, hp, status, throwItem, kitItem, pillItem, character, velocity, primaryWeapon, secondaryWeapon);
}
return Plugin_Handled;
}
// EVENTS //
public void Event_GamemodeChange(ConVar cvar, const char[] oldValue, const char[] newValue) {
cvar.GetString(g_icGamemode, sizeof(g_icGamemode));
}
public Action Event_MapTransition(Event event, const char[] name, bool dontBroadcast) {
public void Event_MapTransition(Event event, const char[] name, bool dontBroadcast) {
for(int i = 1; i <= MaxClients; i++) {
if(IsClientConnected(i) && IsClientInGame(i) && GetClientTeam(i) == 2)
b_isTransitioning[i] = true;
}
}
public Action Event_PlayerSpawn(Event event, const char[] name, bool dontBroadcast) {
public void Event_PlayerSpawn(Event event, const char[] name, bool dontBroadcast) {
int client = GetClientOfUserId(event.GetInt("userid"));
if(client && b_isTransitioning[client]) {
b_isTransitioning[client] = false;

View file

@ -14,32 +14,13 @@
ConVar g_cMdNotify, g_cMdEnableTank, g_cMdEnableWitch, g_cMdEnableMob, g_cMdAnnounceLevel;
bool g_bMdIsL4D2 = false;
int g_icSpawnStats[15];
/*
0 - Commons
1 - Mob
2 - Panics
3 - Jockey
4 - Hunter
5 - Charger
6 - Smoker
7 - Spitter
8 - Boomer
9 - Witch
10 - Tank
11 - Weapons
12 - Health
13 - Throwables
14 - Restarts (cvar?)
*/
public Plugin myinfo =
{
name = PLUGIN_NAME,
author = PLUGIN_AUTHOR,
description = PLUGIN_DESCRIPTION,
version = PLUGIN_VERSION,
url = ""
url = "https://github.com/Jackzmc/sourcemod-plugins"
};
public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
{
@ -208,6 +189,7 @@ public Action ShowSpecialMenu(int client, int args) {
if (g_cMdEnableMob.BoolValue)menu.AddItem("mob", "Mob");
menu.ExitButton = true;
menu.Display(client, 0);
return Plugin_Handled;
}
public Action ShowLocalSpecialMenu(int client, int args) {
Menu menu = new Menu(Handle_LocalSpawnMenu);
@ -228,6 +210,7 @@ public Action ShowLocalSpecialMenu(int client, int args) {
if (g_cMdEnableMob.BoolValue) menu.AddItem("mob", "Mob");
menu.ExitButton = true;
menu.Display(client, 0);
return Plugin_Handled;
}
public int Handle_SpawnMenu(Menu menu, MenuAction action, int client, int index)
@ -251,6 +234,7 @@ public int Handle_SpawnMenu(Menu menu, MenuAction action, int client, int index)
{
delete menu;
}
return 0;
}
public int Handle_LocalSpawnMenu(Menu menu, MenuAction action, int client, int index)
{
@ -269,6 +253,7 @@ public int Handle_LocalSpawnMenu(Menu menu, MenuAction action, int client, int i
{
delete menu;
}
return 0;
}
stock Action kickbot(Handle timer, int client)
@ -277,29 +262,7 @@ stock Action kickbot(Handle timer, int client)
{
if (IsFakeClient(client))KickClient(client);
}
}
int FindStatIndex(const char[] type) {
return SpawnStats
if (StrEqual(type, "common") return 0;
else if (StrEqual(type, "mob")) return 1;
else if (StrEqual(type, "panic")) return 2;
else if (StrEqual(type, "jockey")) return 3;
else if (StrEqual(type, "hunter")) return 4;
else if (StrEqual(type, "charger")) return 5;
else if (StrEqual(type, "smoker")) return 6;
else if (StrEqual(type, "spitter")) return 7;
else if (StrEqual(type, "boomer")) return 8;
else if (StrEqual(type, "witch")) return 9;
else if (StrEqual(type, "tank")) return 10;
else if (StrEqual(type, "weapon")) return 11;
else if (StrEqual(type, "health")) return 12;
else if (StrEqual(type, "throwable")) return 13;
else if (StrEqual(type, "restart")) return 14;
else return sizeof(g_icSpawnStats);
}
stock void UpdateIndex(char[] type) {
int index = FindStatIndex(type);
g_icSpawnStats[index]++;
return Plugin_Handled;
}
stock int GetAnyValidClient() {

View file

@ -57,13 +57,14 @@ public Plugin myinfo = {
author = "jackzmc",
description = "",
version = PLUGIN_VERSION,
url = ""
url = "https://github.com/Jackzmc/sourcemod-plugins"
};
public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max) {
if(late) {
lateLoaded = true;
}
return APLRes_Success;
}
public void OnPluginStart() {
@ -209,7 +210,7 @@ public void OnClientPutInServer(int client) {
}
public void OnClientPostAdminCheck(int client) {
if(GetUserAdmin(client) != INVALID_ADMIN_ID) {
if(GetUserAdmin(client) != INVALID_ADMIN_ID && hFFAutoScaleIgnoreAdmins.BoolValue) {
pData[client].immunityFlags = Immune_TK | Immune_RFF;
}
}
@ -599,21 +600,10 @@ stock bool GetNearestPlayerPosition(int client, float pos[3]) {
return lowestID > 0;
}
static char buffer[254];
stock void PrintChatToAdmins(const char[] format, any ...) {
VFormat(buffer, sizeof(buffer), format, 2);
for(int i = 1; i <= MaxClients; i++) {
if(IsClientConnected(i) && IsClientInGame(i)) {
AdminId admin = GetUserAdmin(i);
if(admin != INVALID_ADMIN_ID) {
PrintToChat(i, "%s", buffer);
}
}
}
PrintToServer("%s", buffer);
}
stock void PrintToConsoleAdmins(const char[] format, any ...) {
char buffer[254];
VFormat(buffer, sizeof(buffer), format, 2);
for(int i = 1; i <= MaxClients; i++) {
if(IsClientConnected(i) && IsClientInGame(i)) {

View file

@ -16,7 +16,7 @@ public Plugin myinfo =
author = "jackzmc",
description = "",
version = PLUGIN_VERSION,
url = ""
url = "https://github.com/Jackzmc/sourcemod-plugins"
};
public void OnPluginStart() {

View file

@ -20,7 +20,7 @@ public Plugin myinfo =
author = "jackzmc",
description = "Makes bots automatically crown a witch in cases where a witch is blocking the way",
version = PLUGIN_VERSION,
url = ""
url = "https://github.com/Jackzmc/sourcemod-plugins"
};
//TODO: convars for allowed gamemodes / difficulties

View file

@ -16,7 +16,7 @@ public Plugin myinfo = {
author = "jackzmc",
description = "",
version = PLUGIN_VERSION,
url = ""
url = "https://github.com/Jackzmc/sourcemod-plugins"
};
ConVar noHibernate;

View file

@ -24,7 +24,7 @@ public Plugin myinfo =
author = "jackzmc",
description = "Prevents players from starting crescendos early",
version = PLUGIN_VERSION,
url = ""
url = "https://github.com/Jackzmc/sourcemod-plugins"
};
public void OnPluginStart()
@ -43,7 +43,7 @@ public void OnPluginStart()
hGamemode.GetString(gamemode, sizeof(gamemode));
hGamemode.AddChangeHook(Event_GamemodeChange);
AddNormalSoundHook(view_as<NormalSHook>(SoundHook));
AddNormalSoundHook(SoundHook);
//dhook setup
}
@ -111,7 +111,7 @@ public Action Event_ButtonPress(const char[] output, int entity, int client, flo
}
public Action SoundHook(int[] clients, int& numClients, char sample[PLATFORM_MAX_PATH], int& entity, int& channel, float& volume, int& level, int& pitch, int& flags, char[] soundEntry, int& seed) {
public Action SoundHook(int clients[MAXPLAYERS], int& numClients, char sample[PLATFORM_MAX_PATH], int& entity, int& channel, float& volume, int& level, int& pitch, int& flags, char soundEntry[PLATFORM_MAX_PATH], int& seed) {
if(StrEqual(sample, "npc/mega_mob/mega_mob_incoming.wav") && lastButtonPressTime > 0) {
if(GetGameTime() - lastButtonPressTime < PANIC_DETECT_THRESHOLD) {
panicStarted = true;

View file

@ -74,7 +74,7 @@ public Plugin myinfo =
author = "jackzmc",
description = "Automatic system for management of 5+ player games. Provides extra kits, items, and more",
version = PLUGIN_VERSION,
url = ""
url = "https://github.com/Jackzmc/sourcemod-plugins"
};
static ConVar hExtraItemBasePercentage, hAddExtraKits, hMinPlayers, hUpdateMinPlayers, hMinPlayersSaferoomDoor, hSaferoomDoorWaitSeconds, hSaferoomDoorAutoOpen, hEPIHudState, hExtraFinaleTank, cvDropDisconnectTime, hSplitTankChance;

View file

@ -26,7 +26,7 @@ public Plugin myinfo =
author = "jackzmc",
description = "https://forums.alliedmods.net/showthread.php?t=325331",
version = PLUGIN_VERSION,
url = ""
url = "https://github.com/Jackzmc/sourcemod-plugins"
};

View file

@ -128,7 +128,7 @@ public Plugin myinfo = {
author = "jackzmc",
description = "",
version = PLUGIN_VERSION,
url = ""
url = "https://github.com/Jackzmc/sourcemod-plugins"
};
public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max) {

View file

@ -24,7 +24,7 @@ public Plugin myinfo =
author = "jackzmc",
description = "",
version = PLUGIN_VERSION,
url = ""
url = "https://github.com/Jackzmc/sourcemod-plugins"
};
/*TODO:

View file

@ -17,7 +17,7 @@ public Plugin myinfo =
author = "jackzmc",
description = "",
version = PLUGIN_VERSION,
url = ""
url = "https://github.com/Jackzmc/sourcemod-plugins"
};
static ConVar hPercentTotal;
@ -27,7 +27,6 @@ static ConVar hPercentCeda;
static ConVar hPercentWorker;
static ConVar hPercentRiot;
static ConVar hPercentJimmy;
static ConVar hPercentFallen;
static ConVar hTotalZombies;
static ConVar hZCommonLimit;

View file

@ -21,7 +21,7 @@ public Plugin myinfo =
author = "jackzmc",
description = "System to save and rollback to states in the game, usually pre-troll",
version = PLUGIN_VERSION,
url = ""
url = "https://github.com/Jackzmc/sourcemod-plugins"
};
enum struct PlayerState {

View file

@ -10,7 +10,7 @@ public Plugin myinfo =
author = "DingbatFlat",
description = "Survivor Bot Fix. Improve Survivor Bot",
version = "1.00",
url = ""
url = "https://github.com/Jackzmc/sourcemod-plugins"
}
/*
@ -483,7 +483,7 @@ void inputConfig()
*= Round / Start Ready / Select Improved Targets
*=
================================================================================================ */
public Action Event_RoundStart(Event event, const char[] name, bool dontBroadcast)
public void Event_RoundStart(Event event, const char[] name, bool dontBroadcast)
{
for (int x = 1; x <= MAXPLAYERS; x++) g_bFixTarget[x] = false; // RESET
@ -498,7 +498,7 @@ public Action Event_RoundStart(Event event, const char[] name, bool dontBroadcas
InitTimers();
}
public Action Event_BotAndPlayerReplace(Handle event, const char[] name, bool dontBroadcast)
public void Event_BotAndPlayerReplace(Handle event, const char[] name, bool dontBroadcast)
{
if (!LeftSafeRoom) return;
@ -634,6 +634,7 @@ public Action Timer_ShoveChance(Handle Timer)
}
}
}
return Plugin_Continue;
}
@ -1880,7 +1881,7 @@ public Action Event_PlayerDeath(Handle event, const char[] name, bool dontBroadc
return Plugin_Handled;
}
public Action Event_WitchRage(Handle event, const char[] name, bool dontBroadcast)
public void Event_WitchRage(Handle event, const char[] name, bool dontBroadcast)
{
int attacker = GetClientOfUserId(GetEventInt(event, "userid"));
@ -1940,7 +1941,7 @@ stock void ScriptCommand(int client, const char[] command, const char[] argument
stock void L4D2_RunScript(const char[] sCode, any ...)
{
static iScriptLogic = INVALID_ENT_REFERENCE;
static int iScriptLogic = INVALID_ENT_REFERENCE;
if(iScriptLogic == INVALID_ENT_REFERENCE || !IsValidEntity(iScriptLogic)) {
iScriptLogic = EntIndexToEntRef(CreateEntityByName("logic_script"));
if(iScriptLogic == INVALID_ENT_REFERENCE || !IsValidEntity(iScriptLogic))
@ -2226,7 +2227,7 @@ stock bool isInterruptTo(int client, int target)
GetClientEyePosition(client, self_pos);
computeAimAngles(client, target, aim_angles);
int Handle trace = TR_TraceRayFilterEx(self_pos, aim_angles, MASK_SOLID, RayType_Infinite, traceFilter, client);
Handle trace = TR_TraceRayFilterEx(self_pos, aim_angles, MASK_SOLID, RayType_Infinite, traceFilter, client);
if (TR_DidHit(trace)) {
int hit = TR_GetEntityIndex(trace);
if (hit == target) {

View file

@ -15,7 +15,7 @@ public Plugin myinfo =
author = "jackzmc",
description = "",
version = PLUGIN_VERSION,
url = ""
url = "https://github.com/Jackzmc/sourcemod-plugins"
};
#define TANK_CLASS_ID 8

View file

@ -16,7 +16,7 @@ public Plugin myinfo =
author = "jackzmc",
description = "",
version = PLUGIN_VERSION,
url = ""
url = "https://github.com/Jackzmc/sourcemod-plugins"
};
static Database DB;
@ -73,6 +73,7 @@ public int Menu_Disconnected(Menu menu, MenuAction action, int client, int item)
WaitingForNotePlayer = client;
} else if (action == MenuAction_End)
delete menu;
return 0;
}
public Action OnClientSayCommand(int client, const char[] command, const char[] sArgs) {
@ -184,7 +185,7 @@ bool ConnectDB() {
}
}
public Action Event_FirstSpawn(Event event, const char[] name, bool dontBroadcast) {
public void Event_FirstSpawn(Event event, const char[] name, bool dontBroadcast) {
int client = GetClientOfUserId(event.GetInt("userid"));
if(client > 0 && client <= MaxClients && !IsFakeClient(client)) {
static char auth[32];
@ -194,7 +195,7 @@ public Action Event_FirstSpawn(Event event, const char[] name, bool dontBroadcas
}
}
public Action Event_PlayerDisconnect(Event event, const char[] name, bool dontBroadcast) {
public void Event_PlayerDisconnect(Event event, const char[] name, bool dontBroadcast) {
if(!event.GetBool("bot")) {
PlayerData data;
event.GetString("networkid", data.id, sizeof(data.id));