RESOLVED:
The problem was that i forgot to put register_library in the main plugin
--------------------------------------------------------------------------------------------------------------------------------------------------------
Hello! I made a Menu plugin based in this tutorial:
http://forums.alliedmods.net/showthread.php?t=123445
The problem is that the sub-plugin is receiving this error in counter-strike:
L 01/05/2011 - 13:07:57: [AMXX] Plugin "smvplugintest.amxx" failed to load: Module/Library "svminc" required for plugin. Check modules.ini
Here is the full include file: (note: the name is svminc and it's in the scripting/include folder)
PHP Code:
// Server VIP Manager INCLUDE FILE
// VERSION: 1.0
// BY: fmfs10
/* Thanks to:
Exolent[jNr]
*/
////////////////////////////////////////////////////////////////////////////////////////////////////
// Checks
////////////////////////////////////////////////////////////////////////////////////////////////////
#if defined _svminc_included
#endinput
#endif
#define _svminc_included
#if AMXX_VERSION_NUM >= 175
#pragma reqlib svminc
#if !defined AMXMODX_NOAUTOLOAD
#pragma loadlib svminc
#endif
#else
#pragma library svminc
#endif
////////////////////////////////////////////////////////////////////////////////////////////////////
// Natives
////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* Returns if index is VIP or not.
*
* @note This will return 0 if index remove vip advantages.
*
* @param id The index of the client.
* @return 1 if index is VIP, 0 otherwise.
*/
native svm_playervip(id);
/**
* Add Item in Menu
* This Exec then the player choose a item of the Main Menu
* Please DON'T give a big itemname because will bug the menu
*
* @param item Nš of item
* @param szHandler Plugin Handled
* @param default_on Is plugin on by default?
*
*/
native svm_addmenuitem(const itemname[], const szHandler[ ], default_on=1);
////////////////////////////////////////////////////////////////////////////////////////////////////
// Forwards
////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* Item Selected
* Forward use when players select their items
*
* @param iPlayer ID of Player
* @param iItemIndex ItemID
* @param iPluginON Plugin ON?
*
*/
forward svm_item_selected( iPlayer, iItemIndex , bool:iPluginON);
And here is the full sub-plugin file: (note: the plugin is just a test)
PHP Code:
#include < amxmodx >
#include < fun >
#include < svminc >
// save item index
new g_iItemIndex;
new bool:PluginON
public plugin_init( ) {
// register item with main plugin and store item index
g_iItemIndex = svm_addmenuitem( "Low Gravity", "ShopLowGravity");
}
// player bought low gravity
public ShopLowGravity( iPlayer )
{
if(PluginON) {
PluginON = false
set_user_gravity( iPlayer, 1.0);
client_print(0, print_chat, "PLUGIN OFF")
}
else {
PluginON = true
set_user_gravity( iPlayer, 0.25);
client_print(0, print_chat, "PLUGIN ON")
}
}
// catch when items are bought
public shop_item_selected( iPlayer, iItemIndex, bool:iPluginON) {
if( g_iItemIndex == iItemIndex ) {
if(iPluginON) {
PluginON = true
set_user_gravity( iPlayer, 0.25 );
}
else {
PluginON = false
set_user_gravity( iPlayer, 1.0);
}
}
}
So, what is the problem? I just can't understand it...