Created
June 12, 2023 16:27
-
-
Save ArKaNeMaN/5c8ecf410b1574ccdbba6da39a0bb654 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> | |
#include <VipModular> | |
native give_bananabomb(pPlayer, iCount); | |
/* | |
Выдача банана-бомбы от CHEL74 | |
Название предмета: BananaBomb | |
Параметры: | |
Count - Сколько гранат выдать. По умолчанию 1. | |
Пример: | |
{ | |
"Type": "BananaBomb" | |
} | |
*/ | |
public stock const PluginName[] = "[VipM-I] Banana Bomb"; | |
public stock const PluginVersion[] = "1.0.0"; | |
public stock const PluginAuthor[] = "CHEL74"; | |
public stock const PluginURL[] = "t.me/arkanaplugins"; | |
public stock const PluginDescription[] = "[VipModular-Item] Support for CHEL74's Banana Bomb"; | |
new const TYPE_NAME[] = "BananaBomb"; | |
public VipM_IC_OnInitTypes() { | |
register_plugin(PluginName, PluginVersion, PluginAuthor); | |
VipM_IC_RegisterType(TYPE_NAME); | |
VipM_IC_RegisterTypeEvent(TYPE_NAME, ItemType_OnRead, "@OnRead"); | |
VipM_IC_RegisterTypeEvent(TYPE_NAME, ItemType_OnGive, "@OnGive"); | |
} | |
@OnRead(const JSON:jCfg, Trie:tParams) { | |
TrieDeleteKey(tParams, "Name"); | |
if (json_object_has_value(jCfg, "Count", JSONNumber)) { | |
TrieSetCell(tParams, "Count", json_object_get_number(jCfg, "Count")); | |
} | |
return VIPM_CONTINUE; | |
} | |
@OnGive(const UserId, const Trie:tParams) { | |
return give_bananabomb(UserId, VipM_Params_GetInt(tParams, "Count", 1)) | |
? VIPM_CONTINUE | |
: VIPM_STOP; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment