Sprawdź teraz. Od 4 rundy powinno się wyświetlać menu. Jak chcesz, żeby się wcześniej wyświetlało to napisz tu.
To równanie zostało stworzone przy pomocy kodu LaTeX:
Edytor LaTeX online: CodeCogs.com/latex/eqneditor.php
Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
|
Odnotowano 73 pozycji dodanych przez Jenot (Rezultat wyszukiwania ograniczony do daty: 17.06.2023 )
Napisano przez Jenot w 01.03.2014 12:14 w Problemy z pluginami
Napisano przez Jenot w 01.02.2014 16:00 w Problemy
Witam. Mam problem z zablokowaniem komendy, tzw "bugu na kase". Mam plugin sprzedaz broni na serwerze i tam jeśli ktoś zrobi sobie bind, czy też za każdym razem wpisuje w konsoli "drop; say /sprzedaj" to dodaje mu kase za sprzedaż broni, z broń mu tylko wyrzuca i może ją ponownie podnieść.
Próbowałem zablokować to w ten sposób
register_clcmd("drop; say /sprzedaj", "block"); //blokowanie binda na kase public block() { return PLUGIN_HANDLED_MAIN; }
lecz niestety nie daje efektów.
Poniżej pełen kod. Jest ktoś w stanie pomóc?
#include <amxmodx> #include <amxmisc> #include <fakemeta> #include <cstrike> #define Plugin "Sell Weapons" #define Version "1.5" #define Author "Doombringer" #define MAX_WEAPONS 33 new const g_prices[MAX_WEAPONS][] = { "0", "600", "0", "2750", "0", "3000", "0", "1400", "3500", "0", "800", "750", "1700", "4200", "2000", "2250", "500", "400", "4750", "1500", "5750", "1700", "3100", "1250", "5000", "0", "650", "3500", "2500", "0", "2350", "0", "0" } new cvar, buyzone, annonce, divide //Pcvar stuff, makes life easier public plugin_init() // Plugin_init(): Does all the "one-time" stuff. Called after plugin_precache(). { register_plugin(Plugin, Version, Author) //Register's the plugin so it can be seen in amx_help register_clcmd("say /sprzedaj", "cmd_sell") //Registers the command itself. So if someone say /sell the function will be executed register_clcmd("say_team /sprzedaj", "cmd_sell") //Save as above but for team chat register_clcmd("drop; say /sprzedaj", "block"); //blokowanie binda na kase cvar = register_cvar("SW_enabled", "1") //Registers the cvar SW_enabled, Default 1 (If nothing else is in server.cfg or any other .cfg file) buyzone = register_cvar("SW_buyzone", "0") //Registers the cvar SW_buyzone, Default 0 (If nothing else is in server.cfg or any other .cfg file) annonce = register_cvar("SW_annonce", "150") //Registers the cvar SW_annonce, Default 120 (If nothing else is in server.cfg or any other .cfg file) divide = register_cvar("SW_divide", "2") //Registers the cvar SW_divide, Default 2 (If nothing else is in server.cfg or any other .cfg file) if(get_pcvar_num(annonce) > 1) //If the pcvar annonce is higher then 1 set_task(get_pcvar_float(annonce), "print_annonce",_,_,_,"b") //Set a task to run the annonce function every get_pcvar_float(annonce) time } public print_annonce() //The function that shows the annonce { if(get_pcvar_num(annonce) < 1) //If it's lower then 1 return PLUGIN_CONTINUE //Make the plugin continue (Yes i know i should do remove_task() but this is better) client_print(0, print_chat, "Chcesz sprzedac bron? Wpisz /sprzedaj") //Prints the message to everyones chat area return PLUGIN_CONTINUE //Continue... } stock fm_find_ent_by_owner(index, const classname[], owner, jghgtype = 0) { // http://forums.alliedmods.net/showthread.php?t=28284 new strtype[11] = "classname", ent = index switch (jghgtype) { case 1: copy(strtype, 6, "target") case 2: copy(strtype, 10, "targetname") } while ((ent = engfunc(EngFunc_FindEntityByString, ent, strtype, classname)) && pev(ent, pev_owner) != owner) {} return ent } stock bool:fm_strip_user_gun(index, wid = 0, const wname[] = "") { // http://forums.alliedmods.net/showthread.php?t=28284 new ent_class[32] if (!wid && wname[0]) copy(ent_class, 31, wname) else { new weapon = wid, clip, ammo if (!weapon && !(weapon = get_user_weapon(index, clip, ammo))) return false get_weaponname(weapon, ent_class, 31) } new ent_weap = fm_find_ent_by_owner(-1, ent_class, index) if (!ent_weap) return false engclient_cmd(index, "drop", ent_class) new ent_box = pev(ent_weap, pev_owner) if (!ent_box || ent_box == index) return false dllfunc(DLLFunc_Think, ent_box) return true } public cmd_sell(id) //The whole main function { if(get_pcvar_num(cvar) < 1) //If the pcvar cvar is lower then one return PLUGIN_CONTINUE //Continue... if(get_pcvar_num(buyzone) == 1 && cs_get_user_buyzone(id) == 0) //If pcvar buyzone is equal to one and user is not in a buyzone { client_print(id, print_chat, "Musisz byc na respie by sprzedac bron!") //Prints a angry little message :) return PLUGIN_HANDLED //And ends the function } if(!is_user_alive(id)) //Isn't he alive?! { client_print(id, print_chat, "Musisz byc zywy, by sprzedac bron!") //Prints a angry little message :) return PLUGIN_HANDLED //And ends the function } new temp, weapon = get_user_weapon(id, temp, temp) //Fills weapon with the current hold weapon (temp is a so called dummy) new price = str_to_num(g_prices[weapon]) //Gets the price for the current weapon if(price == 0) //If it's equal to zero { client_print(id, print_chat, "Nie mozesz tego sprzedac!") //Prints a angry little message :) return PLUGIN_HANDLED //And ends the function } new weaponname[32] //Makes an array called weaponname, with a maximum of 32 - 1 chars get_weaponname(weapon, weaponname, 31) //Gets the weapon name new oldmoney = cs_get_user_money(id) //Gets the players money new cash = clamp(oldmoney + (price / get_pcvar_num(divide)), 0, 16000) //clamps the total amount of cash, so it doesn't extend the 16000 limit fm_strip_user_gun(id, weapon) //Calls the fm_strip_user_gun() stock cs_set_user_money(id, cash) //Sets the money from cash client_print(id, print_chat, "Otrzymales %d$ za sprzedanie %s", cs_get_user_money(id) - oldmoney, weaponname[7]) //Prints some info about what you got return PLUGIN_HANDLED //Done } //EOF public block() { return PLUGIN_HANDLED_MAIN; }
Napisano przez Jenot w 30.01.2014 20:39 w Pytania
#include <amxmodx> #include <amxmisc> #include <hamsandwich> #include <StripWeapons> #define PLUGIN "Rozgrzewka" #define VERSION "1.0" #define AUTHOR "Jenot" #define MAX 32 #define SPAWN_TASKID 9999 #define TASK_EQUIP 99999 #define RESTART_TASKID 123 #define ACTIVE_TASKID 124 enum PluginSounds { psJeden, psDwa, psTrzy, psMuzyka }; stock const gPluginSounds[ PluginSounds ][ 128 ] = { "sound/rozgrzewka/jeden.wav", "sound/rozgrzewka/dwa.wav", "sound/rozgrzewka/trzy.wav", "sound/rozgrzewka/muzyka.mp3" } stock const gPluginPause[ ][ ] = { "imessage.amxx", "redbull.amxx", "scrollmsg.amxx", "vip.amxx", "RoundSound.amxx", "ultimate_sounds.amxx" } new bool:Active = false; new bool:gbPlay[ MAX + 1 ]; new bool:daj_hajs = false; new frags[33]; new gPcvar[ 3 ]; public plugin_init( ) { register_plugin( PLUGIN, VERSION, AUTHOR ) register_event("TextMsg", "Game_Restart", "a", "2&#Game_C"); register_event("DeathMsg","onDeath","a"); register_event("CurWeapon","eventCurWeapon","be","1=0", "2!0"); register_event("HLTV", "New_Round", "a", "1=0", "2=0"); RegisterHam(Ham_Spawn, "player", "fwSpawn",1); gPcvar[ 0 ] = register_cvar( "rozgrzewka_czas", "95" ); gPcvar[ 1 ] = register_cvar( "rozgrzewka_odrodzenie", "2.0" ); gPcvar[ 2 ] = get_cvar_pointer( "mp_freezetime" ); blockBuy( ); } public plugin_precache( ) { for( new i = 0; i < sizeof( gPluginSounds ); i++) { precache_generic( gPluginSounds[ PluginSounds: i ] ); } } public Game_Restart( ) { if( Active ) { remove_task( RESTART_TASKID ); return; } Active = true; new iRTime = get_pcvar_num( gPcvar[ 0 ] )+ get_pcvar_num( gPcvar[ 2 ] ) + 1; for( new i = 1; i < MAX + 1; i++ ) { gbPlay[ i ] = true; } new param[ 1 ]; param[ 0 ]= iRTime; set_task( 1.0, "CountDown", RESTART_TASKID, param, 1); for(new i = 0; i < sizeof gPluginPause; i++) { pause( "ac", gPluginPause[ i ] ); } } public CountDown( param[ 1 ] ) { new iNow = param[ 0 ]--; switch( iNow ) { case 0:{ server_cmd("sv_restartround 1"); clearRespawns(); new param[ 1 ]; param[ 0 ] = 0; set_task(1.0, "Activation", ACTIVE_TASKID, param, 1); for(new i = 0; i < sizeof gPluginPause; i++) { unpause( "ac", gPluginPause[ i ] ); } } case 1: play( 0, gPluginSounds[ psJeden ] ); case 2: play( 0, gPluginSounds[ psDwa ] ); case 3: play( 0, gPluginSounds[ psTrzy ] ); } if( iNow >= 1) { set_task( 1.0, "CountDown", RESTART_TASKID, param, 1); } new fx = 0; if( iNow <= 5) { fx=1; } set_hudmessage( random_num( 0, 255 ), random_num( 0, 255 ), random_num( 0, 255 ), 0.65, 0.75, fx, 6.0, 1.0 ) show_hudmessage(0, "Czas rozgrzewki^n%2d:%02d",iNow/60,iNow%60); } public Activation( param[ 1 ] ) { Active = ( param[ 0 ] == 0 )?false:true; } public onDeath( ) { new vid = read_data( 2 ); if( Active ) { set_task( get_pcvar_float(gPcvar[ 1 ]), "respawn", SPAWN_TASKID + vid); } return PLUGIN_CONTINUE; } public fwSpawn( id ) { if( Active && is_user_alive( id ) ) { if( gbPlay[ id ] ) { play( id, gPluginSounds[ psMuzyka ] ); gbPlay[ id ] = false; } if(task_exists(TASK_EQUIP +id ) ) { remove_task( TASK_EQUIP + id ); } set_task(0.2, "taskEquip", TASK_EQUIP + id); } } public eventCurWeapon( id ) { if( Active ) { if( task_exists( TASK_EQUIP + id ) ) { remove_task( TASK_EQUIP + id ); } set_task(0.5, "taskEquip", TASK_EQUIP + id); } } public taskEquip( id ) { id -= TASK_EQUIP; if( Active && is_user_alive( id ) ) { StripWeapons(id, Primary); StripWeapons(id, Secondary); StripWeapons(id, Grenades); StripWeapons(id, C4); } } public respawn( task_id ) { ExecuteHamB( Ham_CS_RoundRespawn, task_id - SPAWN_TASKID ); } public clearRespawns(){ for( new i = 1; i <= MAX; i++) { if( task_exists( SPAWN_TASKID + i ) ) { remove_task(SPAWN_TASKID+i); } if( task_exists( TASK_EQUIP + i ) ) { remove_task( TASK_EQUIP + i ); } } } /* Blokada */ public blockBuy( ) { register_clcmd( "drop", "block" ) register_clcmd( "cl_setautobuy", "block" ) register_clcmd( "cl_autobuy", "block" ) register_clcmd( "cl_setrebuy", "block" ) register_clcmd( "cl_rebuy", "block" ) register_clcmd( "buy", "block" ) register_clcmd( "p228", "block" ); register_clcmd( "228compact", "block" ); register_clcmd( "shield", "block" ); register_clcmd( "scout", "block" ); register_clcmd( "hegren", "block" ); register_clcmd( "xm1014", "block" ); register_clcmd( "autoshotgun", "block" ); register_clcmd( "mac10", "block" ); register_clcmd( "aug", "block" ); register_clcmd( "bullpup", "block" ); register_clcmd( "sgren", "block" ); register_clcmd( "elites", "block" ); register_clcmd( "fn57", "block" ); register_clcmd( "fiveseven", "block" ); register_clcmd( "ump45", "block" ); register_clcmd( "sg550", "block" ); register_clcmd( "krieg550", "block" ); register_clcmd( "galil", "block" ); register_clcmd( "defender", "block" ); register_clcmd( "famas", "block" ); register_clcmd( "clarion", "block" ); register_clcmd( "usp", "block" ); register_clcmd( "km45", "block" ); register_clcmd( "glock", "block" ); register_clcmd( "9x19mm", "block" ); register_clcmd( "awp", "block" ); register_clcmd( "magnum", "block" ); register_clcmd( "mp5", "block" ); register_clcmd( "smg", "block" ); register_clcmd( "m249", "block" ); register_clcmd( "m3", "block" ); register_clcmd( "12gauge", "block" ); register_clcmd( "m4a1", "block" ); register_clcmd( "tmp", "block" ); register_clcmd( "mp", "block" ); register_clcmd( "g3sg1", "block" ); register_clcmd( "d3au1", "block" ); register_clcmd( "flash", "block" ); register_clcmd( "deagle", "block" ); register_clcmd( "nighthawk", "block" ); register_clcmd( "sg552", "block" ); register_clcmd( "krieg552", "block" ); register_clcmd( "ak47", "block" ); register_clcmd( "cv47", "block" ); register_clcmd( "p90", "block" ); register_clcmd( "c90", "block" ); register_clcmd( "primammo", "block" ); register_clcmd( "secammo", "block" ); register_clcmd( "vest", "block" ); register_clcmd( "vesthelm", "block" ); register_clcmd( "nvgs", "block" ); } public block( id ) { if( Active ) { client_print( id, print_center, "Nie tym razem" ); return PLUGIN_HANDLED; } return PLUGIN_CONTINUE; } /* Odtwarzanie */ play( id, const sound[ ] ) { new end = strlen( sound ) - 4; if( containi(sound, ".mp3" ) == end && end > 0 ) client_cmd( id, "mp3 play %s", sound); else if( containi(sound,".wav") == end && end > 0) client_cmd(id, "spk %s", sound); else client_cmd(id, "speak %s",sound); } public client_connect(id) { daj_hajs[id] = false; } public Koniec() { new najlepszy_gracz = 0; get_players(najlepszy_gracz, num) new rank[1] for(new i = 0; i < num; i++) { new id = najlepszy_gracz[i] daj_hajs[id] = false if(frags[id] > rank[0]) { rank[0] = id } frags[i] = 0 } daj_hajs[rank[0]] = true; } /* Naliczanie */ public Death() { new iKiller = read_data(1) new iVictim = read_data(2) new a = get_user_team(iKiller) new b = get_user_team(iVictim) new c = is_user_connected(iKiller) new d = is_user_connected(iVictim) if(a != b && c && d) { frags[iKiller]++ } } /* Prezent */ public New_Round(id) { new gRound = 0; { gRound++; } get_user_name(najlepszy_gracz, name, 34); client_print(najlepszy_gracz, print_chat,"Najlepszym graczem rozgrzewki zostal %s i otrzymal 200$",name); if(is_user_connected(najlepszy_gracz) { if(is_user_alive(id) && daj_hajs[id]) { cs_set_user_money(najlepszy_gracz,cs_get_user_money(najlepszy_gracz)+200); daj_hajs = false; } } if( gRound >= 2) { daj_hajs[id]=false; }
Tak będzie dobrze?
Napisano przez Jenot w 30.01.2014 16:19 w Pytania
Jak dodam do rozgrzewki taki kod, to zadziała to dawanie kasy? Chodzi mi o to, żeby ono było tylko i wyłącznie w pierwszej rundzie i żeby otrzymał je najlepszy gracz rozgrzewki.
public client_connect(id) { prezent[id] = false; } public Koniec() { new players[32], num get_players(players, num) new rank[1] for(new i = 0; i < num; i++) { new id = players[i] prezent[id] = false if(frags[id] > rank[0]) { rank[0] = id } frags[i] = 0 } prezent[rank[0]] = true; } /* Naliczanie */ public Death() { new iKiller = read_data(1) new iVictim = read_data(2) new a = get_user_team(iKiller) new b = get_user_team(iVictim) new c = is_user_connected(iKiller) new d = is_user_connected(iVictim) if(a != b && c && d) { frags[iKiller]++ } } /* Prezent */ public New_Round() { { gRound++; } if(is_user_alive(id) && prezent[id]) { cs_set_user_money(id,cs_get_user_money(id) + 200) } if( gRound >= 2) { prezent[id]=false; }
Napisano przez Jenot w 30.01.2014 15:08 w Pytania
Witam. Mam problem. Otóż chcę dodać prezent dla najlepszego gracza rozgrzewki. Osoba, która będzie miała najwięcej fragów na rr otrzyma w pierwszej rundzie po rozgrzewce dodatkowe 200$, czyli łącznie będzie miała ich 1000. I tutaj pojawia się problem, jakiego eventu użyć, by gracz otrzymał dodatkowe pieniądze w tylko i wyłącznie w pierwszej rundzie po rr? Rozgrzewka trwa minutę, jest reset i gra zaczyna się od nowa.
Napisano przez Jenot w 29.05.2013 20:33 w Problemy z pluginami
A wyłącz plugin "deathrun_stats.amxx" i zobacz czy dalej będzie tak robić.
Napisano przez Jenot w 25.05.2013 16:10 w Prośby o Klasę/Perk
Sprawdź. Skill dredka.
codperk_skilldredka.sma 2,08 KB 39 Ilość pobrań
codperk_skilldredka.amxx
Napisano przez Jenot w 22.05.2013 13:55 w Pytania dotyczące pluginów
mp_timelimit "czas"
Napisano przez Jenot w 12.05.2013 20:25 w Szukam pluginu
Wgraj sobie ten plugin:
http://amxx.pl/topic...replacement-13/
Tam masz wszystko opisane, jak co zrobić.
Napisano przez Jenot w 12.05.2013 10:41 w Prośby o Klasę/Perk
codclass_elitarnysnajper.sma 2,18 KB 35 Ilość pobrań
codclass_elitarnysnajper.amxx
Napisano przez Jenot w 12.05.2013 10:33 w Prośby o Klasę/Perk
codclass_rusher.sma 1,77 KB 48 Ilość pobrań
codclass_rusher.amxx
Napisano przez Jenot w 11.05.2013 22:08 w Prośby o modyfikacje silników/klas/perków
Frakcje masz w kodzie dodane jak widzę.
Musisz wrzucić ten plik do cstrike/addons/amxmodx/configs i tam dodajesz sobie wszystko wg wzoru.
cod_frakcje.ini 344 bajtów 44 Ilość pobrań
Napisano przez Jenot w 11.05.2013 21:05 w Prośby o Klasę/Perk
Łap.
codclass_amadeusz.sma 1,52 KB 28 Ilość pobrań
codclass_amadeusz.amxx
Napisano przez Jenot w 09.05.2013 20:47 w Prośby o modyfikacje silników/klas/perków
Masz.
QTM_CodMod.sma 46,2 KB 27 Ilość pobrań
QTM_CodMod.amxx
Napisano przez Jenot w 09.05.2013 13:28 w Pytania dotyczące pluginów
Napisano przez Jenot w 08.05.2013 19:32 w Pytania
Wgraj silnik stąd.
http://amxx.pl/topic...ty-mw-mod-beta/
Masz stworzone plugins-codmod.ini i tam dopisane wszystkie klasy, perki, silnik?
Jak są errory to pokaż logi.
Napisano przez Jenot w 08.05.2013 16:22 w Prośby o Klasę/Perk
Nie napisałeś nigdzie, że chcesz wszystkie granaty.
Tu masz poprawione, dostajesz HE - 1/1 z niego i 1/1 z awp.
codclass_general.sma 1,59 KB 31 Ilość pobrań
codclass_general.amxx
Napisano przez Jenot w 07.05.2013 20:26 w Prośby o Klasę/Perk
Generał.
codclass_general.sma 1,38 KB 26 Ilość pobrań
codclass_general.amxx
Napisano przez Jenot w 07.05.2013 20:23 w Prośby o Klasę/Perk
Napisano przez Jenot w 07.05.2013 20:05 w Prośby o Klasę/Perk
Szaleniec. Masz go na flagę M.
codclass_szaleniec.sma 2,23 KB 17 Ilość pobrań
codclass_szaleniec.amxx
Napisano przez Jenot w 07.05.2013 19:39 w Prośby o Klasę/Perk
Spróbuj teraz.
codclass_achmed.sma 2,46 KB 48 Ilość pobrań
codclass_achmed.amxx
Jeżeli nie będzie działać, to zamiast z engine skorzystam z fakemeta. Sprawdź i napisz.