Spoiler
#include <amxmodx>
#include <engine>
#include <hamsandwich>
#include <codmod>
#include <colorchat>
new bool:ma_klase[33];
new const nazwa[] = "Cs-Apple (Super Premium)";
new const opis[] = "Ma Awp 1/2 Deagle 1/3 i M4 1/6";
new const bronie = 1<<CSW_AWP | 1<<CSW_DEAGLE | 1<<CSW_M4A1;
new const zdrowie = 20;
new const kondycja = 69;
new const inteligencja = 2;
new const wytrzymalosc = 50;
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");
}
public cod_class_enabled(id)
{
ColorChat(id, RED, "^x04Klasa^x03 %s^x04 By^x01 amxx.pl", nazwa); //Gdy gracz nie ma flagi wyświetli mu komunikat
if(!(get_user_flags(id) & ADMIN_LEVEL_H)) //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;
return COD_CONTINUE;
}
public cod_class_disabled(id)
ma_klase[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)
{
new weapon = get_user_weapon(idattacker);
if(weapon == CSW_DEAGLE && damage > 20.0 && random_num(1,3) == 1)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
if(weapon == CSW_AWP && damage > 20.0 && random_num(1,2) == 1)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
if(weapon == CSW_M4A1 && damage > 20.0 && random_num(1,6) == 1)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
if(get_user_weapon(idattacker) == CSW_KNIFE && damagebits & DMG_BULLET && damage > 20.0)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
}
return HAM_IGNORED;
}
#include <engine>
#include <hamsandwich>
#include <codmod>
#include <colorchat>
new bool:ma_klase[33];
new const nazwa[] = "Cs-Apple (Super Premium)";
new const opis[] = "Ma Awp 1/2 Deagle 1/3 i M4 1/6";
new const bronie = 1<<CSW_AWP | 1<<CSW_DEAGLE | 1<<CSW_M4A1;
new const zdrowie = 20;
new const kondycja = 69;
new const inteligencja = 2;
new const wytrzymalosc = 50;
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");
}
public cod_class_enabled(id)
{
ColorChat(id, RED, "^x04Klasa^x03 %s^x04 By^x01 amxx.pl", nazwa); //Gdy gracz nie ma flagi wyświetli mu komunikat
if(!(get_user_flags(id) & ADMIN_LEVEL_H)) //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;
return COD_CONTINUE;
}
public cod_class_disabled(id)
ma_klase[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)
{
new weapon = get_user_weapon(idattacker);
if(weapon == CSW_DEAGLE && damage > 20.0 && random_num(1,3) == 1)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
if(weapon == CSW_AWP && damage > 20.0 && random_num(1,2) == 1)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
if(weapon == CSW_M4A1 && damage > 20.0 && random_num(1,6) == 1)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
if(get_user_weapon(idattacker) == CSW_KNIFE && damagebits & DMG_BULLET && damage > 20.0)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
}
return HAM_IGNORED;
}
Sorry, że tak spamie na forum postami ale to już mój puki co ostatni bo już wszysto wiem
Siemson pytanie dobrze zrobiona klasa ?? wiem trochę przesadzona no ale cóż
Robiłem ją w Amxx studio
Z góry dzięki
Użytkownik applesik edytował ten post 17.07.2011 09:34