Witamy w Nieoficjalnym polskim support'cie AMX Mod X
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.
|

Golden Gun
#21
Napisano 07.09.2008 09:11
#22
Napisano 07.09.2008 09:43
entity_set_float(id,EV_FL_fov,90.0) // Bez zooma entity_set_float(id,EV_FL_fov,55.0) // Zoom jak w aug
Muszisz tylko dorobic kod co bedzie wykrywal PPM gdy ma sie GoldGuna ;-)
PS. Uzylem ->Mojego pluga <- i chwile sie pobawilem zoomem i wiem co trzeba zmieniac by byl taki efekt

#23
Napisano 07.09.2008 09:45
L 03/23/2008 - 14:59:45: Invalid CVAR pointer
L 03/23/2008 - 14:59:45: [AMXX] Run time error 10 (plugin "Golden_Gun.amxx") (native "get_pcvar_num") - debug not enabled!
L 03/23/2008 - 14:59:45: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
to znaczy, że:
1. Albo nie dodałeś amxmod_compat.amxx (ten plugin standardowo jest w amxx, trzeba odznaczyć ; sprzed nazwy pluginu)
#25
Napisano 07.09.2008 10:17
#include <amxmodx> #include <amxmisc> #include <engine> #define PLUGIN "zoom" #define VERSION "0.1" #define AUTHOR "Miczu" new g_msg_SetFOV public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) g_msg_SetFOV = get_user_msgid("SetFOV") } new zmienna[33] new zoom[33] public client_PreThink(id) { new button = get_user_button(id) if(zmienna[id]==0 && button & IN_ATTACK2) { zoom[id]++ if(zoom[id]>3)zoom[id]=0 if(zoom[id]==0) set_fov(id,90) else if(zoom[id]==1) set_fov(id,55) else if(zoom[id]==2) set_fov(id,25) else if(zoom[id]==3) set_fov(id,5) } if(button & IN_ATTACK2) zmienna[id] = 1 else zmienna[id] = 0 } public set_fov(id,fov) { if(is_user_alive(id)) { message_begin(MSG_ONE,g_msg_SetFOV,{0,0,0},id) write_byte( fov ) message_end() } }powinno sie przydac - gotowe to testow
#26
Napisano 07.09.2008 11:27
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #include <fakemeta> #include <engine> #include <csx> #define PLUGIN "Golden_Gun" #define VERSION "1.1" #define AUTHOR "MaKeL" new g_msg_SetFOV new bool:masz_golden_gun[33] new cvar_on; new cvar_goldengun_cost; new zmienna[33] new zoom[33] public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) pause("ac") register_clcmd("say /goldengun","kupgoldengun"); register_clcmd("say /gg","kupgoldengun"); register_event("DeathMsg", "DeathMsg", "a") register_event("CurWeapon","curweap","be", "1=1"); g_msg_SetFOV = get_user_msgid("SetFOV") cvar_on = register_cvar("amxx_goldengun_on", "1"); cvar_goldengun_cost = register_cvar("amxx_goldengun_cost", "16000") register_cvar( "amxx_goldengunded", "1" ) } public plugin_precache() { precache_model("models/gg/v_deagle.mdl"); precache_model("models/gg/p_deagle.mdl"); } public client_connect(id) { masz_golden_gun[id] = false } public client_PreThink(id) { new button = get_user_button(id) new clip,ammo if(masz_golden_gun[id] && get_user_weapon(id,clip,ammo)==CSW_DEAGLE) { if(zmienna[id]==0 && button & IN_ATTACK2) { zoom[id]++ if(zoom[id]>1)zoom[id]=0 if(zoom[id]==0) set_fov(id,90) else if(zoom[id]==1) set_fov(id,55) } if(button & IN_ATTACK2) zmienna[id] = 1 else zmienna[id] = 0 } } public set_fov(id,fov) { if(is_user_alive(id)) { message_begin(MSG_ONE,g_msg_SetFOV,{0,0,0},id) write_byte( fov ) message_end() } } public kupgoldengun(id) { if(!get_pcvar_num(cvar_on)) { client_print(id,print_chat,"[AMXX] Mod GolednGun jest nieaktywny"); return PLUGIN_HANDLED; } else { new money = cs_get_user_money(id); new price = get_pcvar_num(cvar_goldengun_cost); if(!is_user_alive(id)) { client_print(id, print_chat, "[AMXX] Czlowieku ty niezyjesz"); } else if(masz_golden_gun[id]) { client_print(id, print_chat, "[AMXX] Masz juz GoldenGun"); } else if(money < price) { client_print(id,print_chat,"[AMXX] Niemasz tyle kasy"); } else { masz_golden_gun[id] = true; cs_set_user_money(id, money - price); set_task(0.2,"GiveWeapona", id) client_cmd(id,"weapon_usp;weapon_glock18;weapon_elite;weapon_p228;wait;wait;wait;wait;drop") client_print(id,print_chat,"[AMXX] Kupiles GoldenGun za %i $",price); } } return PLUGIN_HANDLED; } public GiveWeapona(id) { give_item(id,"weapon_deagle"); give_item(id,"ammo_50ae"); give_item(id,"ammo_50ae"); give_item(id,"ammo_50ae"); } public DeathMsg() { new id = read_data(2) masz_golden_gun[id]=false } public curweap(id) { set_fov(id,90) new clip,ammo if(masz_golden_gun[id] && get_user_weapon(id,clip,ammo)==CSW_DEAGLE) { entity_set_string(id, EV_SZ_viewmodel, "models/gg/v_deagle.mdl") entity_set_string(id, EV_SZ_weaponmodel, "models/gg/p_deagle.mdl") entity_set_vector(id, EV_VEC_punchangle, Float:{0.0, 0.0, 0.0}) } return PLUGIN_CONTINUE; } public client_damage(attacker, victim, damage, wpnindex, headshot, TA) { new attteam, victeam, attfrags, vicfrags, attmoney if(is_user_alive(victim)) { if((attacker != victim)) //prevents killing self with knife from fall damage. { if(wpnindex == CSW_DEAGLE ) { if (damage > 0) { if(masz_golden_gun[attacker]) { user_silentkill( victim ) make_deathmsg( attacker, victim, headshot, "deagle" ) } } } } } if( damage > 0 ) { attteam = get_user_team( attacker ) victeam = get_user_team( victim ) attfrags = get_user_frags( attacker ) vicfrags = get_user_frags( victim ) attmoney = cs_get_user_money( attacker ) if( attteam != victeam) { set_user_frags( attacker, attfrags + 1 ) if(vicfrags > 0) { set_user_frags( victim, vicfrags + 1 ) } cs_set_user_money( attacker, attmoney + 300 ) } if( attteam == victeam ) { set_user_frags( attacker, attfrags - 1 ) } return PLUGIN_CONTINUE } return PLUGIN_CONTINUE }
wersja z zoomem
Dzięki MICZU za pomoc
#27
Napisano 07.09.2008 11:40
public curweap(id) { set_fov(id,90)
Popraw bo ten event jest wywolywany tez przy strzale - gdy bron ==gg i ma zoom to fov(id,55 )
[ Dodano: 07-09-2008, 12:47 ]
Aha i nie mozna oddac swojego gg przez drop ;>
#28
Napisano 07.09.2008 12:41
public curweap(id) { set_fov(id,90)zrobiłem tak gdyż
jesli mamy gg i przyblizymy i zmienimy na nuz to przyblizenie zostaje przy nożu a po dodaniu tego robi się normalne
[ Dodano: 07-09-2008, 13:43 ]
a co do dropu gg to niepomyslałe ale dopisze
#29
Napisano 07.09.2008 12:50
if(wpnindex != CSW_DEAGLE) set_fov(id,90)
#30
Napisano 07.09.2008 13:06
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #include <fakemeta> #include <engine> #include <csx> #define PLUGIN "Golden_Gun" #define VERSION "1.1" #define AUTHOR "MaKeL" new g_msg_SetFOV new bool:masz_golden_gun[33] new cvar_on; new cvar_goldengun_cost; new zmienna[33] new zoom[33] public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) pause("ac") register_clcmd("say /goldengun","kupgoldengun"); register_clcmd("say /gg","kupgoldengun"); register_event("DeathMsg", "DeathMsg", "a") register_event("CurWeapon","curweap","be", "1=1"); g_msg_SetFOV = get_user_msgid("SetFOV") register_forward(FM_EmitSound,"fw_emitsound"); cvar_on = register_cvar("amxx_goldengun_on", "1"); cvar_goldengun_cost = register_cvar("amxx_goldengun_cost", "16000") register_cvar( "amxx_goldengunded", "1" ) } public plugin_precache() { precache_model("models/gg/v_deagle.mdl"); precache_model("models/gg/p_deagle.mdl"); } public client_connect(id) { masz_golden_gun[id] = false } public client_PreThink(id) { new button = get_user_button(id) new clip,ammo if(masz_golden_gun[id] && get_user_weapon(id,clip,ammo)==CSW_DEAGLE) { if(zmienna[id]==0 && button & IN_ATTACK2) { zoom[id]++ if(zoom[id]>1)zoom[id]=0 if(zoom[id]==0) set_fov(id,90) else if(zoom[id]==1) set_fov(id,55) } if(button & IN_ATTACK2) zmienna[id] = 1 else zmienna[id] = 0 } if( get_user_weapon(id,clip,ammo)!==CSW_DEAGLE) set_fov(id,90) } public set_fov(id,fov) { if(is_user_alive(id)) { message_begin(MSG_ONE,g_msg_SetFOV,{0,0,0},id) write_byte( fov ) message_end() } } public kupgoldengun(id) { if(!get_pcvar_num(cvar_on)) { client_print(id,print_chat,"[AMXX] Mod GolednGun jest nieaktywny"); return PLUGIN_HANDLED; } else { new money = cs_get_user_money(id); new price = get_pcvar_num(cvar_goldengun_cost); if(!is_user_alive(id)) { client_print(id, print_chat, "[AMXX] Czlowieku ty niezyjesz"); } else if(masz_golden_gun[id]) { client_print(id, print_chat, "[AMXX] Masz juz GoldenGun"); } else if(money < price) { client_print(id,print_chat,"[AMXX] Niemasz tyle kasy"); } else { masz_golden_gun[id] = true; cs_set_user_money(id, money - price); set_task(0.2,"GiveWeapona", id) client_cmd(id,"weapon_usp;weapon_glock18;weapon_elite;weapon_p228;wait;wait;wait;wait;drop") client_print(id,print_chat,"[AMXX] Kupiles GoldenGun za %i $",price); } } return PLUGIN_HANDLED; } public GiveWeapona(id) { give_item(id,"weapon_deagle"); give_item(id,"ammo_50ae"); give_item(id,"ammo_50ae"); give_item(id,"ammo_50ae"); } public DeathMsg() { new id = read_data(2) masz_golden_gun[id]=false } public curweap(id) { new clip,ammo if(masz_golden_gun[id] && get_user_weapon(id,clip,ammo)==CSW_DEAGLE) { entity_set_string(id, EV_SZ_viewmodel, "models/gg/v_deagle.mdl") entity_set_string(id, EV_SZ_weaponmodel, "models/gg/p_deagle.mdl") entity_set_vector(id, EV_VEC_punchangle, Float:{0.0, 0.0, 0.0}) } return PLUGIN_CONTINUE; } public client_damage(attacker, victim, damage, wpnindex, headshot, TA) { new attteam, victeam, attfrags, vicfrags, attmoney if(is_user_alive(victim)) { if((attacker != victim)) //prevents killing self with knife from fall damage. { if(wpnindex == CSW_DEAGLE ) { if (damage > 0) { if(masz_golden_gun[attacker]) { user_silentkill( victim ) make_deathmsg( attacker, victim, headshot, "deagle" ) } } } } } if( damage > 0 ) { attteam = get_user_team( attacker ) victeam = get_user_team( victim ) attfrags = get_user_frags( attacker ) vicfrags = get_user_frags( victim ) attmoney = cs_get_user_money( attacker ) if( attteam != victeam) { set_user_frags( attacker, attfrags + 1 ) if(vicfrags > 0) { set_user_frags( victim, vicfrags + 1 ) } cs_set_user_money( attacker, attmoney + 300 ) } if( attteam == victeam ) { set_user_frags( attacker, attfrags - 1 ) } return PLUGIN_CONTINUE } return PLUGIN_CONTINUE }
tu wstawiłem ale nietestowalem
public client_PreThink(id) { new button = get_user_button(id) new clip,ammo if(masz_golden_gun[id] && get_user_weapon(id,clip,ammo)==CSW_DEAGLE) { if(zmienna[id]==0 && button & IN_ATTACK2) { zoom[id]++ if(zoom[id]>1)zoom[id]=0 if(zoom[id]==0) set_fov(id,90) else if(zoom[id]==1) set_fov(id,55) } if(button & IN_ATTACK2) zmienna[id] = 1 else zmienna[id] = 0 } if( get_user_weapon(id,clip,ammo)!==CSW_DEAGLE) set_fov(id,90) }
#31
Napisano 07.09.2008 13:16
a co do pluga fajny tylko jest morzliwosc dodania dzwieku jak wyciaga z "kieszeni" gg
dzwiek ten http://www.sendspace.pl/file/DKSsa8dL/
i jeszcze jedno chce zeby deagle zwykle nie mialo mocy takiej jak gg
#32
Napisano 07.09.2008 13:30
#33
Napisano 07.09.2008 20:23

Ps. jak bedzie wersja bez bugow to dam pomogl ok ??

#34
Napisano 08.09.2008 08:51
#35
Napisano 10.09.2008 14:50
#36
Napisano 10.09.2008 15:05
![:]](https://amxx.pl/public/style_emoticons/default/cwaniak.gif)
#37
Napisano 10.09.2008 22:05
wersja z dzwiękiem przy wyciagania
dzwiek wrzuc do cstrike/sound/misc/gg.wav
Myśle że Cie zadowoli
PS: Jak bedzie czas to ukaze sie kolejna wersja mam pewien pomysł
Załączone pliki
#38
Napisano 11.09.2008 15:51
PS. co masz na mysli "mam pewien pomysł" mozna wiedziec jaki pomysl
![:]](https://amxx.pl/public/style_emoticons/default/cwaniak.gif)
#39
Napisano 11.09.2008 16:02
#40
Napisano 11.09.2008 16:30

Użytkownicy przeglądający ten temat: 0
0 użytkowników, 0 gości, 0 anonimowych