Вот исходник:
- Код: Выделить всё
// Includes
#include <amxmodx>
// If you want to Enable Colour Remove // on the colorchat
// #include <colorchat>
#include <fun>
#include <hamsandwich>
// Defines
#define VERSION "2.0"
// Plugins Stuff
public plugin_init() {
register_plugin("Grenade Request", VERSION, "Shuttle_Wave")
RegisterHam(Ham_Spawn, "player", "Player_Spawn_Post", 1)
register_clcmd( "say /gr","NadeMenu");
register_clcmd( "say_team /gr","NadeMenu");
}
public NadeMenu(id)
{
new menu = menu_create("\rMenu grenade!", "menu_handler");
menu_additem(menu, "\wFIRE", "1", 0);
menu_additem(menu, "\wFROST", "2", 0);
menu_additem(menu, "\wFLARE", "3", 0);
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
}
public menu_handler(id, menu, item)
{
if( item == MENU_EXIT )
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
new key = str_to_num(data);
switch(key)
{
case 1:
{
// ColorChat(0,NORMAL,"[ ^x04Grenade Request^x01 ] You have ^x04fire grenade^x01");
client_print(id, print_chat, "You have fire grenade");
give_item( id, "weapon_hegrenade" );
menu_destroy(menu);
return PLUGIN_HANDLED
}
case 2:
{
// ColorChat(0,NORMAL,"[ ^x04Grenade Request^x01 ] You have ^x04frost grenade^x01");
client_print(id, print_chat, "You have frost grenade");
give_item( id, "weapon_flashbang" );
give_item( id, "weapon_flashbang" );
menu_destroy(menu);
return PLUGIN_HANDLED
}
case 3:
{
// ColorChat(0,NORMAL,"[ ^x04Grenade Request^x01 ] You have ^x04flare grenade^x01");
client_print(id, print_chat, "You have flare grenade");
give_item( id, "weapon_smokegrenade" );
menu_destroy(menu);
return PLUGIN_HANDLED
}
}
menu_destroy(menu);
return PLUGIN_HANDLED
}
public Player_Spawn_Post(id)
{
// ColorChat(0,NORMAL,"[ ^x04Grenade Request^x01 ] For a choice grenade write ^x04/gr^x01");
client_print(id, print_chat, "For a choice grenade write /gr");
return PLUGIN_HANDLED
}
/* Shuttle_Waves-Nots - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/