Added alive checks before adding certain player lists to the admin menu

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401632
This commit is contained in:
Matt Woodrow 2007-10-22 02:05:51 +00:00
parent ef6da943d6
commit f3e7bf4a16
13 changed files with 20 additions and 14 deletions

View File

@ -171,7 +171,7 @@ public __GetAdminTopMenu(Handle:plugin, numParams)
public __AddTargetsToMenu(Handle:plugin, numParams)
{
return UTIL_AddTargetsToMenu(GetNativeCell(1), GetNativeCell(2), GetNativeCell(3));
return UTIL_AddTargetsToMenu(GetNativeCell(1), GetNativeCell(2), GetNativeCell(3), GetNativeCell(4));
}
public Action:Command_DisplayMenu(client, args)
@ -187,7 +187,7 @@ public Action:Command_DisplayMenu(client, args)
return Plugin_Handled;
}
stock UTIL_AddTargetsToMenu(Handle:menu, source_client, bool:in_game_only)
stock UTIL_AddTargetsToMenu(Handle:menu, source_client, bool:in_game_only, bool:alive_only)
{
new max_clients = GetMaxClients();
decl String:user_id[12];
@ -208,6 +208,11 @@ stock UTIL_AddTargetsToMenu(Handle:menu, source_client, bool:in_game_only)
continue;
}
if (alive_only && !IsPlayerAlive(i))
{
continue;
}
if (source_client && !CanUserTarget(source_client, i))
{
continue;

View File

@ -40,7 +40,7 @@ DisplayBanTargetMenu(client)
SetMenuTitle(menu, title);
SetMenuExitBackButton(menu, true);
AddTargetsToMenu(menu, client, false);
AddTargetsToMenu(menu, client, false, false);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}

View File

@ -59,7 +59,7 @@ DisplayGagPlayerMenu(client)
SetMenuTitle(menu, title);
SetMenuExitBackButton(menu, true);
AddTargetsToMenu(menu, client, false);
AddTargetsToMenu(menu, client, false, false);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}

View File

@ -22,7 +22,7 @@ DisplayKickMenu(client)
SetMenuTitle(menu, title);
SetMenuExitBackButton(menu, true);
AddTargetsToMenu(menu, client, false);
AddTargetsToMenu(menu, client, false, false);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}

View File

@ -57,7 +57,7 @@ DisplayWhoMenu(client)
SetMenuTitle(menu, title);
SetMenuExitBackButton(menu, true);
AddTargetsToMenu(menu, client, false);
AddTargetsToMenu(menu, client, false, false);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}

View File

@ -13,7 +13,7 @@ DisplayBurnMenu(client)
SetMenuTitle(menu, title);
SetMenuExitBackButton(menu, true);
AddTargetsToMenu(menu, client, false);
AddTargetsToMenu(menu, client, false, true);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}

View File

@ -33,7 +33,7 @@ DisplaySlapTargetMenu(client)
SetMenuTitle(menu, title);
SetMenuExitBackButton(menu, true);
AddTargetsToMenu(menu, client, false);
AddTargetsToMenu(menu, client, false, true);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}

View File

@ -14,7 +14,7 @@ DisplaySlayMenu(client)
SetMenuTitle(menu, title);
SetMenuExitBackButton(menu, true);
AddTargetsToMenu(menu, client, false);
AddTargetsToMenu(menu, client, false, true);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}

View File

@ -31,7 +31,7 @@ DisplayBurnTargetMenu(client)
SetMenuTitle(menu, title);
SetMenuExitBackButton(menu, true);
AddTargetsToMenu(menu, client, false);
AddTargetsToMenu(menu, client, false, true);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}

View File

@ -32,7 +32,7 @@ DisplaySlayTargetMenu(client)
SetMenuTitle(menu, title);
SetMenuExitBackButton(menu, true);
AddTargetsToMenu(menu, client, false);
AddTargetsToMenu(menu, client, false, true);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}

View File

@ -30,7 +30,7 @@ DisplayBanTargetMenu(client)
SetMenuTitle(menu, title);
SetMenuExitBackButton(menu, true);
AddTargetsToMenu(menu, client, false);
AddTargetsToMenu(menu, client, false, false);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}

View File

@ -29,7 +29,7 @@ DisplayKickTargetMenu(client)
SetMenuTitle(menu, title);
SetMenuExitBackButton(menu, true);
AddTargetsToMenu(menu, client, false);
AddTargetsToMenu(menu, client, false, false);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}

View File

@ -91,9 +91,10 @@ native Handle:GetAdminTopMenu();
* @param menu Menu Handle.
* @param source_client Source client, or 0 to ignore immunity.
* @param in_game_only True to only select in-game players.
* @param alive_only True to only select alive players.
* @return Number of clients added.
*/
native AddTargetsToMenu(Handle:menu, source_client, bool:in_game_only=true);
native AddTargetsToMenu(Handle:menu, source_client, bool:in_game_only=true, bool:alive_only=false);
/**
* Re-displays the admin menu to a client after selecting an item.