#include <amxmodx>
#include <gamecms_present>
#include <army_ranks_ultimate>
#include <gamecms5>
const g_iAnew = 10; //Сколько бонусов выдать
const g_iXp = 10; //Сколько опыта выдать
const Float:g_flMoney = 1.0; //Сколько денег выдать
new bool:g_API;
public OnPresentCoreStopped()
pause("ad");
public plugin_cfg()
CreatePresents();
public OnAPIPluginLoaded(Handle:sqlTuple)
g_API = true;
public csstats_initialized_post(Handle:Tuple)
{
CmsAddPresent(151, fmt("+%d опыта", g_iXp), -1);
CmsAddPresent(152, fmt("+%d anew", g_iAnew), -1);
}
public CreatePresents()
{
if(g_API)
CmsAddPresent(153, fmt("%.2f руб. на счет", g_flMoney), -1, -3);
}
public OnTakePresent(id, itemId)
{
switch(itemId)
{
case 153:
{
if(cmsapi_add_user_money(id, g_flMoney))
return PLUGIN_HANDLED;
}
case 151:
{
if(ar_set_user_addxp(id, g_iXp))
return PLUGIN_HANDLED;
}
case 152:
{
if(ar_add_user_anew(-1, id, g_iAnew) != -1)
return PLUGIN_HANDLED;
}
}
return PLUGIN_CONTINUE;
}