diff --git a/addons/sourcemod/scripting/include/shavit/misc.inc b/addons/sourcemod/scripting/include/shavit/misc.inc new file mode 100644 index 00000000..7a6ddd03 --- /dev/null +++ b/addons/sourcemod/scripting/include/shavit/misc.inc @@ -0,0 +1,50 @@ +/* + * shavit's Timer - misc.inc file + * by: shavit + * + * This file is part of shavit's Timer. + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License, version 3.0, as published by the + * Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + * + */ + +#if defined _shavit_misc_included + #endinput +#endif +#define _shavit_misc_included + +/** + * Checks if a player is hiding players + * + * @param client Client index. + * @return Boolean value. + */ +native bool Shavit_IsClientUsingHide(int client); + +public SharedPlugin __pl_shavit_misc = +{ + name = "shavit-misc", + file = "shavit-misc.smx", +#if defined REQUIRE_PLUGIN + required = 1 +#else + required = 0 +#endif +}; + +#if !defined REQUIRE_PLUGIN +public void __pl_shavit_misc_SetNTVOptional() +{ + MarkNativeAsOptional("Shavit_IsClientUsingHide"); +} +#endif diff --git a/addons/sourcemod/scripting/shavit-misc.sp b/addons/sourcemod/scripting/shavit-misc.sp index 56117095..9fbc2237 100644 --- a/addons/sourcemod/scripting/shavit-misc.sp +++ b/addons/sourcemod/scripting/shavit-misc.sp @@ -32,6 +32,7 @@ #include #include +#include #undef REQUIRE_PLUGIN #include @@ -158,6 +159,8 @@ public Plugin myinfo = public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max) { + CreateNative("Shavit_IsClientUsingHide", Native_IsClientUsingHide); + gB_Late = late; return APLRes_Success; @@ -2623,3 +2626,8 @@ public Action Command_Drop(int client, const char[] command, int argc) return Plugin_Handled; } + +public int Native_IsClientUsingHide(Handle plugin, int numParams) +{ + return gB_Hide[GetNativeCell(1)]; +}