PHP Code:
#include < amxmodx >
#include < airaccelerate >
new g_hMenu;
public plugin_init( )
{
register_plugin( "AirAccelerate Menu", "0.0.1", "Exolent" );
register_clcmd( "say /aa", "CmdMenu" );
g_hMenu = menu_create( "Choose your air accelerate:", "MenuHandler" );
menu_additem( g_hMenu, "10aa", "10" );
menu_additem( g_hMenu, "100aa", "100" );
}
public client_disconnect( iPlayer )
{
reset_user_airaccelerate( iPlayer );
}
public CmdMenu( iPlayer )
{
menu_display( iPlayer, g_hMenu );
}
public MenuHandler( iPlayer, hMenu, iItem )
{
if( iItem == MENU_EXIT )
{
return;
}
new iAccess, szInfo[ 11 ], hCallback;
menu_item_getinfo( hMenu, iItem, iAccess, szInfo, charsmax( szInfo ), _, _, hCallback );
new iValue = str_to_num( szInfo );
set_user_airaccelerate( iPlayer, iValue );
client_print( iPlayer, print_chat, "You will now have %d air accelerate!", iValue );
}
Requires include file from
here to compile locally and also requires that plugin to be installed.
__________________