#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <fakemeta>
#include <fun>
#include <ColorChat>
#include <engine>
#include <dhudmessage>
#include <hamsandwich>
#define DMG_BULLET (1<<1)
#define CZAS_GODMOD 10 //ILE SEKUND MA TRWAC NIEWIDZIALNOSC
new const nazwa[] = "Wampir";
new const opis[] = "Wysysa hp dodajac je sobie, MultiJump, 10 sekund niewidnki(klawisz e), 400 dmg z AK47.";
new const bronie = (1<<CSW_FLASHBANG)|(1<<CSW_DEAGLE)|(1<<CSW_AK47);
new const zdrowie = 0;
new const kondycja = 0;
new const inteligencja = 0;
new const wytrzymalosc = 0;
new skoki[33];
new bool:wykorzystal[33];
new bool:ma_klase[33];
new msg_bartime;
public plugin_init()
{
register_plugin(nazwa, "1.0", "amxx.pl");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
register_forward(FM_CmdStart, "fwCmdStart_MultiJump");
register_event("Damage", "Damage", "b", "2!=0");
msg_bartime = get_user_msgid("BarTime");
register_event("ResetHUD", "ResetHUD", "abe");
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
}
public cod_class_enabled(id)
{
give_item(id, "weapon_flashbang");
ma_klase[id] = true;
ResetHUD(id);
}
public cod_class_disabled(id)
{
ma_klase[id] = false;
}
public cod_class_skill_used(id)
{
if(!is_user_alive(id))
return;
if(wykorzystal[id])
{
ColorChat(id, RED, "Wykorzystales juz swoja niewidzialnosc.");
return;
}
wykorzystal[id] = true;
set_dhudmessage(0, 255, 0, -1.0, 0.65, 2, 6.0, 3.0, 0.1, 1.5, false);
show_dhudmessage(id, "~~Aktywowales moc~~^nMasz 10 sekund^nZjedz przeciwnikow :D!");
set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 1);
set_user_footsteps(id, 1);
set_task(CZAS_GODMOD.0, "WylaczGod", id);
message_begin(MSG_ONE, msg_bartime, _, id)
write_short(CZAS_GODMOD)
message_end()
}
public WylaczGod(id)
{
if(!is_user_connected(id)) return;
set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255);
set_user_footsteps(id, 0);
}
public ResetHUD(id)
{
wykorzystal[id] = false;
}
public fwCmdStart_MultiJump(id, uc_handle)
{
if(!is_user_alive(id) || !ma_klase[id])
return FMRES_IGNORED;
new flags = pev(id, pev_flags);
if((get_uc(uc_handle, UC_Buttons) & IN_JUMP) && !(flags & FL_ONGROUND) && !(pev(id, pev_oldbuttons) & IN_JUMP) && skoki[id])
{
skoki[id]--;
new Float:velocity[3];
pev(id, pev_velocity,velocity);
velocity[2] = random_float(265.0,285.0);
set_pev(id, pev_velocity,velocity);
}
else if(flags & FL_ONGROUND)
skoki[id] = 1;
return FMRES_IGNORED;
}
public Damage(id)
{
new idattacker = get_user_attacker(id);
if(id == idattacker || idattacker == 0)
return;
if(!is_user_alive(idattacker))
return;
if(!ma_klase[idattacker])
return;
new Float:maksymalne_zdrowie = 100.0 + cod_get_user_health(idattacker);
new Float:nowe_zdrowie = 800.0+pev(idattacker, pev_health);
set_pev(idattacker, pev_health, (nowe_zdrowie < maksymalne_zdrowie)? nowe_zdrowie: maksymalne_zdrowie);
}
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(get_user_weapon(idattacker) == CSW_AK47 && damagebits & DMG_BULLET)
cod_inflict_damage(idattacker, this, 400.0, 0.0, idinflictor, damagebits);
}
return HAM_IGNORED;
}
Użytkownik Kozak12 edytował ten post 17.04.2014 10:11


Dodatki SourceMod




wampir.amxx









