Właściciel GET Opublikowano 19 Listopada 2011 Właściciel Opublikowano 19 Listopada 2011 (edytowane) Świąteczny sklepik 3.0 Opis:Świąteczny sklepik wykonany przez Nesty. Wymieniamy prezenty na itemy.Moduły:- colorchat- fun- cstrike- hamsandwichWymagania:Nic. Jedynie moduł colorchat, jeżeli nie posiadamy.Cvary: prezent_he // ile prezentów, aby dostać HE granat. prezent_fb // ile prezentów, aby dostać FB granat. prezent_ak // ile prezentów, aby dostać AK47. prezent_m4 // ile prezentów, aby dostać M4A1. prezent_awp // ile prezentów, aby dostać AWP. prezent_ft // ile prezentów, aby cicho chodzić na okres 1 rundy. prezent_kasy // ile prezentów, aby dostać +5000 kasy. prezent_ileprezentow // ile prezentów dodawać przy zabiciu gracza prezent_ilezawygrana // ile prezentow dodawać za wygraną rundę Dodatkowe informacje: Instalacja standardowa. /* Plugin generated by Nesty */ #include <amxmodx> #include <fun> #include <cstrike> #include <hamsandwich> #include <colorchat.inc> #define MAX 32 // ilosc slotow new const gVERSION[] = "3.0"; new const PREFIX[] = "4FUN:"; new koszt_he, koszt_fb, koszt_sg, koszt_km, koszt_ft, koszt_ks, koszt_ps; new cvar_ileprezentow, cvar_ilepzawygrana; new CsArmorType:armortype; new prezenty[MAX+1], bool:uzyl[MAX+1], bool:render_ma[MAX+1]; public plugin_init() { register_plugin("Sklepik swiateczny", gVERSION, "Nesty") register_clcmd("say /sklep", "swiateczny_sklep") register_event("DeathMsg","DeathMsg","a"); register_event("SendAudio", "TTwin", "a", "2&%!MRAD_terwin"); register_event("SendAudio", "CTwin", "a", "2&%!MRAD_ctwin"); RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1) //cvary koszt_he = register_cvar("prezent_he","20") koszt_fb = register_cvar("prezent_fb","20") koszt_sg = register_cvar("prezent_sg","20") koszt_km = register_cvar("prezent_km","30") koszt_ft = register_cvar("prezent_ft","50") koszt_ks = register_cvar("prezent_kasy","100") koszt_ps = register_cvar("prezent_ps","150") cvar_ileprezentow = register_cvar("prezent_ileprezentow","5") cvar_ilepzawygrana = register_cvar("prezent_ilezawygrana","10") register_menucmd(register_menuid("Sklep"), 1023, "swiateczne_kupno") } public fw_PlayerSpawn_Post(id){ if(uzyl[id]) uzyl[id] = false; if(!is_user_alive(id)) return HAM_IGNORED if(get_user_footsteps(id)) set_user_footsteps(id,0) if(render_ma[id]){ set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 255) render_ma[id] = false; } return HAM_IGNORED } public TTwin() prezenty_give("TERRORIST"); public CTwin() prezenty_give("CT"); public prezenty_give(const Team[]){ new Players[32], playerCount, id; get_players(Players, playerCount, "aeh", Team); if(get_playersnum() < 3) return; for (new i=0; i<playerCount; i++) { id = Players[i]; prezenty[id] += get_pcvar_num(cvar_ilepzawygrana); } } public DeathMsg(){ new kid = read_data(1); new vid = read_data(2); if(!is_user_connected(kid)) return; if(kid != vid) prezenty[kid] += get_pcvar_num(cvar_ileprezentow); } public swiateczny_sklep(id){ if(!is_user_alive(id)){ ColorChat(id, GREEN, "%s^x01 Musisz byc^x03 zywy", PREFIX); return; } static szBuffer[512]; new iLen; iLen = formatex(szBuffer, charsmax(szBuffer), "\rSklepik swiateczny (\dFragujemy.com) [\y%i\w]:^n^n", prezenty[id]); iLen += formatex(szBuffer[iLen], charsmax(szBuffer) - iLen, "\r1. \wGranat HE [\dprezentow:\y 20\w]^n"); iLen += formatex(szBuffer[iLen], charsmax(szBuffer) - iLen, "\r2. \wGranat FB [\dprezentow:\y 20\w]^n"); iLen += formatex(szBuffer[iLen], charsmax(szBuffer) - iLen, "\r3. \wGranat SG [\dprezentow:\y 20\w]^n"); iLen += formatex(szBuffer[iLen], charsmax(szBuffer) - iLen, "\r4. \wKamizelka z helmem [\dprezentow:\y 30\w]^n"); iLen += formatex(szBuffer[iLen], charsmax(szBuffer) - iLen, "\r5. \wNie slychac jak chodzisz [\dprezentow:\y 50\w]^n"); iLen += formatex(szBuffer[iLen], charsmax(szBuffer) - iLen, "\r6. \wDodatkowe + 4000$ [\dprezentow:\y 100\w]^n"); iLen += formatex(szBuffer[iLen], charsmax(szBuffer) - iLen, "\r7. \wPoswiata [\dprezentow:\y 150\w]^n"); iLen += formatex(szBuffer[iLen], charsmax(szBuffer) - iLen, "\r0. \wWyjdz" ); new keys = (1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6 | 1<<9); show_menu(id, keys, szBuffer); } public swiateczne_kupno(id, key){ if(!is_user_alive(id)) return PLUGIN_HANDLED_MAIN; switch(key){ case 0:{ new prezents = get_pcvar_num(koszt_he); if(prezenty[id] < prezents) { not_prezens(id, prezenty[id], prezents); return PLUGIN_CONTINUE; } give_item(id,"weapon_hegrenade") zabierz_prezenty(id, prezents) } case 1:{ new prezents = get_pcvar_num(koszt_fb); if(prezenty[id] < prezents) { not_prezens(id, prezenty[id], prezents); return PLUGIN_CONTINUE; } give_item(id,"weapon_flashbang") zabierz_prezenty(id, prezents) } case 2:{ new prezents = get_pcvar_num(koszt_sg); if(prezenty[id] < prezents) { not_prezens(id, prezenty[id], prezents); return PLUGIN_CONTINUE; } give_item(id,"weapon_smokegrenade") zabierz_prezenty(id, prezents) } case 3:{ new prezents = get_pcvar_num(koszt_km); if(prezenty[id] < prezents) { not_prezens(id, prezenty[id], prezents); return PLUGIN_CONTINUE; } if(armortype != CS_ARMOR_NONE) { ColorChat(id, GREEN, "%s^x01 Masz juz^x01 kamizelke^x01... Zajmij sie lepieniem sniezek..", PREFIX); return PLUGIN_CONTINUE; } if(cs_get_user_armor(id, armortype) == 100) return PLUGIN_CONTINUE; cs_set_user_armor(id, min(cs_get_user_armor(id,armortype)+100, 100), CS_ARMOR_VESTHELM); zabierz_prezenty(id, prezents) } case 4:{ new prezents = get_pcvar_num(koszt_ft); if(prezenty[id] < prezents) { not_prezens(id, prezenty[id], prezents); return PLUGIN_CONTINUE; } if(uzyl[id]){ ColorChat(id, GREEN, "%s^x01 Juz^x04 raz^x01 tego uzyles!", PREFIX) return PLUGIN_CONTINUE; } set_user_footsteps(id, 1); uzyl[id] = true; zabierz_prezenty(id, prezents) } case 5:{ new money = cs_get_user_money(id) new prezents = get_pcvar_num(koszt_ks); if(prezenty[id] < prezents){ not_prezens(id, prezenty[id], prezents); return PLUGIN_CONTINUE; } if(money > 16000) { ColorChat(id, GREEN, "4FUN:^x01 Masz maksymalna ilosc pieniedzy!", PREFIX); return PLUGIN_CONTINUE; } cs_set_user_money(id, min(money+4000, 16000), 1); zabierz_prezenty(id, prezents) } case 6:{ new prezents = get_pcvar_num(koszt_ps); if(prezenty[id] < prezents){ not_prezens(id, prezenty[id], prezents); return PLUGIN_CONTINUE; } if(render_ma[id]) { ColorChat(id, GREEN, "%s^x01 Czy Ty chcesz sie^x03 przeswiecic^x01 na te swieta? Masz juz to!"); return PLUGIN_CONTINUE; } new team = get_user_team(id) if(team > 2) return PLUGIN_CONTINUE; set_user_rendering(id, kRenderFxGlowShell, team == 1 ? 255 : 0, 0, team == 2 ? 255 : 0, kRenderNormal, 150) zabierz_prezenty(id, prezents) render_ma[id]= true; } case 9: { return PLUGIN_HANDLED; } } return PLUGIN_HANDLED; } stock zabierz_prezenty(index, prezents) prezenty[index] -= prezents; stock not_prezens(index, prezenty, iletrzeba){ ColorChat(index, GREEN, "%s^x01 Masz^x03 za malo^x01 prezentow ^x03%i^x01 /^x04 %i^x01", PREFIX, prezenty, iletrzeba); } sklep_swiateczny.sma Edytowane 20 Grudnia 2013 przez Nesty Nowa wersja 3.0
Legendarny Fragowicz powN Opublikowano 19 Listopada 2011 Legendarny Fragowicz Opublikowano 19 Listopada 2011 Mam nadzieje, że będzie u nas na serwerze w czasie świąt :) Daje ogromną frajdę w czasie gry i super klimat.
Właściciel GET Opublikowano 19 Listopada 2011 Autor Właściciel Opublikowano 19 Listopada 2011 Oczywiście, będzie jak najbardziej i to w znacznie bardzo rozbudowanej wersji niż rok temu.
Właściciel GET Opublikowano 30 Marca 2013 Autor Właściciel Opublikowano 30 Marca 2013 Dostępna kolejna wersja, finalna tego pluginu. Projekt nie będzie już rozwijany, cvary nie zostały w żaden sposób naruszone, udostępniam zarówno betę w załączniku pod nazwą "sklep" i finalną jako "christmas_shop". Jest spora różnica w optymalności, nowa wersja zapobiega dawaniu danego przedmiotu wtedy, kiedy nie było to konieczne. Mało tego, należy uzupełnić pre-procesor "MAX" liczbą adekwatną do ilości slotów. Gdyż wtedy niepotrzebnie zmienne globalne przechowują więcej pamięci niż potrzebne, przez co zużycie RAM wzrasta - a tak nie wygląda optymalny plugin.
Właściciel GET Opublikowano 20 Grudnia 2013 Autor Właściciel Opublikowano 20 Grudnia 2013 Nowa wersja 3.0, całkowicie zoptymalizowana bez bugów.
Właściciel GET Opublikowano 6 Czerwca 2017 Autor Właściciel Opublikowano 6 Czerwca 2017 Wiadomość została wygenerowana automatycznie. Ten temat został oznaczony przez Moderatora jako spam i wyrzucony do -> archiwum. Jeśli się z tym nie zgadzasz, raportuj ten post, a moderator lub administrator rozpatrzy go ponownie.
Rekomendowane odpowiedzi