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.
|
[ROZWIĄZANE] Dodatkowe x% HP za zabicie Headshotem
#1
Napisano 09.04.2012 08:42
Poszukuję pluginu, który za każde zabicie przeciwnika headshotem dawałby dodatkowe x% HP (ile ustalane za pomocą cvaru). Plugin niby łatwy w działaniu lecz trudno go znaleźć w internecie
Dziękuję i pozdrawiam.
#2
Napisano 09.04.2012 11:36
Użytkownik Drzanas edytował ten post 09.04.2012 11:36
#3
Napisano 09.04.2012 11:50
#4
Napisano 09.04.2012 13:35
Wpisałem w google "hp za headshot" i drugi link to plugin którego szukasz.
#include <amxmodx>
#include <amxmisc>
#include <fun>
public plugin_init(){
register_plugin("HS Healer","1.0","naven")
register_event("DeathMsg", "DeathMsg", "a")
register_cvar("hshealer_hp", "20")
}
public DeathMsg()
{
new hs = read_data(3) // HeadShot (1 == true)
new kid = read_data(1) //zabojca
new hptoadd = get_cvar_num("hshealer_hp")
if(is_user_alive(kid))
{
if (hs > 0)
{
client_print(kid, print_chat, "Dostales +%iHP za headshota", hptoadd)
set_user_health(kid , get_user_health(kid) + hptoadd)
}
}
}
#5
Napisano 09.04.2012 19:20
Użytkownik rash edytował ten post 09.04.2012 19:20
#6
Napisano 09.04.2012 21:51
#include <amxmodx>
#include <amxmisc>
#include <fun>
public plugin_init(){
register_plugin("HS Healer","1.0","naven")
register_event("DeathMsg", "DeathMsg", "a")
register_cvar("hshealer_hp", "20")
}
public DeathMsg(){
new hs = read_data(3) // HeadShot (1 == true)
new kid = read_data(1) //zabojca
new hptoadd = get_cvar_num("hshealer_hp")
if(is_user_alive(kid))
{
if(hs > 0)
{
if(get_user_health(kid) >= 100) // tutaj ustawiasz ile max hp
{
return PLUGIN_HANDLED
}
else
{
client_print(kid, print_chat, "Dostales +%iHP za headshota", hptoadd)
set_user_health(kid , get_user_health(kid) + hptoadd)
}
}
}
return PLUGIN_CONTINUE
}
Użytkownik Drzanas edytował ten post 09.04.2012 21:52
#7
Napisano 10.04.2012 15:50
#8
Napisano 10.04.2012 16:01
Ten temat został zamknięty przez moderatora.
Powód: Pomoc udzielona
Jeśli się z tym nie zgadzasz, raportuj ten post, a moderator lub administrator rozpatrzy go ponownie.
Z pozdrowieniami,
Zespół AMXX.PL
If you can dream it, you can do it.
#9
Napisano 15.04.2012 08:37
Ten temat został otwarty przez moderatora.
Powód: Temat otwarty na prośbę użytkownika.
Z pozdrowieniami,
Zespół AMXX.PL
If you can dream it, you can do it.
#10
Napisano 15.04.2012 10:50
Pozdrawiam serdecznie.
Użytkownik rash edytował ten post 15.04.2012 10:50
#11
Napisano 15.04.2012 10:56
#include <amxmodx> #include <fun> new const PLUGIN_VERSION[] = "1.0d" new health_add new health_hs_add new health_max new gmsgScreenFade, g_maxplayers public plugin_init() { register_plugin("Vampire", PLUGIN_VERSION, "Shalfey") health_add = register_cvar("amx_vampire_hp", "0") //hp za zwyklego killa health_hs_add = register_cvar("amx_vampire_hp_hs", "35") //hp za hs health_max = register_cvar("amx_vampire_max_hp", "100") //maksymalne hp register_event("DeathMsg", "eDeathMsg", "a") gmsgScreenFade = get_user_msgid("ScreenFade") g_maxplayers = get_maxplayers() } public eDeathMsg() { new KillerId = read_data(1) new VictimId = read_data(2) if(!KillerId || KillerId > g_maxplayers) return if(KillerId == VictimId || get_user_team(KillerId) == get_user_team(VictimId)) return new KillerHealth = get_user_health(KillerId) new NewKillerHealth = min( ( read_data(3) ? get_pcvar_num(health_hs_add) : get_pcvar_num(health_add) ) + KillerHealth , get_pcvar_num(health_max) ) set_user_health(KillerId, NewKillerHealth) // Hud message "Healed +15/+40 hp" set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1) show_hudmessage(KillerId, "Healed +%d hp", NewKillerHealth - KillerHealth) // Screen fading message_begin(MSG_ONE, gmsgScreenFade, _, KillerId) write_short(1<<10) write_short(1<<10) write_short(0x0000) write_byte(0) write_byte(0) write_byte(200) write_byte(75) message_end() } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1045\\ f0\\ fs16 \n\\ par } */
Użytkownik norbi1952 edytował ten post 15.04.2012 11:02
#12
Napisano 15.04.2012 11:33
#14
Napisano 15.04.2012 11:59
#15
Napisano 15.04.2012 12:33
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define MAX_HP 100 // ile maksymalnie moze miec hp
public plugin_init(){
register_plugin("HS Healer","1.0","naven")
register_event("DeathMsg", "DeathMsg", "a")
register_cvar("hshealer_hp", "20")
}
public DeathMsg(){
new hs = read_data(3) // HeadShot (1 == true)
new kid = read_data(1) //zabojca
new hptoadd = get_cvar_num("hshealer_hp")
if(is_user_alive(kid))
{
if(hs > 0)
{
if(get_user_health(kid) >= MAX_HP - hptoadd ) // Jezeli grasz ma wiecej HP niż
{
new roznica = (MAX_HP - get_user_health(kid))
set_hudmessage(0, 255, 0, 0.30, 0.19, 0, 6.0, 3.0);
show_hudmessage(kid, "+%iHP za HS", roznica);
set_user_health(kid , get_user_health(kid) + roznica);
}
else
{
set_hudmessage(0, 255, 0, 0.30, 0.19, 0, 6.0, 3.0);
show_hudmessage(kid, "+%iHP za HS", hptoadd);
set_user_health(kid , get_user_health(kid) + hptoadd);
}
}
}
return PLUGIN_CONTINUE
}
A jak chcesz to tam wyżej to zamiast
client_print(kid, print_chat, "Dostales +%iHP za headshota", hptoadd)
Walnij to
set_hudmessage(0, 255, 0, 0.30, 0.19, 0, 6.0, 6.0);
show_hudmessage(kid, "+%iHP za HS", hptoadd);
Użytkownik Drzanas edytował ten post 15.04.2012 12:33
#16
Napisano 15.04.2012 12:47
if(hs)
{
new added = min(hptoadd, MAX_HP-get_user_health(kid));
if(added) {
set_hudmessage(0, 255, 0, 0.30, 0.19, 0, 6.0, 3.0);
show_hudmessage(kid, "+%iHP za HS", added);
set_user_health(kid, get_user_health(kid) + added);
}
}
Chyba tak będzie lepiej napisać ten jeden warunek.
Posiadam TBM (inaczej PTB), które działa dużo lepiej niż zwykłe PTB, nawet na modach z lvlami. Zainteresowany? Proszę bardzo
#17
Napisano 15.04.2012 14:50
#18
Napisano 15.04.2012 18:40
#include <amxmodx>
#include <fun>
new const PLUGIN_VERSION[] = "1.0d"
new health_add
new health_hs_add
new health_max
new g_maxplayers
public plugin_init() {
register_plugin("Vampire", PLUGIN_VERSION, "Shalfey")
health_add = register_cvar("amx_vampire_hp", "15")
health_hs_add = register_cvar("amx_vampire_hp_hs", "25")
health_max = register_cvar("amx_vampire_max_hp", "100")
register_event("DeathMsg", "eDeathMsg", "a")
g_maxplayers = get_maxplayers()
}
public eDeathMsg() {
new KillerId = read_data(1)
new VictimId = read_data(2)
if(!KillerId || KillerId > g_maxplayers)
return
if(KillerId == VictimId || get_user_team(KillerId) == get_user_team(VictimId))
return
new KillerHealth = get_user_health(KillerId)
new NewKillerHealth = min( ( read_data(3) ?
get_pcvar_num(health_hs_add) :
get_pcvar_num(health_add) ) +
KillerHealth ,
get_pcvar_num(health_max) )
set_user_health(KillerId, NewKillerHealth)
// Hud message "Healed +15/+40 hp"
set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1)
show_hudmessage(KillerId, "Healed +%d hp", NewKillerHealth - KillerHealth)
}
I to będzie wszystko
#19
Napisano 15.04.2012 21:32
#20
Napisano 15.04.2012 22:09
Ten temat został zamknięty przez moderatora.
Powód: Pomoc udzielona
Jeśli się z tym nie zgadzasz, raportuj ten post, a moderator lub administrator rozpatrzy go ponownie.
Z pozdrowieniami,
Zespół AMXX.PL
Posiadam TBM (inaczej PTB), które działa dużo lepiej niż zwykłe PTB, nawet na modach z lvlami. Zainteresowany? Proszę bardzo
Użytkownicy przeglądający ten temat: 0
0 użytkowników, 0 gości, 0 anonimowych