Skocz do zawartości

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.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

vampire.amxx z osobnym hp dla vipa


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
7 odpowiedzi w tym temacie

#1 prostakiloveyou

    Zaawansowany

  • Użytkownik

Reputacja: 6
Nowy

  • Postów:97
  • Lokalizacja:stejk
Offline

Napisano 19.06.2012 14:36

witam, chcialem przerobic vampire.amxx aby vipowie mieli inne stawki za zabicie kogos

czysty plik sma vampire.amxx w zalaczniku

a tutaj to co probowalem zrobic, ale nie dziala - 8 bledow wywala

/*
*   http://games.qwerty.ru
*
* AmxModX
*   Vampire plugin
*    by Shalfey
*
*   CVars
*   amx_vampire_hp - hp add for kill
*   amx_vampire_hp_hs - hp add for kill in head
*   amx_vampire_max_hp - max player hp
*
*   Players gets HP for kills.
*/
#include <amxmodx>
#include <fun>
new const PLUGIN_VERSION[] = "1.0d"
new health_add
new health_hs_add
new health_max
new health_add_vip
new health_hs_add_vip
new health_max_vip
new gmsgScreenFade, 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", "40")
health_max = register_cvar("amx_vampire_max_hp", "100")
health_add_vip = register_cvar("amx_vampire_hp_vip", "15")
health_hs_add_vip = register_cvar("amx_vampire_hp_hs_vip", "40")
health_max_vip = register_cvar("amx_vampire_max_hp_vip", "100")

register_event("DeathMsg", "eDeathMsg", "a") 
gmsgScreenFade = get_user_msgid("ScreenFade")
g_maxplayers = get_maxplayers()
}
public eDeathMsg(player) {

  if(get_user_flags(player) & ADMIN_LEVEL_H)
							    {
   
	 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_vip) :
	 get_pcvar_num(health_add_vip) ) +
	 KillerHealth ,
	 get_pcvar_num(health_max_vip)   )
	
	  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()

   } else {
   
   
	 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()
   }

}

czy pomoze mi ktos poprawic? cvary dodalem sobie

Załączone pliki


  • +
  • -
  • 0

#2 prostakiloveyou

    Zaawansowany

  • Autor tematu
  • Użytkownik

Reputacja: 6
Nowy

  • Postów:97
  • Lokalizacja:stejk
Offline

Napisano 21.06.2012 20:26

refresh
  • +
  • -
  • 0

#3 prostakiloveyou

    Zaawansowany

  • Autor tematu
  • Użytkownik

Reputacja: 6
Nowy

  • Postów:97
  • Lokalizacja:stejk
Offline

Napisano 28.06.2012 00:45

reefresh
  • +
  • -
  • 0

#4 Gość_21977_*

  • Gość

Reputacja: 0

Offline

Napisano 28.06.2012 16:07

Usunąłem reklamę, zastosowałem zasadę DRY i zamieniłem min na max:

Załączony plik  Untitled.sma   2,06 KB  9 Ilość pobrań
  Untitled.amxx

#5 prostakiloveyou

    Zaawansowany

  • Autor tematu
  • Użytkownik

Reputacja: 6
Nowy

  • Postów:97
  • Lokalizacja:stejk
Offline

Napisano 29.06.2012 09:55

cos zle jest, bo na poczatek nie daje 120 vipowi, dopiero jak zabije kogos i czesto dodaje do pelna, tzn. ktos ma 40 hp, zabije kogos i juz ma 120 hp
  • +
  • -
  • 0

#6 prostakiloveyou

    Zaawansowany

  • Autor tematu
  • Użytkownik

Reputacja: 6
Nowy

  • Postów:97
  • Lokalizacja:stejk
Offline

Napisano 30.06.2012 21:50

okazuje sie ze kazdemu niezaleznie od posiadania vipa skacze im do 140 hp
  • +
  • -
  • 0

#7 Gość_21977_*

  • Gość

Reputacja: 0

Offline

Napisano 30.06.2012 23:08

a cvary jak masz ustawione?

#8 prostakiloveyou

    Zaawansowany

  • Autor tematu
  • Użytkownik

Reputacja: 6
Nowy

  • Postów:97
  • Lokalizacja:stejk
Offline

Napisano 01.07.2012 18:04

amx_vampire_hp 5 // ilość HP za zwykłe zabicie

amx_vampire_hp_hs 10 // ilość HP za zabicie HeadShotem

amx_vampire_max_hp 100 // maksymalna ilość HP gracza



//amx_vampire_hp_vip 10 // ilość HP za zwykłe zabicie

//amx_vampire_hp_hs_vip 20 // ilość HP za zabicie HeadShotem

//amx_vampire_max_hp_vip 120 // maksymalna ilość HP gracza
na razie zakomentowalem dla vipa idalem podstawowy vampire.amxx zeby chociaz normlanie graczom dodawalo..
  • +
  • -
  • 0




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych