The code below here is I copy form this:
https://forums.alliedmods.net/showth...6364#BasicMenu
But I want to know what else should add in the code then will disable to choose the player who have ADMIN_IMMUNITY frags.
I know my english is really bad, if you don't know what I'm say please look below.
1.Player1 < Normal player
2.Player2
3.Player3
4.Player4 < This player have ADMIN_IMMUNITY frag
5.Player5
Code:
#include <amxmodx>
#include <fun>
public plugin_init()
{
//Register a way to get to your menu...
register_clcmd( "my_player_menu","AwesomeMenu");
}
public AwesomeMenu(id)
{
//Create a variable to hold the menu
new menu = menu_create("\rLook at this Player Menu!:", "menu_handler");
//We will need to create some variables so we can loop through all the players
new players[32], pnum, tempid;
//Some variables to hold information about the players
new szName[32], szTempid[10];
//Fill players with available players
get_players(players, pnum);
//Start looping through all players
for( new i; i<pnum; i++ )
{
//Save a tempid so we do not re-index
tempid = players[i];
//Get the players name and id as strings
get_user_name(tempid, szName, 31);
num_to_str(tempid, szTempid, 9);
//Add the item for this player
menu_additem(menu, szName, szTempid, 0);
}
//We now have all players in the menu, lets display the menu
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);
//Get the id of the player that was selected
new tempid = str_to_num(data);
//If the player is alive
if( is_user_alive(tempid) )
//Set their health to 100
set_user_health(tempid, 100);
menu_destroy(menu);
return PLUGIN_HANDLED;
}
__________________
You can be a SUPER coder but you Haven't to say such as "stupid, etc." words to the others