Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

RSS[Request] No healing when hit a teammate


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
Hi, I have this Vampire Zombie class which should heal when it hits an enemy, but it also heal when it hits an ally.
Can someone modify it so it wont heal if u hit an ally ?

Code:

#include <amxmodx>
#include <fakemeta>
#include <basebuilder>
#include <hamsandwich>
#include <fun>
#include <xs>

// Plugin stuff
new const PLUGIN[] = "[ZP] Zombie Class: Vampire Zombie"
new const VERSION[] = "1.0"
new const AUTHOR[] = "NiHiLaNTh"

// Zombie parametres
new const zclass5_name[] = { "Vampire Zombie" } // name
new const zclass5_info[] = { "\r[\wV.I.P\r]" } // description
new const zclass5_model[] = { "baseb_SnowMan" } // player model
new const zclass5_clawmodel[] = { "v_candycane_snowman_bb" } // claw model
const zclass5_health = 1500 // health
const zclass5_speed = 220 // speed
const Float:zclass5_gravity = 0.7 // gravity
const zclass5_admin = ADMIN_LEVEL_H
const zclass5_credits = 0

// Class ID
new g_zclass_vampire;

// CVAR pointers
new pcv_multi;

// Zombie classes must be registered on plugin precache
public plugin_precache()
{
        g_zclass_vampire = bb_register_zombie_class(zclass5_name, zclass5_info, zclass5_model, zclass5_clawmodel, zclass5_health, zclass5_speed, zclass5_gravity, 0.0, zclass5_admin, zclass5_credits);
}

// Plugin initialization
public plugin_init()
{
        // Register our plugin
        register_plugin(PLUGIN, VERSION, AUTHOR)
       
        // Forward
        RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
       
        // CVAR
        pcv_multi = register_cvar("zp_vampire_multi", "2") // additional health multiplier
}

// Target has been injected...
public zp_user_infected_post(id, infector, nemesis)
{
        // Our zm class
        if (zp_get_user_zombie_class(id) == g_zclass_vampire)
        {
                client_print(id, print_chat, "[ZP] Damage or infect someone to get additional health.");
                VampireInit(id);
        }
       
        // Vampire zombie cannot damage anyone on Single/Multi infection rounds so...
        if (zp_get_user_zombie_class(infector) == g_zclass_vampire)
        {
                set_pev(infector, pev_health, float(pev(infector, pev_health) + 1000))
        }
}

// Victim took damage from entity
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
        // Not alive
        if (!is_user_alive(victim))
                return;
               
        if (!zp_get_user_zombie(attacker))
                return;
       
        if (zp_get_user_zombie_class(attacker) == g_zclass_vampire)
        {
                // Calculate additional health
                static ExtraHealth;
                ExtraHealth = floatround(damage * get_pcvar_num(pcv_multi))
               
                // Set new health
                set_pev(attacker, pev_health, float(pev(attacker, pev_health) + ExtraHealth))
        }
}               

// Vampire zombie was born...
public VampireInit(id)
{
        // Not alive
        if (!is_user_alive(id))
                return PLUGIN_CONTINUE;
       
        // Not our zombie class
        if (zp_get_user_zombie_class(id) != g_zclass_vampire)
                return PLUGIN_CONTINUE;
       
        return PLUGIN_CONTINUE;
}

Przeczytaj cały wpis

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...