Witam, mam problem z kompilacją pluginu na /menu. Moglby ktos pomoc rozwiazac te bledy?
Oto bledy pojawiajace sie w kompilatorze:
//// JailMenu_noFear.sma // C:\Users\User\Desktop\compiler\JailMenu.sma(148) : warning 217: loose indentation // C:\Users\User\Desktop\compiler\JailMenu.sma(198) : warning 209: function "Handel_Menu" should return a value // C:\Users\User\Desktop\compiler\JailMenu.sma(212) : warning 209: function "Handel_Menu" should return a value // C:\Users\User\Desktop\compiler\JailMenu.sma(220) : warning 209: function "Handel_Menu" should return a value // C:\Users\User\Desktop\compiler\JailMenu.sma(223) : warning 209: function "Handel_Menu" should return a value // C:\Users\User\Desktop\compiler\JailMenu.sma(229) : warning 209: function "Handel_Menu" should return a value // C:\Users\User\Desktop\compiler\JailMenu.sma(277) : warning 217: loose indentation // C:\Users\User\Desktop\compiler\JailMenu.sma(277) : error 078: function uses both "return" and "return <value>" // C:\Users\User\Desktop\compiler\JailMenu.sma(281) : warning 209: function "Handel_Menu" should return a value
A oto sma:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #include <hamsandwich> #include <fakemeta> #include <colorchat> #include <jailbreak> #include <engine> #define PLUGIN "Jail Menu" #define VERSION "1" #define AUTHOR "AUTHOR" #define TAG "JailBreak" new bool:menu_mikro, bool:menu_walka; new w_trakcie[33]; new gracz_id[33],wybrany; new autobh = 0; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_event("Damage", "Damage", "b", "2!=0"); register_event("ResetHUD", "SpawnPlayer", "be") register_clcmd("+revision", "wlacz_rewizje"); register_clcmd("-revision", "wylacz_rewizje"); register_clcmd("say /menu", "MenuGraczy"); register_clcmd("jail_amenu", "MenuAdmina", ADMIN_BAN); register_clcmd("say /a", "MenuAdmina", ADMIN_BAN); register_clcmd("say /dajdeagla", "menu") } public plugin_precache() { precache_sound("weapons/c4_disarm.wav"); precache_sound("weapons/c4_disarmed.wav"); precache_sound("JailBreak_noFear/dzwonek.wav"); } public SpawnPlayer(id) { w_trakcie[id] = 0; remove_task(5000+id); } public MenuGraczy(id) { if(!is_user_alive(id)) { MenuGraczaNieZywego(id); return PLUGIN_HANDLED; } switch(get_user_team(id)) { case 1: MenuGraczaTT(id); case 2: MenuGraczaCT(id); } return PLUGIN_CONTINUE; } public MenuGraczaTT(id) { new menu = menu_create("\w[\rJailbreak\w] Menu \rWieznia", "Handel_Menu"); new cb = menu_makecallback("Menu_Callback"); menu_additem(menu, "\w[\r~\w] Czapki \y- Wybierz czapke", "3"); menu_additem(menu, "\w[\r~\w] Sklep \y- Sklep za szlugi", "19"); menu_additem(menu, "\w[\r~\w] Ukradnij bron \y- Kradziez broni CT", "4"); menu_additem(menu, "\w[\r~\w] Ruletka \y- Wylosuj bonus", "20"); menu_additem(menu, "\w[\r~\w] \rZyczenie \y- Dla ostatniego wieznia", "18", 4, cb); menu_additem(menu, "\w[\r~\w] Info \rVIP", "0"); menu_additem(menu, "\w[\r~\w] Info \rSUPER VIP", "1"); menu_additem(menu, "\w[\r~\w] Serwerowy \rRegulamin", "2"); menu_setprop(menu, MPROP_EXITNAME, "Wyjdz"); menu_setprop(menu, MPROP_BACKNAME, "Poprzednia"); menu_setprop(menu, MPROP_NEXTNAME, "Nastepna"); menu_setprop(menu, MPROP_PERPAGE, 7); menu_display(id, menu); return PLUGIN_HANDLED; } public MenuAdmina(id) { if(!(get_user_flags(id) & ADMIN_BAN)) { client_print(id, print_center, "Menu jest tylko dla Admina!") return PLUGIN_HANDLED; } new menu = menu_create("\w[\rJailbreak\w] Menu \rAdmina", "Handel_Menu"); menu_additem(menu, "\w[\r~\w] Przenies \rGracza", "13"); menu_additem(menu, "\w[\r~\w] Ozyw \rGracza", "15"); menu_additem(menu, "\w[\r~\w] Mikro dla \rTT", "9"); menu_additem(menu, "\w[\r~\w] Otworz \rCele", "7"); menu_additem(menu, "\w[\r~\w] Tryb \rWalki", "8"); menu_additem(menu, "\w[\r~\w] Ban na gre jako \rKlawisz", "12"); menu_additem(menu, "\w[\r~\w] Zmutuj /rGracza", "321"); menu_setprop(menu, MPROP_EXITNAME, "Wyjdz"); menu_setprop(menu, MPROP_BACKNAME, "<<<"); menu_setprop(menu, MPROP_NEXTNAME, ">>>"); menu_display(id, menu); return PLUGIN_HANDLED; } public MenuGraczaCT(id) { new menu = menu_create("\w[\rJailbreak\w] Menu \rStraznika:", "Handel_Menu"); new cb = menu_makecallback("Menu_Callback"); menu_additem(menu, "\w[\r~\w] Wez \rProwadzenie", "6", 1, cb); menu_additem(menu, "\w[\r~\w] Przeszukaj \rWieznia","5"); menu_additem(menu, "\w[\r~\w] Otworz \rCele", "7"); menu_additem(menu, "\w[\r~\w] Walka \rwiezniow\w: \rON/OFF", "8", 3, cb); menu_additem(menu, "\w[\r~\w] Mikrofon dla \rWiezniow\w: \rON/OFF", "9"); menu_additem(menu, "\w[\r~\w] Wbierz \rZabawy \y- Wlacz zabawe", "10", 3, cb); menu_additem(menu, "\w[\r~\w] Wlacz \rGong \y- Sygnal gongu","17", 3, cb); menu_additem(menu, "\w[\r~\w] Oznacz wieznia \rkolorem", "43"); menu_additem(menu, "\w[\r~\w] Wylosuj \rWieznia", "44"); menu_additem(menu, "\w[\r~\w] Daj: \yFreeDay'a lub Duszka","11"); menu_additem(menu, "\w[\r~\w] Daj \rDeagle'a\w Wiezniowi","21", 3, cb); menu_additem(menu, "\w[\r~\w] Podziel \rWiezniow","22", 3, cb); menu_additem(menu, "\w[\r~\w] Info \rVIP", "0"); menu_additem(menu, "\w[\r~\w] Info \rSUPER VIP", "1"); menu_additem(menu, "\w[\r~\w] Serwerowy \rRegulamin", "2"); menu_setprop(menu, MPROP_EXITNAME, "Wyjdz"); menu_setprop(menu, MPROP_BACKNAME, "Poprzednia"); menu_setprop(menu, MPROP_NEXTNAME, "Nastepna"); menu_display(id, menu); return PLUGIN_HANDLED; } public MenuGraczaNieZywego(id) { new menu = menu_create("\w[\rJailbreak\w] Menu \rWidza", "Handel_Menu"); menu_additem(menu, "\w[\r~\w] Info \rVIP", "0"); menu_additem(menu, "\w[\r~\w] Info \rSUPER VIP", "1"); menu_setprop(menu, MPROP_EXITNAME, "Wyjdz"); menu_setprop(menu, MPROP_BACKNAME, "Poprzednia"); menu_setprop(menu, MPROP_NEXTNAME, "Nastepna"); menu_display(id, menu); return PLUGIN_HANDLED; } public Menu_Callback(id, menu, item) { static num[10], acces, callback; menu_item_getinfo(menu, item, acces, num, 9, _, _, callback); switch(acces) { case 1:{ if(jail_get_prowadzacy() || !jail_get_days()) { return ITEM_DISABLED; } } case 2:{ if(id != jail_get_prowadzacy() && jail_get_days()) { return ITEM_DISABLED; } } case 3:{ if(id != jail_get_prowadzacy()) { return ITEM_DISABLED; } } case 4:{ if(id != jail_get_prisoner_last()) { return ITEM_DISABLED; } } case 5:{ if(!is_user_admin(id)) { return ITEM_DISABLED; } } } return ITEM_ENABLED; } public Handel_Menu(id, menu, item) { if(item == MENU_EXIT) return; new num[10], acces, callback; menu_item_getinfo(menu, item, acces, num, 9, _, _, callback); switch(str_to_num(num)) { case 0: client_cmd(id, "say /vip"); case 1: client_cmd(id, "say /svip"); case 2: client_cmd(id, "say /regulamin"); case 3: client_cmd(id, "say /czapki"); case 4: { if(jail_get_prisoner_free(id) || jail_get_user_block(id)) return; new body, target; get_user_aiming(id, target, body, 50); if(target && get_user_team(target) == 1) { ColorChat(id, TEAM_COLOR, "^x01[^x04JailBreak^x01] Aby zabrac bron musisz byc blisko straznika!"); return; } if(!is_user_alive(target)) return; new weapons = Jaki_Pistolet(target); if(!weapons) { ColorChat(id, TEAM_COLOR, "^x01[^x04JailBreak^x01] Straznik nie ma pistoletu!"); return; } new weaponname[24]; get_weaponname(weapons, weaponname, 23); ham_strip_weapon(target, weapons, weaponname); give_item(id, weaponname); ColorChat(id, TEAM_COLOR, "^x01[^x04JailBreak^x01] Gratulacje - Ukradles pistolet"); } case 5: w_trakcie[id]? wylacz_rewizje(id): wlacz_rewizje(id); case 6:{ if(!jail_get_prowadzacy()) jail_set_prowadzacy(id); } case 7: jail_open_cele(); case 8: jail_set_prisoners_fight((menu_walka = !menu_walka), !menu_walka); case 9: jail_set_prisoners_micro((menu_mikro = !menu_mikro)); case 10: client_cmd(id, "say /zabawy"); case 11: MenuFreeday(id); case 12: client_cmd(id, "jail_menuban", "Ban na CT"); case 13: client_cmd(id, "amx_teammenu", "Przenies TT/CT/SPEC"); case 14: client_cmd(id, "jail_amenu"); case 15: client_cmd(id, "say /ozyw"); case 16: client_cmd(id, "jail_mute"); case 17: client_cmd(0, "spk sound/JailBreak[k]/dzwonek.wav"); case 18: client_cmd(id, "say /lr"); case 19: client_cmd(id, "say /sklep"); case 20: client_cmd(id, "say /ruletka"); case 21: client_cmd(id, "say /dajdeagla"); case 22: client_cmd(id, "say /podziel"); case 111: client_cmd(id, "say /top15"); case 43: client_cmd(id, "say /oznacz"); case 44: client_cmd(id, "say /losuj"); case 112: client_cmd(id, "say /rankg"); case 321: client_cmd(id, "amx_gagmenu"); case 23: { ColorChat(id, TEAM_COLOR, "^x04[%s]^x03 AutoBH dla wiezniow - %s", autobh?"Wl":"Wyl"); if(autobh == 0) autobh = 1; else autobh = 0; return PLUGIN_HANDLE; } } } public MenuFreeday(id) { new menu2 = menu_create("\w[\rJailbreak\w] Manager \rFD \wi \rDuszek", "Handel_ManagerFreeday"); menu_additem(menu2, "\w[\r~\w] Daj \rFreeday"); menu_additem(menu2, "\w[\r~\w] Daj \rDuszka^n"); menu_additem(menu2, "\w[\r~\w] Zabierz \rFreeday"); menu_additem(menu2, "\w[\r~\w] Zabierz \rDuszka"); menu_setprop(menu2, MPROP_EXITNAME, "Wyjdz"); menu_display(id, menu2); } public Handel_ManagerFreeday(id, menu, item) { if(item == MENU_EXIT) return; new acces, callback, data[3], iname[32]; menu_item_getinfo(menu, item, acces, data, 2, iname, 31, callback); replace(iname, 31, "^n", ""); new menu2 = menu_create(iname, (!item || item == 2)? "Handel_Menu_Freeday": "Handel_Menu_Duszek"); for(new i=1; i<=32; i++) { if(!is_user_alive(i) || cs_get_user_team(i) != CS_TEAM_T) continue; switch(item) { case 0,1:{ if(jail_get_prisoner_free(i) || jail_get_prisoner_ghost(i)) continue; } case 2:{ if(!jail_get_prisoner_free(i)) continue; } case 3:{ if(!jail_get_prisoner_ghost(i)) continue; } } new name[32]; get_user_name(i, name, 31); menu_additem(menu2, name, (!item || item == 1)? "1": "0"); } menu_setprop(menu2, MPROP_EXITNAME, "Wyjdz"); menu_display(id, menu2); } public Handel_Menu_Freeday(id, menu, item) { if(item == MENU_EXIT) return; new id2, callback, data[3], name[32]; menu_item_getinfo(menu, item, id2, data, 2, name, 31, callback); callback = data[0]-'0'; id2 = get_user_index(name); jail_set_prisoner_free(id2, bool:callback, false); new szName[2][32]; get_user_name(id, szName[0], 31); get_user_name(id2, szName[1], 31); ColorChat(0, TEAM_COLOR,"^x04[%s] ^x03%s ^x01%s freedaya ^x03%s",TAG,szName[0], callback? "dal": "zabral",szName[1]); } public Handel_Menu_Duszek(id, menu, item) { if(item == MENU_EXIT) return; new id2, callback, data[3], name[32]; menu_item_getinfo(menu, item, id2, data, 2, name, 31, callback); callback = data[0]-'0'; id2 = get_user_index(name); jail_set_prisoner_ghost(id2, bool:callback, false); new szName[2][32]; get_user_name(id, szName[0], 31); get_user_name(id2, szName[1], 31); ColorChat(0, TEAM_COLOR,"^x04[%s] ^x03%s ^x01%s duszka ^x03%s",TAG,szName[0], callback? "dal": "zabral",szName[1]); } public OnRemoveData(day) { menu_mikro = false; menu_walka = false; autobh = 0; } public Handel_Menu_Widza(id, menu, item) { if(item == MENU_EXIT) return; switch(item) { case 0: show_motd(id, "faq.txt", "FAQ Serwera"); case 1: client_cmd(id, "say /zasady"); case 2: show_motd(id, "komendy.txt", "Komendy"); } } public wlacz_rewizje(id) { if(get_user_team(id) != 2 || !is_user_alive(id)) return PLUGIN_HANDLED; new body, target; get_user_aiming(id, target, body, 50); if(target && get_user_team(target) == 2) { ColorChat(id, TEAM_COLOR, "^x04[%s]^x03 Nie nacelowales na wieznia", TAG); return PLUGIN_HANDLED; } if(!is_user_alive(target)) return PLUGIN_HANDLED; if(jail_get_user_block(target)) return PLUGIN_HANDLED; jail_set_user_speed(id, 0.1); set_bartime(id, 5); set_bartime(target, 5); jail_set_user_speed(target, 0.1); w_trakcie[id] = target; w_trakcie[target] = id; set_task(5.0, "wylacz_rewizje", 5000+id); emit_sound(id, CHAN_WEAPON, "weapons/c4_disarm.wav", 1.0, ATTN_NORM, 0, PITCH_NORM); return PLUGIN_HANDLED; } public wylacz_rewizje(taskid) { new id = taskid; if(taskid > 32) id -= 5000; if(get_user_team(id) != 2 || !w_trakcie[id]) return PLUGIN_HANDLED; remove_task(id+5000); jail_set_user_speed(id, 250.0); set_bartime(id, 0); if(is_user_alive(w_trakcie[id])) { jail_set_user_speed(w_trakcie[id], 250.0); set_bartime(w_trakcie[id], 0); } if(taskid > 32) Pokaz_bronie(id); w_trakcie[w_trakcie[id]] = 0; w_trakcie[id] = 0; return PLUGIN_HANDLED; } public Pokaz_bronie(id) { if(!is_user_alive(id) || !is_user_alive(w_trakcie[id])) return; new weapons[32], numweapons, weaponname[32]; get_user_weapons(w_trakcie[id], weapons, numweapons); ColorChat(id, GREEN, "Znalazles:"); for(new i=0; i<numweapons; i++) { get_weaponname(weapons[i], weaponname, 31); replace(weaponname, 32, "weapon_", ""); replace(weaponname, 32, "knife", "piesci"); ColorChat(id, BLUE, weaponname); } emit_sound(id, CHAN_WEAPON, "weapons/c4_disarmed.wav", 1.0, ATTN_NORM, 0, PITCH_NORM); } public Damage(id) { if(is_user_alive(id) && w_trakcie[id]) { wylacz_rewizje(id); } } stock Jaki_Pistolet(id) { if(!is_user_connected(id)) return 0; new weapons[32], numweapons; get_user_weapons(id, weapons, numweapons); for(new i=0; i<numweapons; i++) if((1<<weapons[i]) & 0x4030402) return weapons[i]; return 0; } stock ham_strip_weapon(id, wid, szname[]) { if(!wid) return 0; new ent; while((ent = engfunc(EngFunc_FindEntityByString, ent, "classname", szname)) && pev(ent, pev_owner) != id) {} if(!ent) return 0; if(get_user_weapon(id) == wid) ExecuteHam(Ham_Weapon_RetireWeapon, ent); if(ExecuteHam(Ham_RemovePlayerItem, id, ent)) { ExecuteHam(Ham_Item_Kill, ent); set_pev(id, pev_weapons, pev(id, pev_weapons) & ~(1<<wid)); } return 1; } stock set_bartime(id, czas) { message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("BarTime"), _, id); write_short(czas); message_end(); } public menu(id, level, cid) { new menu = menu_create("\w[\rJailbreak\w] Wybierz \rGracza","menu_broni"); for(new i=0, n=0; i<=32; i++) { if(!is_user_connected(i) || !is_user_alive(i) || cs_get_user_team(i) != CS_TEAM_T) continue; gracz_id[n++] = i; new nazwa_gracza[64]; get_user_name(i, nazwa_gracza, 63) menu_additem(menu, nazwa_gracza, "0", 0); } menu_setprop(menu, MPROP_BACKNAME, "Wroc"); menu_setprop(menu, MPROP_NEXTNAME, "Dalej"); menu_setprop(menu, MPROP_EXITNAME, "Wyjscie"); menu_display(id, menu); return PLUGIN_HANDLED; } public menu_broni(id, menu, item) { if (get_user_team(id) == 2) { wybrany = gracz_id[item]; new menu = menu_create("\w[\rJailbreak\w] Menu \rBroni", "wybieranie") menu_additem(menu, "\w[\r~\w] Deagle bez \rnaboi", "1", 0) menu_additem(menu, "\w[\r~\w] Deagle z \r1 nabojem", "2", 0) menu_additem(menu, "\w[\r~\w] Deagle z \r3 nabojami", "3", 0) menu_additem(menu, "\w[\r~\w] Deagle z \rpelnym magazynkiem", "4", 0) menu_setprop(menu, MPROP_EXIT, MEXIT_ALL) menu_display(id, menu, 0) } else { client_print(id, print_chat, "Nie masz do tego dostepu Ziomus!") return PLUGIN_HANDLED } return PLUGIN_HANDLED; } public wybieranie(id, menu, item) { if (item == MENU_EXIT) { menu_destroy(menu) return PLUGIN_HANDLED } new data[6], iName[64] new acces, callback menu_item_getinfo(menu, item, acces, data,5, iName, 63, callback) new key = str_to_num(data) switch(key) { case 1:{ give_item(wybrany, "weapon_deagle"); new dgl_id = find_ent_by_owner(-1, "weapon_deagle", wybrany) if(dgl_id){ cs_set_weapon_ammo(dgl_id, 0); } client_print(id, print_chat, "%s dostal pustego deagla",wybrany) menu_destroy(menu) return PLUGIN_HANDLED } case 2:{ give_item(wybrany, "weapon_deagle"); new dgl_id = find_ent_by_owner(-1, "weapon_deagle", wybrany) if(dgl_id){ cs_set_weapon_ammo(dgl_id, 1); } client_print(id, print_chat, "%s dostal deagla z 1 nabojem",wybrany) menu_destroy(menu) return PLUGIN_HANDLED } case 3:{ give_item(wybrany, "weapon_deagle"); new dgl_id = find_ent_by_owner(-1, "weapon_deagle", wybrany) if(dgl_id){ cs_set_weapon_ammo(dgl_id, 3); } client_print(id, print_chat, "%s dostal deagla z 3 nabojami",wybrany) menu_destroy(menu) return PLUGIN_HANDLED } case 4:{ give_item(wybrany, "weapon_deagle"); new dgl_id = find_ent_by_owner(-1, "weapon_deagle", wybrany) if(dgl_id){ cs_set_weapon_ammo(dgl_id, 35); } client_print(id, print_chat, "%s dostal deagla z pelnym magazynkiem",wybrany) menu_destroy(menu) return PLUGIN_HANDLED } } menu_destroy(menu) return PLUGIN_HANDLED } //////////////////////////////////////////AUTOBH////////////////////////////////// public client_PreThink(id) { entity_set_float(id, EV_FL_fuser2, 0.0) if(autobh == 0 || get_user_team(id) == 2) return PLUGIN_CONTINUE; if (entity_get_int(id, EV_INT_button) & 2) { new flags = entity_get_int(id, EV_INT_flags) if (flags & FL_WATERJUMP) return PLUGIN_CONTINUE if ( entity_get_int(id, EV_INT_waterlevel) >= 2 ) return PLUGIN_CONTINUE if ( !(flags & FL_ONGROUND) ) return PLUGIN_CONTINUE new Float:velocity[3] entity_get_vector(id, EV_VEC_velocity, velocity) velocity[2] += 250.0 entity_set_vector(id, EV_VEC_velocity, velocity) entity_set_int(id, EV_INT_gaitsequence, 6) // Play the Jump Animation } return PLUGIN_CONTINUE } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1045\\ f0\\ fs16 \n\\ par } */