ja napisałem coś takiego, niby się kompiluje, ale nie jestem pewien poprawności, wypróbuj to
chyba, że ktoś inny, kto się zna, da lepsze
#include <amxmodx>
#include <fun>
#include <hamsandwich>
#include <codmod>
#include <colorchat>
#define DMG_BULLET (1<<1)
#define CZAS_BERSERKER 5 //SEKUND
new const nazwa[] = "Berserker";
new const opis[] = "Ma 5 sekund trybu Berserker (2xdmg i +1000HP) co runde";
new const bronie = 1<<CSW_P90 | 1<<CSW_GLOCK18;
new const zdrowie = 0;
new const kondycja = 0;
new const inteligencja = 0;
new const wytrzymalosc = 10;
new bool:wykorzystal[33];
new bool:ma_klase[33];
new bool:on[33];
new msg_bartime;
public plugin_init()
{
register_plugin(nazwa, "1.0", "QTM_Peyote");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
register_event("ResetHUD", "ResetHUD", "abe");
msg_bartime = get_user_msgid("BarTime");
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
}
public cod_class_enabled(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 tryb Berserker.");
return;
}
wykorzystal[id] = true;
cod_set_user_bonus_health(id, cod_get_user_health(id, 0, 0)+1000);
set_user_health(id, get_user_health(id)+1000);
set_user_rendering(id, kRenderFxGlowShell, 120, 0, 255);
set_task(CZAS_BERSERKER.0, "WylaczBerserker", id);
message_begin(MSG_ONE, msg_bartime, _, id)
write_short(CZAS_BERSERKER)
message_end()
on[id] = true;
}
public WylaczBerserker(id)
{
if(!is_user_connected(id)) return;
cod_set_user_bonus_health(id, cod_get_user_health(id, 0, 0)-1000);
set_user_health(id, max(1, get_user_health(id)+1000));
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0);
on[id] = false;
}
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 && on[idattacker] && task_exists (CZAS_BERSERKER,0))
cod_inflict_damage(idattacker, this, damage*2.0, 0.0, idinflictor, damagebits);
return HAM_IGNORED;
}
public ResetHUD(id)
wykorzystal[id] = false;daj plusa jeśli pomogłem
Dodano 01 lipiec 2011 - 19:18:
warna dać nowemu użytkownikowi za pierdółkę łatwo, szkoda, że czytając ten temat sam nie pomogłeś w problemie, bo naprawdę jest dość niespotykany


Dodatki SourceMod




Moja zawartość
Mężczyzna

