Raised This Month: $ Target: $400
 0% 

Problem whit Plugin Api


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Stylaa
Senior Member
Join Date: Oct 2009
Location: Flensburg, Germany
Old 01-17-2011 , 10:13   Re: Problem whit Plugin Api
Reply With Quote #3

hmm but when i add the Item via en Sub-Plugin everythink is working Well

Head
PHP Code:
//Shop
enum _:ItemData
{
    
ItemName32 ],
    
ItemCost,
    
ItemPlugin,
    
ItemFuncID
};
new Array:
g_aItems;
new 
g_iTotalItems
Plugin Init
PHP Code:
shop_item_add"Waffenwette",       15,         "gun_gamble" );

g_aItems ArrayCreateItemData ); 
Plugin Natives
PHP Code:
public plugin_natives( )
{
    
// register our custom library
    
register_library"plugin_api" );
    
    
// Native - Create Shop Item
    
register_native"shop_item_add""_shop_item_add" );


Error Part
PHP Code:
public _shop_item_addiPluginiParams )
{
    
// create an array to hold our item data
    
new eItemDataItemData ];
    
    
// get item name from function
    
get_string1eItemDataItemName ], charsmaxeItemDataItemName ] ) );
    
    
// get item cost from function
    
eItemDataItemCost ] = get_param);
    
    
// save the plugin adding the item
    
eItemDataItemPlugin ] = iPlugin;
    
    
// get item callback function
    
new szHandler32 ];
    
get_string3szHandlercharsmaxszHandler ) );
    
eItemDataItemFuncID ] = get_func_idszHandleriPlugin );
    
    
// add item to array and increase size
    
ArrayPushArrayg_aItemseItemData );             // The Error accures HERE but just when lunched from Main Plugin whit Sub Plugin Works
    
g_iTotalItems++;
    
    
// return the index of this item in the array
    // this creates the unique item index
    
return ( g_iTotalItems );

__________________

Some People brings Happynes by Coming
Some by Going
Stylaa is offline
Send a message via ICQ to Stylaa
 



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:12.


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