←  Dyskusje/Pomysły/Pytania

AMXX.pl: Support AMX Mod X i SourceMod

»

Zombie Plague 4.3
Zombie na flage

Blood Angel - zdjęcie Blood Angel 08.04.2012

Witam

Chciałbym zrobić Zombie dla VIP'a. Oto kod klasy. Klasa na ADMIN_LEVEL_H. Chciałbym zapytać czy jest to dobrze wykonane.

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <zombieplague>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN "Klass ZM"
#define VERSION "1.0"
#define AUTHOR "SzCzyPioR"

new bool: niszczyciel[33]

/*------------------------------------
-*- [ZPA] Klasa zombie dla V.I.P -*-
-*- by SzCzyPioR -*-
-------------------------------------*/

public plugin_init()
{
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
register_event("HLTV", "event_new_round", "a", "1=0", "2=0")
}

// Niszczyciel Zombie Attributes
new const zclass3_name[] = { "Niszczyciel Zombie" }
new const zclass3_info[] = { "Klasa V.I.P" }
new const zclass3_model[] = { "zombie_source" }
new const zclass3_clawmodel[] = { "v_knife_zombie.mdl" }
const zclass3_health = 5100
const zclass3_speed = 340
const Float:zclass3_gravity = 0.9
const Float:zclass3_knockback = 0.5
const zclass3_infecthp = 2900 // extra hp za infekcje

// Class IDs
new g_zclass_niszczyciel


// Zombie Classes MUST be registered on plugin_precache
public plugin_precache()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

g_zclass_niszczyciel = zp_register_zombie_class(zclass3_name, zclass3_info, zclass3_model, zclass3_clawmodel, zclass3_health, zclass3_speed, zclass3_gravity, zclass3_knockback)
}

public client_connect(id)
{
niszczyciel[id] = false
}

public client_disconnect(id)
{
niszczyciel[id] = false
}

public event_new_round(id)
{
niszczyciel[id] = false
}

public zp_user_infected_post(id, infector)
{
if (zp_get_user_zombie_class(infector) == g_zclass_niszczyciel)
set_pev(infector, pev_health, float(pev(infector, pev_health) + zclass3_infecthp))

if (zp_get_user_zombie_class(id) == g_zclass_niszczyciel || get_user_flags(id) & ADMIN_LEVEL_H)
{
niszczyciel[id] = true
}
}

public fw_TakeDamage(dead, inflictor, attacker, Float:damage, damagetype)
{
new clip, ammo
new bron=get_user_weapon(attacker,clip,ammo)
if(damagetype & DMG_BULLET && attacker!=dead) {
if ( is_user_alive( attacker ) && bron == CSW_KNIFE && niszczyciel[attacker] && zp_get_user_zombie_class(attacker) == g_zclass_niszczyciel && zp_get_user_zombie(attacker) )
{
SetHamParamFloat(4, damage * 2.0 )
return HAM_HANDLED;
}
}
return HAM_HANDLED;
}


Użytkownik Blood Angel edytował ten post 08.04.2012 21:14
Odpowiedz