diff --git a/README.md b/README.md index bf030f81..7d4ea556 100644 --- a/README.md +++ b/README.md @@ -13,11 +13,11 @@ a bhop server should be simple # Requirements: * [SourceMod 1.8 and above](http://www.sourcemod.net/downloads.php) * `clientprefs` plugin/extension. Comes built-in with SourceMod. -* [The RTLer](https://forums.alliedmods.net/showthread.php?p=1649882) is required to *compile* `shavit-chat`. +* [The RTLer](https://forums.alliedmods.net/showthread.php?p=1649882) is required to *compile* `shavit-chat` and you don't need Simple Chat Processor as listed in Ther RTLer's requirements. # Optional requirements: * [DHooks](http://users.alliedmods.net/~drifter/builds/dhooks/2.0/) - required for static 250 prestrafe (bhoptimer 1.2b and above) -* [The RTLer](https://forums.alliedmods.net/showthread.php?p=1649882) - required for properly formatted RTL text within `shavit-chat`` +* [The RTLer](https://forums.alliedmods.net/showthread.php?p=1649882) - required for properly formatted RTL text within `shavit-chat`. # Installation: 1. Add a database entry in addons/sourcemod/configs/databases.cfg, call it "shavit" diff --git a/scripting/include/dhooks.inc b/scripting/include/dhooks.inc index 85dcb31e..2b341cd0 100644 --- a/scripting/include/dhooks.inc +++ b/scripting/include/dhooks.inc @@ -1,3 +1,5 @@ +// code by Dr!fter https://forums.alliedmods.net/showthread.php?t=180114 + #if defined _dhooks_included #endinput #endif diff --git a/scripting/include/rtler.inc b/scripting/include/rtler.inc new file mode 100644 index 00000000..6fa2bdb7 --- /dev/null +++ b/scripting/include/rtler.inc @@ -0,0 +1,35 @@ +// code by alongub https://github.com/alongubkin/ + +#if defined _rtler_included + #endinput +#endif +#define _rtler_included + +#pragma semicolon 1 + +/** + * Converts a string that contains words in RTL languages to be displayed correctly in-game. + * + * @param dest Destination string buffer to copy the RTL-ed string to. + * @param destLen Destination buffer length (includes null terminator). + * @param original Original non-rtled string. + * + * @return The amount of words that needed RTLifying. + */ +native int RTLify(char[] dest, int destLen, const char[] original); + +public SharedPlugin __pl_rtler = +{ + name = "rtler", + file = "rtler.smx", +#if defined REQUIRE_PLUGIN + required = 1, +#else + required = 0, +#endif +}; + +public void __pl_rtler_SetNTVOptional() +{ + MarkNativeAsOptional("RTLify"); +} diff --git a/scripting/shavit-chat.sp b/scripting/shavit-chat.sp index cf8c6957..f8b1795e 100644 --- a/scripting/shavit-chat.sp +++ b/scripting/shavit-chat.sp @@ -115,7 +115,7 @@ public void LoadConfig() { if(gKV_Chat != null) { - delete gKV_Chat; + delete gKV_Chat; } gKV_Chat = new KeyValues("Chat"); @@ -227,7 +227,9 @@ public void FormatChat(int client, const char[] sMessage, bool bAlive, int iTeam } } - FormatEx(buffer, maxlen, " \x03%s%s %N :\x01 %s", (bAlive || iTeam == CS_TEAM_SPECTATOR)? "":"*DEAD*", sTeam, client, bUseFormattedText? sFormattedText:sMessage); + // int iRank = Shavit_GetRank(client); + + FormatEx(buffer, maxlen, "%s\x03%s%s %N :\x01 %s", gSG_Type == Game_CSGO? " ":"", (bAlive || iTeam == CS_TEAM_SPECTATOR)? "":"*DEAD*", sTeam, client, bUseFormattedText? sFormattedText:sMessage); } public void ChatMessage(int from, int[] clients, int count, const char[] sMessage) diff --git a/scripting/shavit-misc.sp b/scripting/shavit-misc.sp index 16f8857d..e79bb7e6 100644 --- a/scripting/shavit-misc.sp +++ b/scripting/shavit-misc.sp @@ -48,6 +48,7 @@ ConVar gCV_StartOnSpawn = null; ConVar gCV_PrespeedLimit = null; ConVar gCV_HideRadar = null; ConVar gCV_TeleportCommands = null; +ConVar gCV_NoWeaponDrops = null; // dhooks Handle gH_GetMaxPlayerSpeed = null; @@ -107,6 +108,7 @@ public void OnPluginStart() gCV_PrespeedLimit = CreateConVar("shavit_misc_prespeedlimit", "280.00", "Prespeed limitation in startzone.", 0, true, 10.0, false); gCV_HideRadar = CreateConVar("shavit_misc_hideradar", "1", "Should the plugin hide the in-game radar?", 0, true, 0.0, true, 1.0); gCV_TeleportCommands = CreateConVar("shavit_misc_tpcmds", "1", "Enable teleport-related commands? (sm_goto/sm_tpto)\n0 - Disabled\n1 - Enabled", 0, true, 0.0, true, 1.0); + gCV_NoWeaponDrops = CreateConVar("shavit_misc_noweapondrops", "1", "Remove every dropped weapon.\n0 - Disabled\n1 - Enabled", 0, true, 0.0, true, 1.0); AutoExecConfig(); @@ -281,8 +283,11 @@ public void OnClientPutInServer(int client) { gB_Hide[client] = false; - SDKHook(client, SDKHook_SetTransmit, OnSetTransmit); SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage); + SDKHook(client, SDKHook_SetTransmit, OnSetTransmit); + SDKHook(client, SDKHook_WeaponDrop, OnWeaponDrop); + + /*gCV_NoWeaponDrops*/ if(gH_GetMaxPlayerSpeed != null) { @@ -326,6 +331,14 @@ public Action OnTakeDamage(int victim, int attacker) return Plugin_Continue; } +public void OnWeaponDrop(int client, int entity) +{ + if(gCV_NoWeaponDrops.BoolValue && IsValidEntity(entity)) + { + AcceptEntityInput(entity, "Kill"); + } +} + // hide public Action OnSetTransmit(int entity, int client) { diff --git a/scripting/shavit-stats.sp b/scripting/shavit-stats.sp index 67a46e96..c61d0ca3 100644 --- a/scripting/shavit-stats.sp +++ b/scripting/shavit-stats.sp @@ -313,7 +313,7 @@ public void ShowMaps(int client) { if(gB_Rankings) { - FormatEx(sQuery, 256, "SELECT pt.map, pt.time, pt.jumps, pt.id, pp.points FROM %splayertimes pt JOIN %splayerpoints pp ON pt.id = pp.recordid WHERE auth = '%s' AND style = %d ORDER BY map;", gS_MySQLPrefix, gS_MySQLPrefix, sAuth, view_as(gBS_Style[client])); + FormatEx(sQuery, 256, "SELECT pt.map, pt.time, pt.jumps, pt.id, pp.points FROM %splayertimes pt JOIN %splayerpoints pp ON pt.id = pp.recordid WHERE auth = '%s' AND style = %d ORDER BY points DESC;", gS_MySQLPrefix, gS_MySQLPrefix, sAuth, view_as(gBS_Style[client])); } else