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


  • Zamknięty Temat jest zamknięty
2 odpowiedzi w tym temacie

#1 Fret

    Życzliwy

  • Użytkownik

Reputacja: 0
Nowy

  • Postów:32
Offline

Napisano 26.12.2008 20:16

Witam. Otóż mam plugin Vampire

/*
*   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 gmsgScreenFade, g_maxplayers

public plugin_init() {
    register_plugin("Vampire", PLUGIN_VERSION, "Shalfey")

    health_add = register_cvar("amx_vampire_hp", "10")
    health_hs_add = register_cvar("amx_vampire_hp_hs", "50")
    health_max = register_cvar("amx_vampire_max_hp", "255")

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

I teraz mym pytanie:

Czy ktoś mógł by mi ten plugin przerobić tak,aby po zabiciu swojego także dodawało hp, po zwyklym killu 10 HP po hsie 50. Był bym bardzo wdzięczny.
  • +
  • -
  • 0

#2 R3X

    Godlike

  • Przyjaciel

Reputacja: 2 987
Godlike

  • Postów:4 248
  • Lokalizacja:Nie
Offline

Napisano 26.12.2008 20:28

/*

*   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 gmsgScreenFade, g_maxplayers



public plugin_init() {

    register_plugin("Vampire", PLUGIN_VERSION, "Shalfey")



    health_add = register_cvar("amx_vampire_hp", "10")

    health_hs_add = register_cvar("amx_vampire_hp_hs", "50")

    health_max = register_cvar("amx_vampire_max_hp", "255")



    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)

        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()

}

  • +
  • -
  • 0

#3 Fret

    Życzliwy

  • Autor tematu
  • Użytkownik

Reputacja: 0
Nowy

  • Postów:32
Offline

Napisano 26.12.2008 20:40

Teraz działa idealnie :) Wielkie dzięki. Można zamknąć.
  • +
  • -
  • 0




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

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