#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Admini"
#define VERSION "1.0"
#define AUTHOR "Maestro"
public plugin_init(){
register_plugin(PLUGIN, VERSION, AUTHOR);
register_clcmd("say /admins", "xmenu");
register_clcmd("say_team /admins", "xmenu");
register_clcmd("say /admin", "xmenu");
register_clcmd("say_team /admin", "xmenu");
}
public xmenu(id){
new menu = menu_create("\rWybierz admina:", "wybieranie");
menu_additem(menu, "\wAdmin 1", "1", 0);
menu_additem(menu, "\wAdmin 2", "2", 0);
menu_additem(menu, "\wAdmin 3", "3", 0);
menu_setprop(menu, MPROP_BACKNAME, "Poprzednia strona");
menu_setprop(menu, MPROP_NEXTNAME, "Nastepna strona");
menu_setprop(menu, MPROP_EXITNAME, "Wyjdz");
menu_display(id, menu, 0);
return PLUGIN_HANDLED;
}
public wybieranie(id, menu, item){
if (item == MENU_EXIT){
menu_destroy(menu);
return PLUGIN_HANDLED;
}
// dodaje wybor pod klawisze
new data[6], iName[64];
new zaccess, callback;
menu_item_getinfo(menu, item, zaccess, data,5, iName, 63, callback);
new key = str_to_num(data)
switch(key){
case 1:{
console_print(id , "*** KONTAKT DO ADMINA ***");
console_print(id , "[NICK] admin 1");
console_print(id , "[GG] gg admin 1");
console_print(id , "[STEAM] admin nick 1");
console_print(id , "*** KONIEC ***");
menu_destroy(menu);
return PLUGIN_HANDLED;
}
case 2:{
console_print(id , "*** KONTAKT DO ADMINA ***");
console_print(id , "[NICK] admin 2");
console_print(id , "[GG] gg admin 2");
console_print(id , "[STEAM] admin nick 2");
console_print(id , "*** KONIEC ***");
menu_destroy(menu);
return PLUGIN_HANDLED;
}
case 3:{
console_print(id , "*** KONTAKT DO ADMINA ***");
console_print(id , "[NICK] admin 3");
console_print(id , "[GG] gg admin 3");
console_print(id , "[STEAM] admin nick 3");
console_print(id , "*** KONIEC ***");
menu_destroy(menu);
return PLUGIN_HANDLED;
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
Czy pomoglby ktos przerobic ten plugin aby czytal z pliku admini.txt liste adminow i wyswietlal w menu ?
Format w admini.txt
"admin 1" "gg" "nick steam"