stock UTIL_AddTargetsToMenu2(Handle:menu, source_client, flags)
{
decl String:user_id[12];
decl String:name[MAX_NAME_LENGTH];
decl String:display[MAX_NAME_LENGTH+12];
new num_clients;
for (new i = 1; i <= MaxClients; i++)
{
if (!IsClientConnected(i) || IsClientInKickQueue(i))
{
continue;
}
if (((flags & COMMAND_FILTER_NO_BOTS) == COMMAND_FILTER_NO_BOTS)
&& IsFakeClient(i))
{
continue;
}
if (((flags & COMMAND_FILTER_CONNECTED) != COMMAND_FILTER_CONNECTED)
&& !IsClientInGame(i))
{
continue;
}
if (((flags & COMMAND_FILTER_ALIVE) == COMMAND_FILTER_ALIVE)
&& !IsPlayerAlive(i))
{
continue;
}
if (((flags & COMMAND_FILTER_DEAD) == COMMAND_FILTER_DEAD)
&& IsPlayerAlive(i))
{
continue;
}
if ((source_client && ((flags & COMMAND_FILTER_NO_IMMUNITY) != COMMAND_FILTER_NO_IMMUNITY))
&& !CanUserTarget(source_client, i))
{
continue;
}
IntToString(GetClientUserId(i), user_id, sizeof(user_id));
GetClientName(i, name, sizeof(name));
Format(display, sizeof(display), "%s (%s)", name, user_id);
AddMenuItem(menu, user_id, display);
num_clients++;
}
return num_clients;
}
是增加管理员菜单的代码。解释下,我想了解下。谢谢