PHP- Kodu:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <hamsandwich>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
new bool:Open;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd( "say /silahm", "Menu_Cmd", ADMIN_KICK );
RegisterHam( Ham_Touch, "weaponbox", "Ham_Touched" );
}
public Ham_Touched( weapon, id )
{
if( Open )
return HAM_SUPERCEDE;
return HAM_IGNORED;
}
public Menu_Cmd( id )
{
new menu = menu_create( "\wSilah Menu", "menu_go" );
menu_additem( menu, "\wYerden Silah Almayi Ac", "1" );
menu_additem( menu, "\wYerden Silah almayi Kapat", "2" );
menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
menu_display( id, menu, 0 );
return PLUGIN_CONTINUE;
}
public menu_go( id, menu, item )
{
if( item == MENU_EXIT )
{
menu_destroy( menu );
return PLUGIN_HANDLED;
}
new data[ 6 ], name[ 64 ];
new access, callback;
menu_item_getinfo( menu, item, access, data, charsmax( data ), name, charsmax( name ), callback );
new key = str_to_num( data );
switch(key)
{
case 1:
{
Open = false;
client_print( 0, print_chat, "Yerden silah alma acildi." );
}
case 2:
{
Open = true;
client_print( 0, print_chat, "Yerden silah alma kapatildi." );
}
}
return PLUGIN_HANDLED;
}