
Tak więc potrzebuję podpiąć ten plugin:
/* Human Classes for zombie plague, menu for classes automatically invoked 8 seconds after player spawn This plug is far from complete, please help with further development of it since it may have some undesired results on gameplay. You can edit this plug however it fit your needs. Here is TO DO list: 1. Make B key invoke human class menu 2. Make user choose class only once per round (could be limited with round timer or some other method) - done 3. Make user choice remember thru whole map time, just like it was done for zombies 4. Changing of models is not implemented yet due to numerous bugs and uncertain effects 5. For now, there are 7 classes only. If you have idea for more classes, make a request 6. Make classes buyable for ammo packs 7. Bots support */ #include <amxmodx> #include <cstrike> #include <fun> #include <fakemeta> #include <hamsandwich> #include <zombieplague> new ma_klase[33] public plugin_init() { register_plugin("Klasy Ludzi", "1.2", "[AvP] ELOS & TheRock") RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1) register_clcmd("say /klasa", "WybierzLudzi"); } public fwHamPlayerSpawnPost(id) { set_task(get_cvar_float("zp_delay")+0.2, "sprawdz",id) } public WybierzLudzi(id) { new menu = menu_create("\rWybierz Klase Ludzi.", "WybierzLudziSelect"); menu_additem(menu, "\wUzbrojony Cywil", "1", 0) menu_additem(menu, "\wSportowiec", "2", 0) menu_additem(menu, "\wGrubas", "3", 0) menu_additem(menu, "X-Men (Premium)", "4", ADMIN_LEVEL_H) menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_display(id, menu, 0); } public WybierzLudziSelect(id, menu, item) { if (item == MENU_EXIT) { menu_destroy(menu); return PLUGIN_HANDLED; } new data[6], iName[64]; new zaccess, callback; menu_item_getinfo(menu, item, zaccess, data,5, iName, 64, callback); new key = str_to_num(data) switch(key) { case 1: { if(ma_klase[id] == 1) { client_print(id, print_chat, "To jest twoja aktualna klasa") } else { client_print(id, print_chat, "Klasa Uzbrojony Cywil wybrana poprawnie") ma_klase[id] = 1 } } case 2: { if(ma_klase[id] == 2) { client_print(id, print_chat, "To jest twoja aktualna klasa") } else { client_print(id, print_chat, "Klasa Sportowiec wybrana poprawnie") ma_klase[id] = 2 } } case 3: { if(ma_klase[id] == 3) { client_print(id, print_chat, "To jest twoja aktualna klasa") } else { client_print(id, print_chat, "Klasa Grubas wybrana poprawnie") ma_klase[id] = 3 } } case 4: { if(ma_klase[id] == 4) { client_print(id, print_chat, "To jest twoja aktualna klasa") } else { client_print(id, print_chat, "Klasa X-Men wybrana poprawnie") ma_klase[id] = 4 } } } menu_destroy(menu); return PLUGIN_HANDLED; } public DajMoce(id) { if(zp_get_user_zombie(id) || zp_get_user_nemesis(id) || zp_get_user_survivor(id)) { return PLUGIN_HANDLED; } else if(ma_klase[id] == 1) { set_user_armor(id, 40) } else if(ma_klase[id] == 2) { set_user_gravity(id, 0.50) set_user_maxspeed(id, 1.20) } else if(ma_klase[id] == 3) { set_user_health(id, 300) } else if(ma_klase[id] == 4) { set_user_armor(id, 200) set_user_health(id, 250) set_user_gravity(id, 0.50) set_user_rendering(id,kRenderFxNone,0,0,0,kRenderTransAlpha,70) } return PLUGIN_HANDLED; } public sprawdz(id) { DajMoce(id) if(zp_get_user_zombie(id) || zp_get_user_nemesis(id) || zp_get_user_survivor(id)) { return PLUGIN_HANDLED; } else if(ma_klase[id] == 0) { WybierzLudzi(id) } return PLUGIN_HANDLED; } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset0 Tahoma;}}\n{\\ colortbl ;\\ red0\\ green0\\ blue0;}\n\\ viewkind4\\ uc1\\ pard\\ cf1\\ lang1045\\ f0\\ fs16 \n\\ par } */
Do tego menu w ZP 4.0.6 żeby zaraz po Zombie Klasy była pozycja Klasy Ludzi która odnosi się do komendy /klasa (wiem że przestarzałe ZP ale nie opłacało mi się zmieniać - dość rozwinięte jest)
/*================================================================================ [Menus] =================================================================================*/ // Game Menu show_menu_game(id) { static menu[200], len len = 0 // Title len += formatex(menu[len], sizeof menu - 1 - len, "\y%s^n^n", g_modname) // 1. Buy weapons if (get_pcvar_num(cvar_buycustom)) len += formatex(menu[len], sizeof menu - 1 - len, "\r1.\w %L^n", id, "MENU_BUY") else len += formatex(menu[len], sizeof menu - 1 - len, "\d1. %L^n", id, "MENU_BUY") // 2. Extra items if (get_pcvar_num(cvar_extraitems) && is_user_alive(id) && !g_survivor[id] && !g_nemesis[id]) len += formatex(menu[len], sizeof menu - 1 - len, "\r2.\w %L^n", id, "MENU_EXTRABUY") else len += formatex(menu[len], sizeof menu - 1 - len, "\d2. %L^n", id, "MENU_EXTRABUY") // 3. Zombie class if (get_pcvar_num(cvar_zclasses)) len += formatex(menu[len], sizeof menu - 1 - len, "\r3.\w %L^n", id,"MENU_ZCLASS") else len += formatex(menu[len], sizeof menu - 1 - len, "\d3. %L^n", id,"MENU_ZCLASS") // 4. Unstuck if (is_user_alive(id) && is_player_stuck(id)) len += formatex(menu[len], sizeof menu - 1 - len, "\r4.\w %L^n", id, "MENU_UNSTUCK") else len += formatex(menu[len], sizeof menu - 1 - len, "\d4. %L^n", id, "MENU_UNSTUCK") // 5-6. Help and join spec len += formatex(menu[len], sizeof menu - 1 - len, "\r5.\w %L^n^n\r6.\w %L^n^n", id, "MENU_INFO", id, "MENU_SPECTATOR") // 9. Admin menu if (get_user_flags(id) & ACCESS_FLAG) len += formatex(menu[len], sizeof menu - 1 - len, "\r9.\w %L", id, "MENU_ADMIN") else len += formatex(menu[len], sizeof menu - 1 - len, "\d9. %L", id, "MENU_ADMIN") // 0. Exit len += formatex(menu[len], sizeof menu - 1 - len, "^n^n\r0.\w %L", id, "MENU_EXIT") show_menu(id, KEYSMENU, menu, -1, "Game Menu") }
Nie mam pojęcia jak to zrobić (pawn i ogólnie programowanie ogarniczające się do podstawowych spraw w pluginach) Czy wystarczyła by pozycja w menu z odniesieniem do "say /klasa"
? Tylko jeszcze jak to zrobić, no nie wiem, proszę o pomoc.
Jeszcze jakby ktoś mi wytłumaczył dlaczego te klasy tak długo reagują? Dopiero po 6 sekundach się włączają? Da się to zmienić?
Użytkownik BlackMatt edytował ten post 31.10.2012 02:13