Ja tutaj widzę 3klasy nie 5:D
SztukMistrz[Premium]
Spoiler
#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <engine>
#include <fakemeta>
#include <fun>
#include <hamsandwich>
#define DMG_BULLET (1<<1)
new const nazwa[] = "SztukMistrz[Premium]";
new const opis[] = "+40DMG z AK47/1/4 z Deagle/Ciche Kroki/Niewidka 70/255/40HP za Fraga";
new const bronie = (1<<CSW_DEAGLE)|(1<<CSW_AK47);
new const zdrowie = 50;
new const kondycja = 0;
new const inteligencja = 40;
new const wytrzymalosc = 100;
new ma_klase[33];
public plugin_init()
{
register_plugin(nazwa, "1.0", "Z!3L0ny");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
register_event("DeathMsg", "DeathMsg", "ade");
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
RegisterHam(Ham_TakeDamage, "player", "TakeDamage2");
}
public cod_class_enabled(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL_G))
{
client_print(id, print_chat, "[SztukMistrz[Premium]] Nie masz uprawnien, aby uzywac tej klasy.")
return COD_STOP;
}
set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 70);
set_user_footsteps(id, 1);
ma_klase[id] = true;
return COD_CONTINUE;
}
public cod_class_disabled(id)
{
set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255);
set_user_footsteps(id, 0);
ma_klase[id] = false;
}
public DeathMsg()
{
new killer = read_data(1);
new victim = read_data(2);
if(!is_user_connected(killer))
return PLUGIN_CONTINUE;
if(ma_klase[victim] && !ma_klase[killer])
cod_set_user_xp(killer, cod_get_user_xp(killer)+10);
if(ma_klase[killer])
{
new cur_health = pev(killer, pev_health);
new Float:max_health = 100.0+cod_get_user_health(killer);
new Float:new_health = cur_health+40.0<max_health? cur_health+40.0: max_health;
set_pev(killer, pev_health, new_health);
}
return PLUGIN_CONTINUE;
}
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;
if(!ma_klase[idattacker])
return HAM_IGNORED;
if(damagebits & DMG_BULLET)
{
new weapon = get_user_weapon(idattacker);
if(weapon == CSW_AK47)
cod_inflict_damage(idattacker, this, 40.0, 0.0, idinflictor, damagebits);
}
return HAM_IGNORED;
}
public TakeDamage2(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;
if(!ma_klase[idattacker])
return HAM_IGNORED;
if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_DEAGLE && damagebits & DMG_BULLET && random_num(1, 4) == 1)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
return HAM_IGNORED;
}