Code:
public TeamSelect2(player) {
new menu[1000]
new line[100]
new class[PLAYERCLASS]
new keys
client_cmd(player, "play sound/predatormod/menuloop.wav")
// Anzahl aller Spieler zählen und entsprechend verhindern
new players[32], count
get_players(players, count, "h")
for(new i = 0; i < count; i++) class[PLAYERCLASS:newclass[players[i]]]++;
// die Headline einfügen
//get_pcvar_string(pcv_headline, line, 99)
format(menu, 999, "Predator-Mod (Version %s)^n%s", VERSION, line)
format(menu, 999, "%s^n^n^n\rchoose your class\w^n", menu)
AddMenuPoint(menu, 999, 1, "scout", class[PC_AUFKLAERUNG], get_pcvar_num(pcv_max_scout), keys, MENU_KEY_1, " - \ycan see the predator on his radar")
AddMenuPoint(menu, 999, 2, "dogfight", class[PC_NAHKAMPF], get_pcvar_num(pcv_max_dogfight), keys, MENU_KEY_2, " - \yhas a flash")
AddMenuPoint(menu, 999, 3, "infantry", class[PC_INFANTERIE], get_pcvar_num(pcv_max_infantry), keys, MENU_KEY_3, " - \yuse a parachute")
AddMenuPoint(menu, 999, 4, "sniper", class[PC_SNIPER], get_pcvar_num(pcv_max_sniper), keys, MENU_KEY_4, " - \yless visible")
AddMenuPoint(menu, 999, 5, "rear cover", class[PC_RUECKENDECKUNG], get_pcvar_num(pcv_max_rearcover), keys, MENU_KEY_5, " - \yhas a smoke")
// Leerzeile
format(menu, 999, "%s^n^n", menu)
// Admins das Spect-Menü ermöglichen
if (get_user_flags(player) & ADMIN_BAN) AddMenuPoint(menu, 999, 7, "spectator", 0, 0, keys, MENU_KEY_7, "")
// Leerzeile
format(menu, 999, "%s^n^n", menu)
// und immer beenden
AddMenuPoint(menu, 999, 0, "exit", 0, 0, keys, MENU_KEY_0, "")
show_menu(player, keys, menu, -1, "TeamMenu")
return PLUGIN_HANDLED
}
public AddMenuPoint(menu[], length, point, text[], count, max, &keys, key, info[]) {
if (!max)
{
format(menu, length, "%s^n%i - %s%s", menu, point, text, info)
} else
{
format(menu, length, "%s^n%c%i - %s (%i/%i)\w%s", menu, (count < max ? "\w" : "\d"), point, text, count, max, info)
}
if ((count < max) || !max) keys |= key
}