I had a problem making this plugin and I ask you for help
I sent all the files
Error:
PHP Code:
//// adp_hp_item.sma
//
// C:\PROGRA~1\COUNTE~4\cstrike\addons\amxmodx\SCRIPT~1\adp_hp_item.sma(16) : er
ror 088: number of arguments does not match definition
//
// 1 Error.
// Could not locate output file compiled\adp_hp_item.amx (compile failed).
//
// Compilation Time: 0.12 sec
// ----------------------------------------
adp_hp_item.sma
Code:
#include <amxmodx>
#include <fun>
#include <ad_points>
new const name[] = "Buy HP!"
new g_itemid_buyhp
new hpamount
new point = 10
public plugin_init()
{
register_plugin("Buy Health Points", "1.0", "....")
hpamount = register_cvar("adp_buyhp_amount", "1000")
g_itemid_buyhp = adp_register_extra_item(name, point)
}
public adp_extra_item_selected(id,itemid)
{
if(!is_user_alive(id))
return PLUGIN_HANDLED;
if(itemid==g_itemid_buyhp)
{
if(ad_get_user_points(id) < 5)
{
return PLUGIN_HANDLED;
}
else
{
set_user_health(id,get_user_health(id)+get_pcvar_num(hpamount));
ad_set_user_points(id, ad_get_user_points(id) - 5);
}
}
return PLUGIN_CONTINUE;
}
adp_points.inc
PHP Code:
native adp_register_extra_item(const name[], point)
forward adp_extra_item_selected(id, itemid)
adp_item_manager.sma
Code:
enum _:TOTAL_FORWARDS
{
FW_ITEM_SELECT_PRE = 0,
FW_ITEM_SELECT_POST,
FW_EXTRA_ITEM_SELECTED
}
new g_Forwards[TOTAL_FORWARDS]
new g_ForwardResult
public plugin_init()
{
g_Forwards[FW_EXTRA_ITEM_SELECTED] = CreateMultiForward("adp_extra_item_selected", ET_CONTINUE, FP_CELL, FP_CELL)
}
public plugin_natives()
{
register_native("adp_register_extra_item", "native_register_extra_item")
}
public native_register_extra_item(plugin_id, num_params)
{
/*if (!LibraryExists(LIBRARY_ITEMS, LibType_Library))
return -1;*/
new name[32]
get_string(1, name, charsmax(name))
new point = get_param(2)
new itemid = adp_items_register(name, point)
if (itemid < 0) return itemid;
ArrayPushCell(g_ItemID, itemid)
return itemid;
}
__________________