#include <amxmodx>
#include <reapi>
new const ITEMS[][] =
{
// https://github.com/s1lentq/ReGameDLL_CS/blob/master/regamedll/extra/Toolkit/GameDefinitionFile/regamedll-cs.fgd#L1404-L1688
"weapon_knife",
"weapon_usp",
"ammo_45acp",
"ammo_45acp",
"ammo_45acp",
"ammo_45acp",
"weapon_deagle",
"ammo_50ae",
"ammo_50ae",
"ammo_50ae",
"ammo_50ae",
"weapon_flashbang",
"weapon_hegrenade",
"weapon_smokegrenade",
}
public plugin_init()
{
register_plugin("Bonus for VIP", "0.0.1b", "wopox1337");
// register_clcmd("radio1", "__GiveItems");
}
public OnConfigsExecuted()
{
if(get_member_game(m_bMapHasVIPSafetyZone))
{
RegisterHookChain(RG_CBasePlayer_GiveDefaultItems, "CBasePlayer_GiveDefaultItems", .post = false);
} else pause("a");
}
public CBasePlayer_GiveDefaultItems(const this)
{
if(get_member(this, m_bIsVIP))
{
// cuz: https://github.com/s1lentq/ReGameDLL_CS/blob/26db32e8845647cf024e38f11cb3da3071ac0dd1/regamedll/dlls/weapons.cpp#L566
rg_remove_all_items(this);
set_member(this, m_bIsVIP, false);
__GiveItems(this);
set_member(this, m_bIsVIP, true); // F'kin dirty hax:)
return HC_SUPERCEDE;
}
return HC_CONTINUE;
}
public __GiveItems(id)
{
for(new i; i < sizeof ITEMS; i++)
{
rg_give_item(id, ITEMS[i], GT_APPEND);
}
}