←  Szukam pluginu

AMXX.pl: Support AMX Mod X i SourceMod

»

[ROZWIĄZANE] Dodatkowe x% HP za zabicie He...

Zablokowany

  • +
  • -
rash - zdjęcie rash 09.04.2012

Witajcie!

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.
Odpowiedz

  • +
  • -
MlodyKasciaz - zdjęcie MlodyKasciaz 09.04.2012

Drzanas ty chyba nie czytasz... Jemu chodzi o HP a nie XP -,-
Odpowiedz

  • +
  • -
Drzanas - zdjęcie Drzanas 09.04.2012

Fakt źle przeczytałem.
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)
}
}
}
Odpowiedz

  • +
  • -
rash - zdjęcie rash 09.04.2012

A mam pytanie czy jeżeli ktoś będzie miał 100HP i zabije przeciwnika po przez headshota to jego poziom się zwiększy czy maksymalnie będzie wynosił 100? Jest to dla mnie bardzo ważne aby wskaźnik nie przekraczał 100HP.
Użytkownik rash edytował ten post 09.04.2012 19:20
Odpowiedz

  • +
  • -
Drzanas - zdjęcie Drzanas 09.04.2012

#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
Odpowiedz

  • +
  • -
rash - zdjęcie rash 10.04.2012

Dziękuję bardzo łap plusika :)
Odpowiedz

  • +
  • -
speedkill - zdjęcie speedkill 10.04.2012

Wiadomość wygenerowana automatycznie


Ten temat został zamknięty przez moderatora.

Powód: Pomoc udzielona

Jeśli się z tym nie zgadzasz, Dołączona grafika raportuj ten post, a moderator lub administrator rozpatrzy go ponownie.


Z pozdrowieniami,
Zespół AMXX.PL
Odpowiedz

  • +
  • -
speedkill - zdjęcie speedkill 15.04.2012

Wiadomość wygenerowana automatycznie


Ten temat został otwarty przez moderatora.

Powód: Temat otwarty na prośbę użytkownika.


Z pozdrowieniami,
Zespół AMXX.PL
Odpowiedz

  • +
  • -
rash - zdjęcie rash 15.04.2012

No niestety jest jednak problem. Jak zauważyłem podczas działania pluginu gdy mam, np, 80HP i zabiję kogoś headshotem to jest ok mój poziom życia wzrasta do 100HP lecz gdy mam np. 90 lub 93, itp. to dostaję całe 20HP i mam 110&113. Chciałbym aby on działał na takiej zasadzie jak na filmie poniżej i czy było by można napis umieścić w HUDZIE na środku lecz nie co powyżej wycentrowania? mogło by być nawet tak jak na tym filmie.



Pozdrawiam serdecznie.
Użytkownik rash edytował ten post 15.04.2012 10:50
Odpowiedz

  • +
  • -
szelbi - zdjęcie szelbi 15.04.2012

Łap. Miałem na swoim serwerze i działa. Jest info w HUD identyczne jak na filmiku :)

#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
Odpowiedz

  • +
  • -
rash - zdjęcie rash 15.04.2012

Plugin imponujący lecz kurde jest mały mankament. Mianowicie gdy ujdzie mi torchę HP i zabiję kogoś normalnie to i tak mruga ekran i wyświetla się ze dostalem 0 HP. Można w ogóle usunąć jakoś tą opcję aby tylko HS był i aby nie koniecznie tak migał ten ekran ?
Odpowiedz

  • +
  • -
Drzanas - zdjęcie Drzanas 15.04.2012

A może takie coś
Spoiler
Nie testowane, ale na logike powinno działać, chyba że się w matematyce pomyliłem :D
#define MAX_HP 100 // ile maksymalnie moze miec hp
tutaj ustawiasz ile maksymalnie może mieć gracz HP
Użytkownik Drzanas edytował ten post 15.04.2012 11:44
Odpowiedz

  • +
  • -
rash - zdjęcie rash 15.04.2012

Chodzi tylko o to, aby napis był wyświetlany tak jak w powyższym pluginie w HUD powyżej środka:)
Odpowiedz

  • +
  • -
Drzanas - zdjęcie Drzanas 15.04.2012

To jest to chyba (chyba, bo nie sprawdzałem)z maksymalnym HP
#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
Odpowiedz

  • +
  • -
sebul - zdjęcie sebul 15.04.2012

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.
Odpowiedz

  • +
  • -
rash - zdjęcie rash 15.04.2012

A mógłbym poprosić o gotowy kod do kompilacji ponieważ jestem naprawdę zielony w tym i nie za bardzo wiem gdzie zamiast jakiej linii to dodać.
Odpowiedz

  • +
  • -
rash - zdjęcie rash 15.04.2012

To może inaczej mam już prawie gotowy plugin tylko trzeba w nim jeszcze ustawić coś takiego wytłumaczę. Na moim serwerze DeathMatch każdy gra na każdego lecz HP dostaje się jeżeli zabijesz, np. przeciwnika z przeciwnej drużyny czyli jeżeli jesteś w TT i zabijesz kogoś z CT to dostajesz dodatkowe HP a jeżeli zabijesz kogoś z swojego teamu to już nie dostajesz. Chodzi o to, aby dostawać HP za każdego zabitego fraga nie ważne czy to z teamu swojego czy przeciwnego.

#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 ;)
Odpowiedz

  • +
  • -
rash - zdjęcie rash 15.04.2012

Problem rozwiązany dzięki za pomoc ;)
Odpowiedz

  • +
  • -
sebul - zdjęcie sebul 15.04.2012

Wiadomość wygenerowana automatycznie


Ten temat został zamknięty przez moderatora.

Powód: Pomoc udzielona

Jeśli się z tym nie zgadzasz, Dołączona grafika raportuj ten post, a moderator lub administrator rozpatrzy go ponownie.


Z pozdrowieniami,
Zespół AMXX.PL
Odpowiedz
Zablokowany