diff --git a/Hitmarker/materials/overlays/nano/hitmarker.vmt b/Hitmarker/content/overlays/nano/hitmarker.vmt similarity index 100% rename from Hitmarker/materials/overlays/nano/hitmarker.vmt rename to Hitmarker/content/overlays/nano/hitmarker.vmt diff --git a/Hitmarker/materials/overlays/nano/hitmarker.vtf b/Hitmarker/content/overlays/nano/hitmarker.vtf similarity index 100% rename from Hitmarker/materials/overlays/nano/hitmarker.vtf rename to Hitmarker/content/overlays/nano/hitmarker.vtf diff --git a/Hitmarker/sound/unloze/hm_v2.mp3 b/Hitmarker/content/sound/unloze/hm_v2.mp3 similarity index 100% rename from Hitmarker/sound/unloze/hm_v2.mp3 rename to Hitmarker/content/sound/unloze/hm_v2.mp3 diff --git a/PlayerManager/scripting/PlayerManager_RevEmu.sp b/PlayerManager/scripting/PlayerManager_RevEmu.sp deleted file mode 100644 index 5f32ed98..00000000 --- a/PlayerManager/scripting/PlayerManager_RevEmu.sp +++ /dev/null @@ -1,333 +0,0 @@ -#pragma semicolon 1 - -#include -#include -#include - -#pragma newdecls required - -/* CONVARS */ -ConVar g_hCvar_BlockSpoof; -ConVar g_hCvar_BlockAdmin; -ConVar g_hCvar_BlockVoice; - -/* DATABASE */ -Database g_hDatabase; - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public Plugin myinfo = -{ - name = "PlayerManager: RevEmu", - author = "zaCade + Neon", - description = "Manage clients, denying admin access, ect.", - version = "2.0.0" -}; - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public APLRes AskPluginLoad2(Handle hMyself, bool bLate, char[] sError, int errorSize) -{ - CreateNative("PM_IsPlayerSteam", Native_IsPlayerSteam); - CreateNative("PM_GetPlayerType", Native_GetPlayerType); - - RegPluginLibrary("PlayerManager"); - return APLRes_Success; -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void OnPluginStart() -{ - g_hCvar_BlockSpoof = CreateConVar("sm_manager_block_spoof", "1", "Kick unauthenticated people that join with known steamids.", FCVAR_NONE, true, 0.0, true, 1.0); - g_hCvar_BlockAdmin = CreateConVar("sm_manager_block_admin", "1", "Should unauthenticated people be blocked from admin?", FCVAR_NONE, true, 0.0, true, 1.0); - g_hCvar_BlockVoice = CreateConVar("sm_manager_block_voice", "1", "Should unauthenticated people be blocked from voice?", FCVAR_NONE, true, 0.0, true, 1.0); - - AddMultiTargetFilter("@steam", Filter_Steam, "Steam Players", false); - AddMultiTargetFilter("@nosteam", Filter_NoSteam, "No-Steam Players", false); - - RegConsoleCmd("sm_steam", Command_DisplaySteamStats, "Shows the number of Steam and No-Steam players"); - RegConsoleCmd("sm_nosteam", Command_DisplaySteamStats, "Shows the number of Steam and No-Steam players"); - - AutoExecConfig(); -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void OnConfigsExecuted() -{ - if(!g_hCvar_BlockSpoof.BoolValue) - return; - - Database.Connect(SQL_OnDatabaseConnect, "PlayerManager"); -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void OnPluginEnd() -{ - RemoveMultiTargetFilter("@steam", Filter_Steam); - RemoveMultiTargetFilter("@nosteam", Filter_NoSteam); -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public Action Command_DisplaySteamStats(int client, int args) -{ - char aBuf[1024]; - char aBuf2[MAX_NAME_LENGTH]; - - for(int i = 1; i <= MaxClients; i++) - { - if(IsClientInGame(i) && !IsFakeClient(i)) - { - if(!RevEmu_IsPlayerSteam(i)) - { - GetClientName(i, aBuf2, sizeof(aBuf2)); - StrCat(aBuf, sizeof(aBuf), aBuf2); - StrCat(aBuf, sizeof(aBuf), ", "); - } - } - } - - if(strlen(aBuf)) - { - aBuf[strlen(aBuf) - 2] = 0; - ReplyToCommand(client, "[SM] No-Steam clients online: %s", aBuf); - } - else - ReplyToCommand(client, "[SM] No-Steam clients online: none"); - - return Plugin_Handled; -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public bool Filter_Steam(const char[] sPattern, Handle hClients) -{ - for(int i = 1; i <= MaxClients; i++) - { - if(IsClientInGame(i) && !IsFakeClient(i)) - { - if(RevEmu_IsPlayerSteam(i)) - PushArrayCell(hClients, i); - } - } - return true; -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public bool Filter_NoSteam(const char[] sPattern, Handle hClients) -{ - for(int i = 1; i <= MaxClients; i++) - { - if(IsClientInGame(i) && !IsFakeClient(i)) - { - if(!RevEmu_IsPlayerSteam(i)) - PushArrayCell(hClients, i); - } - } - return true; -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void OnClientAuthorized(int client, const char[] sAuthID) -{ - if(!g_hCvar_BlockSpoof.BoolValue || !g_hDatabase) - return; - - if(IsFakeClient(client) || IsClientSourceTV(client)) - return; - - char sQuery[512]; - Format(sQuery, sizeof(sQuery), "SELECT * FROM connections WHERE auth='%s'", sAuthID); - - g_hDatabase.Query(SQL_OnQueryCompleted, sQuery, GetClientSerial(client), DBPrio_Low); -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public Action OnClientPreAdminCheck(int client) -{ - if(!g_hCvar_BlockAdmin.BoolValue) - return Plugin_Continue; - - if(IsFakeClient(client) || IsClientSourceTV(client)) - return Plugin_Continue; - - if(!RevEmu_IsPlayerSteam(client)) - { - char sConnectionType[32]; - RevEmu_GetPlayerType(client, sConnectionType, sizeof(sConnectionType)); - - LogMessage("%L has a illegitimate connection type: '%s', denying admin.", client, sConnectionType); - NotifyPostAdminCheck(client); - return Plugin_Handled; - } - else return Plugin_Continue; -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void OnClientPostAdminCheck(int client) -{ - if(!g_hCvar_BlockVoice.BoolValue) - return; - - if(IsFakeClient(client) || IsClientSourceTV(client)) - return; - - if(!RevEmu_IsPlayerSteam(client)) - { - char sConnectionType[32]; - RevEmu_GetPlayerType(client, sConnectionType, sizeof(sConnectionType)); - - LogMessage("%L has a illegitimate connection type: '%s', muting client.", client, sConnectionType); - BaseComm_SetClientMute(client, true); - return; - } -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void SQL_OnDatabaseConnect(Database db, const char[] error, any data) -{ - if(!db || strlen(error)) - { - LogError("Database error: %s", error); - return; - } - - g_hDatabase = db; - - char sQuery[512]; - Format(sQuery, sizeof(sQuery), "CREATE TABLE IF NOT EXISTS connections (`auth` varchar(32), `type` varchar(32), `address` varchar(16), PRIMARY KEY (`auth`))"); - - g_hDatabase.Query(SQL_OnQueryCompleted, sQuery, _, DBPrio_High); -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void SQL_OnQueryCompleted(Database db, DBResultSet results, const char[] error, any data) -{ - if(!db || strlen(error)) - { - LogError("Query error: %s", error); - return; - } - - int client; - if ((client = GetClientFromSerial(data)) == 0) - return; - - char sAuthID[32]; - GetClientAuthId(client, AuthId_Steam2, sAuthID, sizeof(sAuthID)); - - char sAddress[16]; - GetClientIP(client, sAddress, sizeof(sAddress)); - - char sConnectionType[32]; - RevEmu_GetPlayerType(client, sConnectionType, sizeof(sConnectionType)); - - if(results.RowCount && results.FetchRow()) - { - int iFieldNum; - char sResultAddress[16]; - char sResultConnectionType[32]; - - results.FieldNameToNum("address", iFieldNum); - results.FetchString(iFieldNum, sResultAddress, sizeof(sResultAddress)); - - results.FieldNameToNum("type", iFieldNum); - results.FetchString(iFieldNum, sResultConnectionType, sizeof(sResultConnectionType)); - - delete results; - - if(!RevEmu_IsPlayerSteam(client)) - { - if(!StrEqual(sConnectionType, sResultConnectionType, false) && StrEqual(sResultConnectionType, "SteamLegit", false)) - { - if(StrEqual(sAddress, sResultAddress, false)) - { - LogMessage("%L tried to join with a legitimate steamid while having a illegitimate connection type: '%s'. Allowing connection, IPs match. (Known: %s)", client, sConnectionType, sAddress); - } - else - { - LogAction(client, -1, "\"%L\" tried to join with a legitimate steamid while having a illegitimate connection type: '%s'. Refusing connection, IPs dont match. (Known: %s | Current: %s)", client, sConnectionType, sResultAddress, sAddress); - KickClient(client, "Trying to join with a legitimate steamid while having a illegitimate connection."); - return; - } - } - } - } - - char sQuery[512]; - Format(sQuery, sizeof(sQuery), "INSERT INTO connections (auth, type, address) VALUES ('%s', '%s', '%s') ON DUPLICATE KEY UPDATE type='%s', address='%s';", sAuthID, sConnectionType, sAddress, sConnectionType, sAddress); - - g_hDatabase.Query(SQL_OnQueryCompleted, sQuery, _, DBPrio_Low); -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public int Native_IsPlayerSteam(Handle hPlugin, int numParams) -{ - int client = GetNativeCell(1); - - if (client < 1 || client > MaxClients) - { - return ThrowNativeError(SP_ERROR_NATIVE, "Client index %d is invalid", client); - } - else if (!IsClientConnected(client)) - { - return ThrowNativeError(SP_ERROR_NATIVE, "Client %d is not connected", client); - } - else if (IsFakeClient(client)) - { - return ThrowNativeError(SP_ERROR_NATIVE, "Client %d is a bot", client); - } - - return RevEmu_IsPlayerSteam(client); -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public int Native_GetPlayerType(Handle hPlugin, int numParams) -{ - int client = GetNativeCell(1); - int length = GetNativeCell(3); - - if (client < 1 || client > MaxClients) - { - return ThrowNativeError(SP_ERROR_NATIVE, "Client index %d is invalid", client); - } - else if (!IsClientConnected(client)) - { - return ThrowNativeError(SP_ERROR_NATIVE, "Client %d is not connected", client); - } - else if (IsFakeClient(client)) - { - return ThrowNativeError(SP_ERROR_NATIVE, "Client %d is a bot", client); - } - - char[] sPlayerType = new char[length + 1]; - RevEmu_GetPlayerType(client, sPlayerType, length + 1); - - return !SetNativeString(2, sPlayerType, length + 1); -} \ No newline at end of file diff --git a/QuickSwitch/_QuickSwitch/scripting/QuickSwitch.sp b/QuickSwitch/_QuickSwitch/scripting/QuickSwitch.sp deleted file mode 100644 index 90b0ad72..00000000 --- a/QuickSwitch/_QuickSwitch/scripting/QuickSwitch.sp +++ /dev/null @@ -1,73 +0,0 @@ -#pragma semicolon 1 -#pragma newdecls required - -#include -#include -#include - -ConVar g_Cvar_QuickSwitch_Knife; -float g_flNextAttack[MAXPLAYERS + 1] = {0.0, ...}; -bool g_bSetNextAttack[MAXPLAYERS + 1] = false; - -public Plugin myinfo = -{ - name = "Knife QuickSwitch", - author = "BotoX", - description = "Switching to knife without delay.", - version = "1.0", - url = "" -}; - -public void OnPluginStart() -{ - g_Cvar_QuickSwitch_Knife = CreateConVar("sm_quickswitch_knife", "1", "Enable Knife QuickSwitch.", 0, true, 0.0, true, 1.0); - - AutoExecConfig(true, "plugin.QuickSwitch"); - - /* Handle late load */ - for(int client = 1; client <= MaxClients; client++) - { - if(IsClientInGame(client)) - OnClientPutInServer(client); - } -} - -public void OnClientPutInServer(int client) -{ - g_flNextAttack[client] = 0.0; - g_bSetNextAttack[client] = false; - SDKHook(client, SDKHook_WeaponSwitch, OnWeaponSwitch); - SDKHook(client, SDKHook_WeaponSwitchPost, OnWeaponSwitchPost); -} - -public void OnWeaponSwitch(int client, int weapon) -{ - if(!g_Cvar_QuickSwitch_Knife.BoolValue || !IsPlayerAlive(client) || ZR_IsClientZombie(client)) - return; - - char sWeaponName[32]; - GetEdictClassname(weapon, sWeaponName, sizeof(sWeaponName)); - - if(!StrEqual(sWeaponName, "weapon_knife")) - return; - - float flNextPrimaryAttack = GetEntPropFloat(weapon, Prop_Data, "m_flNextPrimaryAttack"); - float flNextSecondaryAttack = GetEntPropFloat(weapon, Prop_Data, "m_flNextSecondaryAttack"); - - if(flNextPrimaryAttack > g_flNextAttack[client]) - g_flNextAttack[client] = flNextPrimaryAttack; - - if(flNextSecondaryAttack > g_flNextAttack[client]) - g_flNextAttack[client] = flNextSecondaryAttack; - - g_bSetNextAttack[client] = true; -} - -public void OnWeaponSwitchPost(int client, int weapon) -{ - if(g_bSetNextAttack[client]) - { - SetEntPropFloat(client, Prop_Send, "m_flNextAttack", g_flNextAttack[client]); - g_bSetNextAttack[client] = false; - } -} diff --git a/Spectate/include/Spectate.inc b/Spectate/scripting/include/Spectate.inc similarity index 100% rename from Spectate/include/Spectate.inc rename to Spectate/scripting/include/Spectate.inc diff --git a/includes/Spectate.inc b/includes/Spectate.inc index 70d5c0d1..7ca1b43d 120000 --- a/includes/Spectate.inc +++ b/includes/Spectate.inc @@ -1 +1 @@ -../Spectate/include/Spectate.inc \ No newline at end of file +../Spectate/scripting/include/Spectate.inc \ No newline at end of file diff --git a/includes/zr/napalm.zr.inc b/includes/zr/napalm.zr.inc index 82bbc666..7e864597 100644 --- a/includes/zr/napalm.zr.inc +++ b/includes/zr/napalm.zr.inc @@ -42,4 +42,4 @@ forward Action ZR_OnClientIgnite(int &client, float &duration); * @param client The client to ignite. * @param duration The burn duration. */ -forward void ZR_OnClientIgnited(int client, float duration); \ No newline at end of file +forward void ZR_OnClientIgnited(int client, float duration); diff --git a/includes/zr_grenade_effects.inc b/includes/zr_grenade_effects.inc deleted file mode 100644 index 80e3fd0c..00000000 --- a/includes/zr_grenade_effects.inc +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Called when a player is about to be freezed by a grenade - * - * @param client The victim index - * @param attacker The client index who threw the grenade - * @param duration The freeze duration, set by reference - * @return Plugin_Changed to apply new values, Plugin_Contninue to allow as is and >= Plugin_Handled to block - */ -forward Action:ZR_OnClientFreeze(client, attacker, &Float:duration); - -/** - * Called when a player has been freezed by a grenade - * - * @param client The victim index - * @param attacker The client index who threw the grenade - * @param duration The freeze duration - * @noreturn - */ -forward ZR_OnClientFreezed(client, attacker, Float:duration); - -/** - * Called when a player is about to be ignited by a grenade - * - * @param client The victim index - * @param attacker The client index who threw the grenade - * @param duration The ignite duration, set by reference - * @return Plugin_Changed to apply new values, Plugin_Contninue to allow as is and >= Plugin_Handled to block - */ -forward Action:ZR_OnClientIgnite(client, attacker, &Float:duration); - -/** - * Called when a player has been ignited by a grenade - * - * @param client The victim index - * @param attacker The client index who threw the grenade - * @param duration The freeze duration - * @noreturn - */ -forward ZR_OnClientIgnited(client, attacker, Float:duration); - -/** - * Called when a grenade will get his effect - * - * @param client Client that throw the grenade - * @param grenade Grenade index - * @return Plugin_Continue to allow as is and Plugin_Handled to block effect in the grenade - */ -forward Action:ZR_OnGrenadeEffect(client, grenade); \ No newline at end of file