Robiłem klasę w generatorze no ale oczywiście musiałem zmienić kod związany z 1/x gdyż ten jest który jest w generatorze jest dziwny i do tego na każdą broń robi.
Więc tak, robię tą klasę...wszystko ładnie jest ale nie można skompilować...
Dlaczego?
Może jest tutaj jakaś zbędna biblioteka czy coś tam.
#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <engine>
#include <hamsandwich>
#include <cstrike>
#include <fun>
#define DMG_BULLET (1<<1)
new bool:ma_klase[33];
new const nazwa[] = "Elite Sniper(Super Premium)";
new const opis[] = "1/1 z awp, 1/5 z elites oraz lekka niewidzalnosc";
new const bronie = (1<<CSW_HEGRENADE)|(1<<CSW_ELITE)|(1<<CSW_AWP);
new const zdrowie = 500;
new const kondycja = 500;
new const inteligencja = 500;
new const wytrzymalosc = 500;
new ma_klase[33];
public plugin_init()
{
register_plugin(nazwa, "1.0", "Jerem");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
}
public cod_class_enabled(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL_G))
{
client_print(id, print_chat, "[Elite Sniper(Super Premium)] Nie masz uprawnien, aby uzywac tej klasy.")
return COD_STOP;
}
set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 70);
give_item(id, "weapon_hegrenade");
ma_klase[id] = true;
return COD_CONTINUE;
}
public cod_class_disabled(id)
{
set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255);
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_AWP) && !random(1))
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
if((weapon == CSW_ELITE) && !random(5))
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
}
return HAM_IGNORED;
}
Użytkownik Jerem96 edytował ten post 31.01.2012 09:50


Dodatki SourceMod













