AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Difficulty building a plugin(help) (https://forums.alliedmods.net/showthread.php?t=325705)

alferd 07-03-2020 07:09

Difficulty building a plugin(help)
 
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 088number 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(iditemid

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; }

OciXCrom 07-03-2020 07:57

Re: Difficulty building a plugin(help)
 
There is no error in that line. The number of arguments is correct from the codes you provided.

Post the full code and .inc file. The one you provided doesn't match the one included in your code.

Quote:

#include <ad_points>
adp_points.inc

alferd 07-03-2020 08:29

Re: Difficulty building a plugin(help)
 
Solved


All times are GMT -4. The time now is 17:11.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.