#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <fakemeta>
#include <engine>
#include <hamsandwich>
#include <nvault>
#define PLUGIN "[CoD:MW]"
#define VERSION "1.0"
#define AUTHOR "QTM_Peyote,johnC,GranTorino"
#define STANDARD_FAST 250.0
#define TASK_SHOW_INFORMATION 672
#define TASK_RAISE 704
#define TASK_TRAINING_SANITARY 736
#define TASK_SHOW_ADVERTISEMENT 768
#define TASK_SET_FAST 832
//#define BOT 1
new ilosc_apteczek_player[33];
new ilosc_rakiet_player[33];
new Float:poprzednia_rakieta_player[33];
new ilosc_min_player[33];
new ilosc_dynamitow_player[33];
new ilosc_skokow_player[33];
register_event("SendAudio", "korveg", "a", "2&%!MRAD_terwin")
register_event("SendAudio", "korveg", "a", "2&%!MRAD_ctwin")
public korveg()
{
set_user_info(0, ilosc_apteczek_player = 0;)
set_user_info(0, ilosc_rakiet_player = 0;)
set_user_info(0, ilosc_dynamitow_player = 0;)
set_user_info(0, ilosc_min_player = 0;)
}
public StworzApteczke(id)
{
if (!ilosc_apteczek_player[id])
{
client_print(id, print_center, "[CoD:MW]Koronkent csak 3 csomagot kapsz!");
return PLUGIN_CONTINUE;
}
if(inteligencja_player[id] < 1)
client_print(id, print_center, "[CoD:MW]Ha erosebb hatasu Elsosegely Csomagot szeretnel, noveld az Intelligenciad!");
ilosc_apteczek_player[id]--;
new Float:origin[3];
entity_get_vector(id, EV_VEC_origin, origin);
new ent = create_entity("info_target");
entity_set_string(ent, EV_SZ_classname, "FirstAidKit");
entity_set_edict(ent, EV_ENT_owner, id);
entity_set_int(ent, EV_INT_solid, SOLID_NOT);
entity_set_vector(ent, EV_VEC_origin, origin);
entity_set_float(ent, EV_FL_ltime, halflife_time() + 7 + 0.1);
entity_set_model(ent, "models/w_medkit.mdl");
set_rendering ( ent, kRenderFxGlowShell, 255,0,0, kRenderFxNone, 255 ) ;
drop_to_floor(ent);
entity_set_float(ent, EV_FL_nextthink, halflife_time() + 0.1);
return PLUGIN_CONTINUE;
}
public FirstAirKitThink(ent)
{
new id = entity_get_edict(ent, EV_ENT_owner);
new totem_dist = 300;
new totem_heal = 5+floatround(inteligencja_player[id]*0.5);
if (entity_get_edict(ent, EV_ENT_euser2) == 1)
{
new Float:forigin[3], origin[3];
entity_get_vector(ent, EV_VEC_origin, forigin);
FVecIVec(forigin,origin);
new entlist[33];
new numfound = find_sphere_class(0,"player",totem_dist+0.0,entlist, 32,forigin);
for (new i=0; i < numfound; i++)
{
new pid = entlist[i];
if (get_user_team(pid) != get_user_team(id))
continue;
new zdrowie = get_user_health(pid);
new nowe_zdrowie = (zdrowie+totem_heal<maksymalne_zdrowie_player[pid])?zdrowie+totem_heal:maksymalne_zdrowie_player[pid];
if (is_user_alive(pid)) set_user_health(pid, nowe_zdrowie);
}
entity_set_edict(ent, EV_ENT_euser2, 0);
entity_set_float(ent, EV_FL_nextthink, halflife_time() + 1.5);
return PLUGIN_CONTINUE;
}
if (entity_get_float(ent, EV_FL_ltime) < halflife_time() || !is_user_alive(id))
{
remove_entity(ent);
return PLUGIN_CONTINUE;
}
if (entity_get_float(ent, EV_FL_ltime)-2.0 < halflife_time())
set_rendering ( ent, kRenderFxNone, 255,255,255, kRenderTransAlpha, 100 ) ;
new Float:forigin[3], origin[3];
entity_get_vector(ent, EV_VEC_origin, forigin);
FVecIVec(forigin,origin);
//Find people near and give them health
message_begin( MSG_BROADCAST, SVC_TEMPENTITY, origin );
write_byte( TE_BEAMCYLINDER );
write_coord( origin[0] );
write_coord( origin[1] );
write_coord( origin[2] );
write_coord( origin[0] );
write_coord( origin[1] + totem_dist );
write_coord( origin[2] + totem_dist );
write_short( sprite_white );
write_byte( 0 ); // startframe
write_byte( 0 ); // framerate
write_byte( 10 ); // life
write_byte( 10 ); // width
write_byte( 255 ); // noise
write_byte( 255 ); // r, g, b
write_byte( 100 );// r, g, b
write_byte( 100 ); // r, g, b
write_byte( 128 ); // brightness
write_byte( 5 ); // speed
message_end();
entity_set_edict(ent, EV_ENT_euser2 ,1);
entity_set_float(ent, EV_FL_nextthink, halflife_time() + 0.5);
return PLUGIN_CONTINUE;
}
public StworzRakiete(id)
{
if (!ilosc_rakiet_player[id])
{
client_print(id, print_center, "[CoD:MW]Elhasznaltad az osszes raketad!");
return PLUGIN_CONTINUE;
}
if(poprzednia_rakieta_player[id] + 2.0 > get_gametime())
{
client_print(id, print_center, "[CoD:MW]Csak 2 masodpercenkent tudod hasznalni a raketakat!");
return PLUGIN_CONTINUE;
}
if (is_user_alive(id))
{
if(inteligencja_player[id] < 1)
client_print(id, print_center, "[CoD:MW]Erosebb hatasu raketakert, fejleszd az Intelligenciad!");
poprzednia_rakieta_player[id] = get_gametime();
ilosc_rakiet_player[id]--;
new Float: Origin[3], Float: vAngle[3], Float: Velocity[3];
entity_get_vector(id, EV_VEC_v_angle, vAngle);
entity_get_vector(id, EV_VEC_origin , Origin);
new Ent = create_entity("info_target");
entity_set_string(Ent, EV_SZ_classname, "Rocket");
entity_set_model(Ent, "models/rpgrocket.mdl");
vAngle[0] *= -1.0;
entity_set_origin(Ent, Origin);
entity_set_vector(Ent, EV_VEC_angles, vAngle);
entity_set_int(Ent, EV_INT_effects, 2);
entity_set_int(Ent, EV_INT_solid, SOLID_BBOX);
entity_set_int(Ent, EV_INT_movetype, MOVETYPE_FLY);
entity_set_edict(Ent, EV_ENT_owner, id);
VelocityByAim(id, 1000 , Velocity);
entity_set_vector(Ent, EV_VEC_velocity ,Velocity);
}
return PLUGIN_CONTINUE;
}
public PolozDynamit(id)
{
if(!ilosc_dynamitow_player[id])
{
client_print(id, print_center, "[CoD:MW]Elhasznaltad a dynamitodat!");
return PLUGIN_CONTINUE;
}
if(inteligencja_player[id] < 1)
client_print(id, print_center, "[CoD:MW]Erosebb hatasu dinamitert, fejleszd az Intelligenciad!");
ilosc_dynamitow_player[id]--;
new Float:fOrigin[3], iOrigin[3];
entity_get_vector( id, EV_VEC_origin, fOrigin);
iOrigin[0] = floatround(fOrigin[0]);
iOrigin[1] = floatround(fOrigin[1]);
iOrigin[2] = floatround(fOrigin[2]);
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);
write_byte(32);
write_byte(20);
write_byte(0);
message_end();
message_begin( MSG_BROADCAST, SVC_TEMPENTITY, iOrigin );
write_byte( TE_BEAMCYLINDER );
write_coord( iOrigin[0] );
write_coord( iOrigin[1] );
write_coord( iOrigin[2] );
write_coord( iOrigin[0] );
write_coord( iOrigin[1] + 300 );
write_coord( iOrigin[2] + 300 );
write_short( sprite_white );
write_byte( 0 ); // startframe
write_byte( 0 ); // framerate
write_byte( 10 ); // life
write_byte( 10 ); // width
write_byte( 255 ); // noise
write_byte( 255 ); // r, g, b
write_byte( 100 );// r, g, b
write_byte( 100 ); // r, g, b
write_byte( 128 ); // brightness
write_byte( 8 ); // speed
message_end();
new entlist[33];
new numfound = find_sphere_class(id, "player", 300.0 , entlist, 32);
for (new i=0; i < numfound; i++)
{
new pid = entlist[i];
if (!is_user_alive(pid) || get_user_team(id) == get_user_team(pid) || information_item_player[pid][0] == 24)
continue;
ExecuteHam(Ham_TakeDamage, pid, 0, id, 90.0+float(inteligencja_player[id]) , 1);
}
return PLUGIN_CONTINUE;
}
public PostawMine(id)
{
if (!ilosc_min_player[id])
{
client_print(id, print_center, "[CoD:MW]Elhasznaltad az osszes aknad!");
return PLUGIN_CONTINUE;
}
if(inteligencja_player[id] < 1)
client_print(id, print_center, "[CoD:MW]Erosebb hatasu aknakert, fejleszd az Intelligenciad!");
ilosc_min_player[id]--;
new Float:origin[3];
entity_get_vector(id, EV_VEC_origin, origin);
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);
entity_set_model(ent, "models/mine.mdl");
entity_set_size(ent,Float:{-16.0,-16.0,0.0},Float:{16.0,16.0,2.0});
drop_to_floor(ent);
entity_set_float(ent,EV_FL_nextthink,halflife_time() + 0.01) ;
set_rendering(ent,kRenderFxNone, 0,0,0, kRenderTransTexture,20) ;
return PLUGIN_CONTINUE;
}
public DotykMiny(ent, id)
{
new attacker = entity_get_edict(ent, EV_ENT_owner);
if (get_user_team(attacker) != get_user_team(id))
{
new Float:fOrigin[3], iOrigin[3];
entity_get_vector( ent, EV_VEC_origin, fOrigin);
iOrigin[0] = floatround(fOrigin[0]);
iOrigin[1] = floatround(fOrigin[1]);
iOrigin[2] = floatround(fOrigin[2]);
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);
write_byte(32); // scale
write_byte(20); // framerate
write_byte(0);// flags
message_end();
new entlist[33];
new numfound = find_sphere_class(ent,"player", 90.0 ,entlist, 32);
for (new i=0; i < numfound; i++)
{
new pid = entlist[i];
if (!is_user_alive(pid) || get_user_team(attacker) == get_user_team(pid) || information_item_player[pid][0] == 24 || class_player[id] == Protector)
continue;
ExecuteHam(Ham_TakeDamage, pid, ent, attacker, 90.0+float(inteligencja_player[attacker]) , 1);
}
remove_entity(ent);
}
}
public DotykRakiety(ent)
{
if ( !is_valid_ent(ent))
return;
new attacker = entity_get_edict(ent, EV_ENT_owner);
new Float:fOrigin[3], iOrigin[3];
entity_get_vector( ent, EV_VEC_origin, fOrigin);
iOrigin[0] = floatround(fOrigin[0]);
iOrigin[1] = floatround(fOrigin[1]);
iOrigin[2] = floatround(fOrigin[2]);
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);
write_byte(32); // scale
write_byte(20); // framerate
write_byte(0);// flags
message_end();
new entlist[33];
new numfound = find_sphere_class(ent, "player", 230.0, entlist, 32);
for (new i=0; i < numfound; i++)
{
new pid = entlist[i];
if (!is_user_alive(pid) || get_user_team(attacker) == get_user_team(pid) || information_item_player[pid][0] == 24)
continue;
ExecuteHam(Ham_TakeDamage, pid, ent, attacker, 55.0+float(inteligencja_player[attacker]) , 1);
}
remove_entity(ent);
}