Skomplikuj sobie i masz.
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <codmod>
#include <hamsandwich>
#include <engine>
#include <ColorChat>
#define DMG_BULLET (1<<1)
new bool:ma_klase[33];
new pozostale_strzaly[33];
new const nazwa[] = "Kapitan [Premium]";
new const opis[] = "Odbija 2 pocistki w rundzie";
new const bronie = 1<<CSW_M4A1 | 1<<CSW_AWP;
new const zdrowie = 30;
new const kondycja = 20;
new const inteligencja = 10;
new const wytrzymalosc = 10;
public plugin_init()
{
register_plugin(nazwa, "1.0", "QTM_Peyote");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
RegisterHam(Ham_Spawn, "player", "Spawn", 1);
}
public cod_class_enabled(id)
{
ColorChat(id, RED, "^x04Klasa^x03 %s^x04 By^x01 KaraTornia.pl", nazwa); //Gdy gracz nie ma flagi wyświetli mu komunikat
if(!(get_user_flags(id) & ADMIN_LEVEL_F)) //FLAGA
{
ColorChat(id, RED, "^x03[%s]^x04 Jest^x03 klasa premium", nazwa) //Znowu info ze przykładowa klasa jest PREMIUM
return COD_STOP;
}
ma_klase[id] = true;
pozostale_strzaly[id] = 2;
return COD_CONTINUE;
}
public cod_class_disabled(id)
ma_klase[id] = false;
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!ma_klase[this])
return HAM_IGNORED;
if(pozostale_strzaly[this] > 0 && damagebits & DMG_BULLET)
{
pozostale_strzaly[this]--;
return HAM_SUPERCEDE;
}
return HAM_IGNORED;
}
public Spawn(id)
pozostale_strzaly[id] = 2;