hawk... ur code is good and i use...
but... i have 1 problem
1 select the player and the COMMAND(agree for me) is use in me and he no...
i need the command is use in me and he....
need to the menu open for the last terrorist... and in the menu players... show CTS PLAYERS LIVEs..
this is my code...
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
new Plugin[] = "Last Restquest Menu"
new Version[] = "1.0"
new Author[] = "[M]aNuC[s]_"
new gMaxPlayers
public plugin_init()
{
register_clcmd( "say /lr","MenuLR");
register_clcmd( "say !lr","MenuLR");
gMaxPlayers = get_maxplayers()
}
public MenuLR(id)
{
if(is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T)
{
new Menu = menu_create("\w Last Resquest:", "mostrar_menu")
menu_additem(Menu, "\w Khife Duel" , "1", 0)
menu_additem(Menu, "\w Shot For Shot" , "2", 0)
menu_setprop(Menu,MPROP_EXITNAME,"Salir")
menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, Menu, 0)
}
}
public mostrar_menu(id, Menu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(Menu)
return PLUGIN_HANDLED
}
new iData[6];
new iAccess;
new iCallback;
new iName[64];
menu_item_getinfo(Menu, item, iAccess, iData, 5, iName, 63, iCallback)
switch (str_to_num(iData))
{
case 1:
{
if( is_user_alive(id) )
{
Cuchillo( id )
}
}
case 2:
{
if( is_user_alive(id) )
{
Pistola(id)
}
}
}
}
public Cuchillo( id )
{
new menu = menu_create( "Select a Player", "MenuSelectPlayer1" )
for ( new i = 1, name[33], idStr[3]; i <= gMaxPlayers; i++ )
if ( i != id && is_user_connected( i ) )
{
get_user_name( i, name, 32 )
num_to_str( i, idStr, 2 )
menu_additem( menu, name, idStr )
}
menu_display( id, menu )
}
public MenuSelectPlayer1( id, menu, item )
{
if ( item == MENU_EXIT )
goto end
new idStr[3], garbage
menu_item_getinfo( menu, item, garbage, idStr, 2, _, _, garbage )
new player = str_to_num( idStr )
if ( !is_user_connected( player ) )
goto end
strip_user_weapons(id)
give_item(id, "weapon_knife");
set_user_health(id, 100);
client_print(id, print_chat, "Duel Khife Activado...")
end:
menu_destroy( menu )
return PLUGIN_HANDLED
}
public Pistola( id )
{
new menu = menu_create( "Select a Player", "MenuSelectPlayer2" )
for ( new i = 1, name[33], idStr[3]; i <= gMaxPlayers; i++ )
if ( i != id && is_user_connected( i ) )
{
get_user_name( i, name, 32 )
num_to_str( i, idStr, 2 )
menu_additem( menu, name, idStr )
}
menu_display( id, menu )
}
public MenuSelectPlayer2( id, menu, item )
{
if ( item == MENU_EXIT )
goto end
new idStr[3], garbage
menu_item_getinfo( menu, item, garbage, idStr, 2, _, _, garbage )
new player = str_to_num( idStr )
if ( !is_user_connected( player ) )
goto end
strip_user_weapons (id)
set_user_health(id, 100);
give_item(id,"weapon_deagle")
cs_set_user_bpammo(id,CSW_DEAGLE,200)
give_item(id, "weapon_knife")
client_print(id, print_chat, "Shot For Shot Activado...")
end:
menu_destroy( menu )
return PLUGIN_HANDLED
}