Abweron:proszę[color=#FF0000]#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <engine>
#include <hamsandwich>
#include <cstrike>
#include <fun>
new const nazwa[] = "Abweron";
new const opis[] = "1/9 szansy na natychmiastowe zabicie z xm1014, ma 2miny.";
new const bronie = (1<<CSW_XM1014)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_ELITE)|(1<<CSW_FLASHBANG);
new const zdrowie = 60;
new const kondycja = 10;
new const inteligencja = 9;
new const wytrzymalosc = 6;
new const modelMiny[] = "models/QTM_CodMod/mine.mdl"[/color]
[color=#FF0000]new sprite_blast_miny;
new ilosc_min_gracza[33];[/color]
[color=#FF0000]new ma_klase[33];[/color]
[color=#FF0000]public plugin_init()
{
register_plugin(nazwa, "1.0", "amxx.pl");[/color]
[color=#FF0000]cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
register_touch("mine", "player", "DotykMiny");[/color]
[color=#FF0000]register_event("HLTV", "NowaRunda_Miny", "a", "1=0", "2=0");[/color]
[color=#FF0000]RegisterHam(Ham_Spawn, "player", "fwSpawn_Miny", 1);[/color]
[color=#FF0000]
RegisterHam(Ham_TakeDamage, "player", "fwTakeDamage_JedenZ");[/color]
[color=#FF0000]}[/color]
[color=#FF0000]public plugin_precache()
{[/color]
[color=#FF0000]precache_model(modelMiny);
sprite_blast_miny = precache_model("sprites/dexplo.spr");[/color]
[color=#FF0000]}[/color]
[color=#FF0000]public client_disconnect(id)
{[/color]
[color=#FF0000]new entMiny = find_ent_by_class(0, "mine");
while(entMiny > 0)
{
if(entity_get_edict(entMiny, EV_ENT_owner) == id)
remove_entity(entMiny);
entMiny = find_ent_by_class(entMiny, "mine");
}[/color]
[color=#FF0000]}[/color]
[color=#FF0000]public cod_class_enabled(id)
{[/color]
[color=#FF0000]ilosc_min_gracza[id] = 2;
give_item(id, "weapon_flashbang");
give_item(id, "weapon_smokegrenade");
ma_klase[id] = true;[/color]
[color=#FF0000]}[/color]
[color=#FF0000]public cod_class_disabled(id)
{
ma_klase[id] = false;[/color]
[color=#FF0000]}[/color]
[color=#FF0000]public cod_class_skill_used(id)
{
if (!ilosc_min_gracza[id])
{
client_print(id, print_center, "Wykorzystales juz wszystkie miny!");
}
else
{[/color]
[color=#FF0000] ilosc_min_gracza[id]--;[/color]
[color=#FF0000] new Float:origin[3];
entity_get_vector(id, EV_VEC_origin, origin);[/color]
[color=#FF0000] new ent = create_entity("info_target");
entity_set_string(ent ,EV_SZ_classname, "mine");
entity_set_edict(ent ,EV_ENT_owner, id);
entity_set_int(ent, EV_INT_movetype, MOVETYPE_TOSS);
entity_set_origin(ent, origin);
entity_set_int(ent, EV_INT_solid, SOLID_BBOX);[/color]
[color=#FF0000] entity_set_model(ent, modelMiny);
entity_set_size(ent,Float:{-16.0,-16.0,0.0},Float:{16.0,16.0,2.0});[/color]
[color=#FF0000] drop_to_floor(ent);[/color]
[color=#FF0000] set_rendering(ent,kRenderFxNone, 0,0,0, kRenderTransTexture,50);
}
}[/color]
[color=#FF0000]public fwSpawn_Miny(id)
{
if(is_user_alive(id))
ilosc_min_gracza[id] = 2;
}[/color]
[color=#FF0000]public DotykMiny(ent, id)
{
if(!is_valid_ent(ent))
return;[/color]
[color=#FF0000]new attacker = entity_get_edict(ent, EV_ENT_owner);
if (get_user_team(attacker) != get_user_team(id))
{
new Float:fOrigin[3];
entity_get_vector( ent, EV_VEC_origin, fOrigin);[/color]
[color=#FF0000] new iOrigin[3];
for(new i=0;i<3;i++)
iOrigin[i] = floatround(fOrigin[i]);[/color]
[color=#FF0000] message_begin(MSG_BROADCAST,SVC_TEMPENTITY, iOrigin);
write_byte(TE_EXPLOSION);
write_coord(iOrigin[0]);
write_coord(iOrigin[1]);
write_coord(iOrigin[2]);
write_short(sprite_blast_miny);
write_byte(32);
write_byte(20);
write_byte(0);
message_end();[/color]
[color=#FF0000] new entlist[33];
new numfound = find_sphere_class(ent,"player", 90.0 ,entlist, 32);[/color]
[color=#FF0000] for (new i=0; i < numfound; i++)
{
new pid = entlist[i];[/color]
[color=#FF0000] if (!is_user_alive(pid) || get_user_team(attacker) == get_user_team(pid))
continue;[/color]
[color=#FF0000] cod_inflict_damage(attacker, pid, 70.0, 0.8, ent, (1<<24));
}
remove_entity(ent);
}
}[/color]
[color=#FF0000]public NowaRunda_Miny()
{
new entMiny = find_ent_by_class(-1, "mine");
while(entMiny > 0)
{
remove_entity(entMiny);
entMiny = find_ent_by_class(entMiny, "mine");
}
}[/color]
[color=#FF0000]public fwTakeDamage_JedenZ(this, idInf, idAtt, Float:fDmg, dmgBits){
if(!is_user_alive(idAtt) || !ma_klase[idAtt] || !(dmgBits & (1<<1) ) || random_num(1, 9) != 1 )
return HAM_IGNORED;[/color]
[color=#FF0000]cs_set_user_armor(this, 0, CS_ARMOR_NONE);
SetHamParamFloat(4, float(get_user_health(this) + 1));[/color]
[color=#FF0000]return HAM_HANDLED;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1250\\ deff0\\ deflang1045{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/[/color]