Raised This Month: $32 Target: $400
 8% 

Solved Difficulty building a plugin(help)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 07-03-2020 , 07:09   Difficulty building a plugin(help)
Reply With Quote #1

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; }
__________________
Jailbreak AD 2.0

The greatest civilization of 🇮🇷IRAN🇮🇷

Last edited by alferd; 07-03-2020 at 08:32.
alferd is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-03-2020 , 07:57   Re: Difficulty building a plugin(help)
Reply With Quote #2

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
__________________

Last edited by OciXCrom; 07-03-2020 at 07:57.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 07-03-2020 , 08:29   Re: Difficulty building a plugin(help)
Reply With Quote #3

Solved
__________________
Jailbreak AD 2.0

The greatest civilization of 🇮🇷IRAN🇮🇷

Last edited by alferd; 07-03-2020 at 08:31.
alferd is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:08.


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