Witam
Prosił bym o zablokowanie tej klasie korzystania z wszystkich broni oprócz noża
#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <fakemeta>
#include <fun>
#include <hamsandwich>
#define DMG_BULLET (1<<1)
new const nazwa[] = "Mistrz ostrza [Premium]";
new const opis[] = "300 dmg z noża, szybki, bh";
new const bronie = 0;
new const zdrowie = 10;
new const kondycja = 100;
new const inteligencja = 0;
new const wytrzymalosc = 0;
new Float:redukcja_obrazen_gracza[33];
new ma_klase[33];
public plugin_init()
{
register_plugin(nazwa, "1.0", "amxx.pl");
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
register_forward(FM_PlayerPreThink, "fwPrethink_AutoBH");
RegisterHam(Ham_TakeDamage, "player", "SzansaNaHeadshot_TakeDamage");
RegisterHam(Ham_TakeDamage, "player", "TakeDamage_wytrzymalosc");
}
public cod_class_enabled(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL_G))
{
client_print(id, print_chat, "[Premium]To jest klasa premium.")
return COD_STOP;
}
ma_klase[id] = true;
return COD_CONTINUE;
}
public cod_class_disabled(id)
{
ma_klase[id] = false;
}
public fwPrethink_AutoBH(id)
{
if(!ma_klase[id])
return PLUGIN_CONTINUE
if (pev(id, pev_button) & IN_JUMP) {
new flags = pev(id, pev_flags)
if (flags & FL_WATERJUMP)
return FMRES_IGNORED;
if ( pev(id, pev_waterlevel) >= 2 )
return FMRES_IGNORED;
if ( !(flags & FL_ONGROUND) )
return FMRES_IGNORED;
new Float:velocity[3];
pev(id, pev_velocity, velocity);
velocity[2] += 250.0;
set_pev(id, pev_velocity, velocity);
set_pev(id, pev_gaitsequence, 6);
}
return FMRES_IGNORED;
}
public SzansaNaHeadshot_TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_alive(idattacker) || !ma_klase[idattacker])
return HAM_IGNORED;
if(get_user_hitzones(idattacker, this) != 2 && !random(1))
{
set_user_hitzones(idattacker, this, 2);
}
return HAM_IGNORED;
}
public TakeDamage_wytrzymalosc(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;
if(!ma_klase[idattacker])
return HAM_IGNORED;
if(!cod_get_user_stamina(this))
return HAM_IGNORED;
redukcja_obrazen_gracza[this] = 0.7*(1.0-floatpower(1.1, -0.112311341*cod_get_user_stamina(this)));
SetHamParamFloat(4, damage/(1.0-redukcja_obrazen_gracza[this]))
return HAM_IGNORED;
}
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;
if(!ma_klase[idattacker])
return HAM_IGNORED;
if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_KNIFE && damagebits & DMG_BULLET)
cod_inflict_damage(idattacker, this, 300.0, 0.0, idinflictor, damagebits);
return HAM_IGNORED;
}


Dodatki SourceMod




codclass_mistrzostrza_p.amxx











