Last active
April 20, 2024 21:35
-
-
Save ArKaNeMaN/42c7201e1bb19e2d2e3a72782c695f7b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <amxmodx> | |
#tryinclude <awp_restrictions> | |
#include <VipModular> | |
/* | |
Интеграция с авп лимитов от Радиуса. | |
Пример использования: | |
{ // Сработает, если игрок может взять авп | |
"Limit": "Radius-AwpRestricted", | |
"Not": true | |
} | |
{ // Сработает, если игрок НЕ может взять авп | |
"Limit": "Radius-AwpRestricted" | |
} | |
*/ | |
#if !defined _awp_restrictions_api_included | |
enum ar_status | |
{ | |
AWP_NOT_RESTRICTED = 0, | |
AWP_RESTRICTED_BY_MAP = 1, | |
AWP_RESTRICTED_BY_START_ROUND = 2, | |
AWP_RESTRICTED_BY_PLAYERSNUM = 3, | |
AWP_RESTRICTED_BY_TIME = 4, | |
AWP_RESTRICTED_BY_ROUND = 5, | |
AWP_RESTRICTED_BY_TEAM = 6, | |
AWP_RESTRICTED_BY_SKILL = 7, | |
AWP_RESTRICTED_BY_TEAM_SCORE = 8 | |
} | |
/** | |
* Получает статус запрета AWP для игрока по его индексу | |
* | |
* @param index индекс игрока | |
* | |
* @return возвращает одно из значений перечисления ar_status | |
*/ | |
native ar_status: ar_get_status(index); | |
#endif | |
public stock const PluginName[] = "[VipM-L] Awp Restrictions by Radius"; | |
public stock const PluginVersion[] = "1.0.1"; | |
public stock const PluginAuthor[] = "ArKaNeMaN"; | |
public stock const PluginURL[] = "t.me/arkanaplugins"; | |
public stock const PluginDescription[] = "[VipModular-Limit] Integration with Awp Restrictions by Radius."; | |
new const LIMIT_NAME[] = "Radius-AwpRestricted"; | |
public VipM_OnInitModules() { | |
register_plugin(PluginName, PluginVersion, PluginAuthor); | |
VipM_Limits_RegisterType(LIMIT_NAME, true, false); | |
VipM_Limits_AddTypeParams(LIMIT_NAME, | |
"Not", ptBoolean, false | |
); | |
VipM_Limits_RegisterTypeEvent(LIMIT_NAME, Limit_OnCheck, "@OnCheck"); | |
} | |
@OnCheck(const Trie:tParams, const UserId) { | |
new bool:bRes = ar_get_status(UserId) != AWP_NOT_RESTRICTED; | |
return VipM_Params_GetBool(tParams, "Not", false) ? !bRes : bRes; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment