Raised This Month: $344 Target: $400
 86%   Almost there!

Request Delete something in this plugin.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
eNNkds
Member
Join Date: Sep 2012
Location: Romania
Old 04-15-2018 , 18:42   Request Delete something in this plugin.
Reply With Quote #1

Hello i request to delete UAV and Counter-UAV & EMP from this plugin..

and allow only CT team.
Note: don't show this menu for T, or other message when it type: /ks

PHP Code:
#include <amxmodx> 
#include <cstrike> 
#include <hamsandwich> 
#include <engine> 
#include <fakemeta> 
#include <fun> 
#include <xs> 

#define PLUGIN "KillStreak" 
#define VERSION "1.3.4" 
#define AUTHOR "cypis" 

#define MAX_DIST 8192.0 
#define MAX 32 

new const maxAmmo[31]={0,52,0,90,1,32,1,100,90,1,120,100,100,90,90,90,100,120,30,120,200,32,90,120,90,2,35,90,90,0,100}; 

new 
sprite_blastcache_trail

new 
licznik_zabic[MAX+1], bool:radar[2], bool:nalot[MAX+1], bool:predator[MAX+1], bool:nuke[MAX+1], bool:emp[MAX+1], bool:cuav[MAX+1], bool:uav[MAX+1], bool:pack[MAX+1], bool:sentrys[MAX+1]; 
new 
user_controll[MAX+1], emp_czasowebool:nuke_player[MAX+1]; 
new 
PobraneOrigin[3], ZmienKilla[2], team_use;

public 
plugin_init()  

    
register_plugin(PLUGINVERSIONAUTHOR
    
    
register_think("sentry","SentryThink"); 
    
    
register_touch("predator""*""touchedpredator"); 
    
register_touch("bomb""*""touchedrocket"); 
    
    
register_forward(FM_ClientKill"cmdKill"); 
    
    
RegisterHam(Ham_TakeDamage"func_breakable""TakeDamage"); 
    
RegisterHam(Ham_Killed"player""SmiercGracza"1); 
    
    
register_event("CurWeapon","CurWeapon","be""1=1"); 
    
register_event("HLTV""NowaRunda""a""1=0""2=0"); 
    
register_message(get_user_msgid("DeathMsg"), "message_DeathMsg"
    
    
register_cvar("ks_hpsentry""2500"); 
    
register_cvar("ks_sentry_remove""1"); 
    
    
team_use register_cvar("ks_can_use""0"// 0 - both / 1 - T / 2 - CT
    
    
register_clcmd("say /ks""uzyj_nagrody"); 
    
register_clcmd("say /killstreak""uzyj_nagrody"); 
    
set_task(2.0,"radar_scan",_,_,_,"b"); 


public 
plugin_precache() 

    
sprite_blast precache_model("sprites/dexplo.spr"); 
    
cache_trail precache_model("sprites/smoke.spr"); 
    
    
precache_model("models/p_hegrenade.mdl"); 
    
precache_model("models/cod_carepackage.mdl"); 
    
precache_model("models/cod_plane.mdl"); 
    
precache_model("models/cod_predator.mdl"); 
    
precache_model("models/sentrygun_mw2.mdl"); 
    
    
precache_sound("mw/nuke_friend.wav"); 
    
precache_sound("mw/nuke_enemy.wav"); 
    
precache_sound("mw/nuke_give.wav"); 
    
    
precache_sound("mw/jet_fly1.wav"); 
    
//precache_sound("mw/jet_fly2.wav"); 
    
    
precache_sound("mw/emp_effect.wav"); 
    
precache_sound("mw/emp_friend.wav"); 
    
precache_sound("mw/emp_enemy.wav"); 
    
precache_sound("mw/emp_give.wav"); 
    
    
precache_sound("mw/counter_friend.wav"); 
    
precache_sound("mw/counter_enemy.wav"); 
    
precache_sound("mw/counter_give.wav"); 
    
    
precache_sound("mw/air_friend.wav"); 
    
precache_sound("mw/air_enemy.wav"); 
    
precache_sound("mw/air_give.wav"); 
    
    
precache_sound("mw/predator_friend.wav"); 
    
precache_sound("mw/predator_enemy.wav"); 
    
precache_sound("mw/predator_give.wav"); 
    
    
precache_sound("mw/uav_friend.wav"); 
    
precache_sound("mw/uav_enemy.wav"); 
    
precache_sound("mw/uav_give.wav"); 
    
    
precache_sound("mw/carepackage_friend.wav"); 
    
precache_sound("mw/carepackage_enemy.wav"); 
    
precache_sound("mw/carepackage_give.wav"); 
    
    
precache_sound("mw/firemw.wav"); 
    
precache_sound("mw/plant.wav"); 
    
precache_sound("mw/sentrygun_starts.wav"); 
    
precache_sound("mw/sentrygun_stops.wav"); 
    
precache_sound("mw/sentrygun_gone.wav"); 
    
precache_sound("mw/sentrygun_friend.wav"); 
    
precache_sound("mw/sentrygun_enemy.wav"); 
    
precache_sound("mw/sentrygun_give.wav"); 
    
    
precache_model("models/computergibs.mdl"); 
    
/*precache_sound("mw/emergairdrop_friend.wav"); 
    precache_sound("mw/emergairdrop_enemy.wav"); 
    precache_sound("mw/emergairdrop_give.wav");*/ 


public 
uzyj_nagrody(id

    new 
menu menu_create("KillStreak:""Nagrody_Handler"); 
    
    new 
cb menu_makecallback("Nagrody_Callback"); 
    
    
menu_additem(menu"UAV"__cb); 
    
menu_additem(menu"Care Package"__cb); 
    
menu_additem(menu"Counter-UAV"__cb); 
    
menu_additem(menu"Sentry Gun"__cb); 
    
menu_additem(menu"Predator Missle"__cb); 
    
menu_additem(menu"Airstrike"__cb); 
    
menu_additem(menu"EMP"__cb); 
    
menu_additem(menu"Nuke"__cb); 
    
    
menu_setprop(menuMPROP_EXITNAME"Wyjdz^n\yKill Streak v1.3.4 by \rCypis"); 
    
    if(
get_pcvar_num(team_use) == 0) {
        if(
cs_get_user_team(id) != CS_TEAM_SPECTATOR && cs_get_user_team(id) != CS_TEAM_UNASSIGNED)
            
menu_display(idmenu
    }
    
    else if(
get_pcvar_num(team_use) == 1) {
        if(
cs_get_user_team(id) == CS_TEAM_T)
            
menu_display(idmenu)
    }
    
    else if(
get_pcvar_num(team_use) == 2) {
        if(
cs_get_user_team(id) == CS_TEAM_CT)
            
menu_display(idmenu)
    }


public 
Nagrody_Callback(idmenuitem

    if(!
uav[id] && item == || !pack[id] && item == || !cuav[id] && item == || !sentrys[id] && item == || !predator[id] && item == || !nalot[id] && item == || !emp[id] && item == || !nuke[id] && item == 7
        return 
ITEM_DISABLED
    
    return 
ITEM_ENABLED


public 
Nagrody_Handler(idmenuitem

    if(!
is_user_alive(id)) 
        return 
PLUGIN_HANDLED
    
    if(
item == MENU_EXIT
    { 
        
menu_destroy(menu); 
        return 
PLUGIN_HANDLED
    } 
    
    switch(
item
    { 
        case 
0:{ 
            if(!
emp_czasowe || (emp_czasowe && get_user_team(id) == get_user_team(emp_czasowe))) 
                
CreateUVA(id); 
        } 
        case 
1:{ 
            if(!
emp_czasowe || (emp_czasowe && get_user_team(id) == get_user_team(emp_czasowe))) 
                
CreatePack(id); 
        }  
        case 
2:{ 
            if(!
emp_czasowe || (emp_czasowe && get_user_team(id) == get_user_team(emp_czasowe))) 
                
CreateCUVA(id); 
        }  
        case 
3:{ 
            if(!
emp_czasowe || (emp_czasowe && get_user_team(id) == get_user_team(emp_czasowe))) 
                
CreateSentry(id); 
        }  
        case 
4:{ 
            if(!
emp_czasowe || (emp_czasowe && get_user_team(id) == get_user_team(emp_czasowe))) 
                
CreatePredator(id); 
        }  
        case 
5:{ 
            if(!
emp_czasowe || (emp_czasowe && get_user_team(id) == get_user_team(emp_czasowe))) 
                
CreateNalot(id); 
        }  
        case 
6:{ 
            if(!
emp_czasowe
                
CreateEmp(id); 
        }  
        case 
7CreateNuke(id); 
        }         
    return 
PLUGIN_HANDLED


public 
NowaRunda() 

    new 
numplayers[32]; 
    
get_players(playersnum"gh"); 
    for(new 
0numi++) 
    { 
        if(
task_exists(players[i]+997)) 
            
remove_task(players[i]+997); 
    } 
    
    
remove_entity_name("predator"
    
remove_entity_name("bomb"
    
    if(
get_cvar_num("ks_sentry_remove")) 
        
remove_entity_name("sentry"


public 
client_putinserver(id){ 
    
licznik_zabic[id] = 0
    
user_controll[id] = 0
    
nalot[id] = false
    
predator[id] = false
    
nuke[id] = false
    
cuav[id] = false
    
uav[id] = false
    
emp[id] = false
    
pack[id] = false
    
sentrys[id] = false


public 
client_disconnect(id

    new 
ent = -
    
while((ent find_ent_by_class(ent"sentry"))) 
    { 
        if(
entity_get_int(entEV_INT_iuser2) == id
            
remove_entity(ent); 
    } 
    return 
PLUGIN_CONTINUE


public 
SmiercGracza(idattacker
{     
    if(!
is_user_alive(attacker) || !is_user_connected(attacker)) 
        return 
HAM_IGNORED
    
    if(
get_user_team(attacker) != get_user_team(id) && !nuke_player[attacker]) 
    { 
        
licznik_zabic[attacker]++; 
        switch(
licznik_zabic[attacker]) 
        { 
            case 
3
            { 
                
uav[attacker] = true
                
OdgrajDzwieki(attacker"UAV^nWpisz /ks i wybierz zeby go uzyc""uav"); 
            } 
            case 
4
            { 
                switch(
random_num(0,1)) 
                { 
                    case 
0
                    { 
                        
cuav[attacker] = true
                        
OdgrajDzwieki(attacker"Counter-Uav^nWpisz /ks i wybierz zeby go uzyc""counter"); 
                    } 
                    case 
1
                    { 
                        
pack[attacker] = true
                        
OdgrajDzwieki(attacker"Care Package^nWpisz /ks i wybierz zeby go uzyc""carepackage"); 
                    } 
                } 
            } 
            case 
5
            { 
                
predator[attacker] = true
                
OdgrajDzwieki(attacker"Predator Missible^nWpisz /ks i wybierz zeby go uzyc""predator"); 
            } 
            case 
6
            { 
                
nalot[attacker] = true
                
OdgrajDzwieki(attacker"Airstreak^nWpisz /ks i wybierz zeby go uzyc""air"); 
            } 
            case 
8
            { 
                
sentrys[attacker] = true
                
OdgrajDzwieki(attacker"Sentry Gun^nWpisz /ks i wybierz zeby go postawic""sentrygun"); 
            } 
            case 
15
            { 
                
emp[attacker] = true
                
OdgrajDzwieki(attacker"EMP^nWpisz /ks i wybierz zeby go uzyc""emp"); 
            } 
            case 
20
            { 
                
nuke[attacker] = true
                
OdgrajDzwieki(attacker"Nuke^nWpisz /ks i wybierz zeby go uzyc""nuke"); 
            } 
        } 
    } 
    
licznik_zabic[id] = 0
    
user_controll[id] = 0
    
    new 
ent find_drop_pack(id"pack"
    if(
is_valid_ent(ent)) 
    { 
        if(
task_exists(2571+ent)) 
        { 
            
remove_task(2571+ent); 
            
bartime(id0); 
        } 
    } 
    return 
HAM_IGNORED


public 
OdgrajDzwieki(idszNazwa[], scieszka[]) 

    
set_hudmessage(255255255, -1.00.2506.07.0); 
    
ShowSyncHudMsg(idCreateHudSyncObj(), szNazwa); 
    
client_cmd(id"spk sound/mw/%s_give.wav"scieszka); 


//uav 
public CreateUVA(id

    static 
CzasUav[2]; 
    new 
team get_user_team(id) == 101
    
uav[id] = false
    
radar[team] = true
    
    new 
numplayers[32]; 
    
get_players(playersnum"gh"
    for(new 
0numa++) 
    { 
        new 
players[a
        if(
get_user_team(id) != get_user_team(i)) 
            
client_cmd(i"spk sound/mw/uav_enemy.wav"
        else 
            
client_cmd(i"spk sound/mw/uav_friend.wav"
    } 
    
print_info(id"UAV"); 
    
radar_scan() 
    
    if(
task_exists(7354+team)) 
    { 
        new 
times = (CzasUav[team]-get_systime())+60 
        change_task
(7354+teamfloat(times)); 
        
CzasUav[team] = CzasUav[team]+times
    } 
    else 
    { 
        new 
data[1]; 
        
data[0] = team
        
set_task(60.0"deluav"7354+teamdata1); 
        
CzasUav[team] = get_systime()+60
    } 


public 
deluav(data[1]) 

    
radar[data[0]] = false


public 
radar_scan() 

    new 
numplayers[32]; 
    
get_players(playersnum"gh"
    for(new 
i=0i<numi++) 
    { 
        new 
id players[i]; 
        if(!
is_user_alive(id) || !radar[get_user_team(id) == 101]) 
            continue; 
        
        if(!
emp_czasowe
            
radar_continue(id
        else if(
get_user_team(id) == get_user_team(emp_czasowe)) 
            
radar_continue(id
    } 


radar_continue(id) { 
    new 
numplayers[32], PlayerCoords[3
    
get_players(playersnum"gh"
    for(new 
a=0a<numa++) { 
        
        new 
players[a]        
        
        if(!
is_user_alive(i) || get_user_team(i) == get_user_team(id))  
            continue; 
        
        
get_user_origin(iPlayerCoords
        
        
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("HostagePos"), {0,0,0}, id
        
write_byte(id
        
write_byte(i)            
        
write_coord(PlayerCoords[0]) 
        
write_coord(PlayerCoords[1]) 
        
write_coord(PlayerCoords[2]) 
        
message_end() 
        
        
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("HostageK"), {0,0,0}, id
        
write_byte(i
        
message_end() 
    }     


//airpack 
public CreatePack(id

    new 
numplayers[32]; 
    
get_players(playersnum"gh"); 
    for(new 
0numa++) { 
        new 
players[a]; 
        if(
get_user_team(id) != get_user_team(i)) 
            
client_cmd(i"spk sound/mw/carepackage_enemy.wav"); 
        else 
            
client_cmd(i"spk sound/mw/carepackage_friend.wav"); 
    } 
    
print_info(id"Care Package"); 
    
CreatePlane(id
    
pack[id] = false 
    set_task
(1.0"CarePack"id+742


public 
CarePack(taskid

    new 
id = (taskid 742
    
    
PobraneOrigin[2] += 150;  
    new 
Float:LocVecs[3]; 
    
IVecFVec(PobraneOriginLocVecs); 
    
create_ent(id"pack""models/cod_carepackage.mdl"16LocVecs); 


public 
pickup_pack(info[2]) 

    new 
id info[0]; 
    new 
ent info[1]; 
    
    if(!
is_user_connected(id) || !is_user_alive(id)) 
        return; 
    
    new 
weapons[32], weaponsnum
    
get_user_weapons(idweaponsweaponsnum); 
    for(new 
i=0i<weaponsnumi++) 
        if(
maxAmmo[weapons[i]] > 0
        
cs_set_user_bpammo(idweapons[i], maxAmmo[weapons[i]]); 
    
    
give_item(id"weapon_hegrenade"); 
    
give_item(id"weapon_flashbang"); 
    
give_item(id"weapon_flashbang");             
    
give_item(id"weapon_smokegrenade"); 
    
    switch(
random(5))     
    { 
        case 
0
        { 
            
uav[id] = true
            
client_cmd(id"spk sound/mw/uav_give.wav"); 
        } 
        case 
1
        { 
            
cuav[id] = true
            
client_cmd(id"spk sound/mw/counter_give.wav"); 
        } 
        case 
2
        { 
            
predator[id] = true
            
client_cmd(id"spk sound/mw/predator_give.wav"); 
        } 
        case 
3
        { 
            
nalot[id] = true
            
client_cmd(id"spk sound/mw/air_give.wav"); 
        } 
        case 
4
        { 
            
sentrys[id] = true
            
client_cmd(id"spk sound/mw/sentrygun_give.wav"); 
        } 
        case 
5
        { 
            
emp[id] = true
            
client_cmd(id"spk sound/mw/emp_give.wav"); 
        } 
    }         
    
remove_entity(ent); 


public 
client_PreThink(id
{     
    if(!
is_user_alive(id)) 
        return 
PLUGIN_CONTINUE;                 
    if(
user_controll[id]) 
    { 
        new 
ent2 user_controll[id]; 
        if(
is_valid_ent(ent2)) 
        { 
            new 
Float:Velocity[3], Float:Angle[3]; 
            
velocity_by_aim(id500Velocity); 
            
entity_get_vector(idEV_VEC_v_angleAngle); 
            
            
entity_set_vector(ent2EV_VEC_velocityVelocity); 
            
entity_set_vector(ent2EV_VEC_anglesAngle); 
        } 
        else 
            
attach_view(idid); 
    } 
    static 
ent_id[MAX+1]; 
    new 
ent find_drop_pack(id"pack"); 
    if(
is_valid_ent(ent)) 
    { 
        if(!
task_exists(2571+ent)) 
        { 
            
ent_id[id] = ent
            
bartime(id3)     
            
            new 
info[2]; 
            
info[0] = id
            
info[1] = ent
            
set_task(3.0"pickup_pack"2571+entinfo2); 
        } 
    } 
    else 
    { 
        if(
task_exists(2571+ent_id[id])) 
        { 
            
remove_task(2571+ent_id[id]); 
            
bartime(id0); 
            
ent_id[id] = 0
        } 
    } 
    return 
PLUGIN_CONTINUE


//counter-uva 
public CreateCUVA(id

    
cuav[id] = false
    new 
numplayers[32]; 
    
get_players(playersnum"gh"); 
    for(new 
0numa++) 
    { 
        new 
players[a]; 
        if(
get_user_team(id) != get_user_team(i)) 
            
client_cmd(i"spk sound/mw/counter_enemy.wav"); 
        else 
            
client_cmd(i"spk sound/mw/counter_friend.wav"); 
    } 
    
radar[get_user_team(id) == 110] = false
    
print_info(id"Counter-UAV"); 


//emp 
public CreateEmp(id

    
client_cmd(0"spk sound/mw/emp_effect.wav"); 
    
emp[id] = false
    new 
numplayers[32]; 
    
get_players(playersnum"gh"
    for(new 
0numa++) 
    { 
        new 
players[a]; 
        if(
get_user_team(id) != get_user_team(i)) 
        { 
            if(
is_user_alive(i)) 
            { 
                
Display_Fade(i,1<<12,1<<12,1<<16,255255,0,166); 
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("HideWeapon"), _i); 
                
write_byte((1<<0)|(1<<3)|(1<<5)); 
                
message_end(); 
            } 
            
client_cmd(i"spk sound/mw/emp_enemy.wav"); 
        } 
        else 
            
client_cmd(i"spk sound/mw/emp_friend.wav"); 
    } 
    
print_info(id"EMP""e"); 
    
emp_czasowe id
    
set_task(90.0,"del_emp"); 


public 
del_emp() 

    new 
numplayers[32]; 
    
get_players(playersnum"gh"); 
    for(new 
0numa++) 
    { 
        new 
players[a]; 
        if(
get_user_team(emp_czasowe) != get_user_team(i)) 
        { 
            if(
is_user_alive(i)) 
            { 
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("HideWeapon"), _i);  
                
write_byte(0); 
                
message_end(); 
            } 
        } 
    } 
    
emp_czasowe 0


public 
CurWeapon(id

    if(
get_user_team(id) != get_user_team(emp_czasowe) && emp_czasowe
    { 
        
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("HideWeapon"), _id);  
        
write_byte(0x29); //(1<<0)|(1<<3)|(1<<5) 
        
message_end();  
    } 


//nuke 
public CreateNuke(id

    new 
numplayers[32]; 
    
get_players(playersnum"gh"); 
    for(new 
0numa++) 
    { 
        new 
players[a]; 
        if(
is_user_alive(i)) 
            
Display_Fade(i,(10<<12),(10<<12),(1<<16),2554242,171); 
        
        if(
get_user_team(id) != get_user_team(i)) 
            
client_cmd(i"spk sound/mw/nuke_enemy.wav"); 
        else 
            
client_cmd(i"spk sound/mw/nuke_friend.wav"); 
    } 
    
print_info(id"Nuke""e"); 
    
set_task(10.0,"shakehud"); 
    
set_task(13.5,"del_nuke"id); 
    
nuke[id] = false


public 
shakehud() 

    new 
numplayers[32]; 
    
get_players(playersnum"gh"); 
    for(new 
0numa++) 
    { 
        new 
players[a]; 
        if(
is_user_alive(i)) 
        { 
            
Display_Fade(i,(3<<12),(3<<12),(1<<16),2558542,215); 
            
message_begin(MSG_ONEget_user_msgid("ScreenShake"), {0,0,0}, i); 
            
write_short(255<<12); 
            
write_short(4<<12); 
            
write_short(255<<12); 
            
message_end(); 
        } 
    } 


public 
del_nuke(id

    new 
numplayers[32]; 
    
get_players(playersnum"gh"); 
    for(new 
0numa++) 
    { 
        new 
players[a]; 
        if(
is_user_alive(i)) 
        { 
            if(
get_user_team(id) != get_user_team(i)) 
            { 
                
cs_set_user_armor(i0CS_ARMOR_NONE); 
                
UTIL_Kill(idifloat(get_user_health(i)), DMG_BULLET
            } 
            else 
                
user_silentkill(i); 
        } 
    } 
    
nuke_player[id] = false
    
licznik_zabic[id] = 0


//nalot 
public CreateNalot(id

    new 
numplayers[32]; 
    
get_players(playersnum"gh"); 
    for(new 
0numa++) 
    { 
        new 
players[a]; 
        if(
get_user_team(id) != get_user_team(i)) 
            
client_cmd(i"spk sound/mw/air_enemy.wav"); 
        else 
            
client_cmd(i"spk sound/mw/air_friend.wav"); 
    } 
    
print_info(id"Airstrike"); 
    
set_task(1.0"CreateBombs"id+997__"a"3); 
    
CreatePlane(id); 
    
nalot[id] = false


public 
CreateBombs(taskid
{     
    new 
id = (taskid-997); 
    
    new 
radlocation[3]; 
    
PobraneOrigin[0] += random_num(-300,300); 
    
PobraneOrigin[1] += random_num(-300,300); 
    
PobraneOrigin[2] += 50
    
    for(new 
i=0i<15i++)  
    { 
        
radlocation[0] = PobraneOrigin[0]+1*random_num(-150,150);  
        
radlocation[1] = PobraneOrigin[1]+1*random_num(-150,150);  
        
radlocation[2] = PobraneOrigin[2];  
        
        new 
Float:LocVec[3];  
        
IVecFVec(radlocationLocVec);  
        
create_ent(id"bomb""models/p_hegrenade.mdl"210LocVec); 
    } 
}   

public 
CreatePlane(id

    new 
Float:Origin[3], Float:Angle[3], Float:Velocity[3], ent
    
    
get_user_origin(idPobraneOrigin3); 
    
    
velocity_by_aim(id1000Velocity); 
    
entity_get_vector(idEV_VEC_originOrigin); 
    
entity_get_vector(idEV_VEC_v_angleAngle); 
    
    
Angle[0] = Velocity[2] = 0.0
    
Origin[2] += 200.0
    
    
create_ent(id"samolot""models/cod_plane.mdl"28Originent); 
    
    
entity_set_vector(entEV_VEC_velocityVelocity); 
    
entity_set_vector(entEV_VEC_anglesAngle); 
    
    
emit_sound(entCHAN_ITEM"mw/jet_fly1.wav"1.0ATTN_NORM0PITCH_NORM); 
    
set_task(4.5"del_plane"ent+5731); 


public 
del_plane(taskid
    
remove_entity(taskid-5731); 

public 
touchedrocket(entid

    if(!
is_valid_ent(ent)) 
        return 
PLUGIN_CONTINUE
    
    
bombs_explode(ent100.0150.0); 
    return 
PLUGIN_CONTINUE


//predator 
public CreatePredator(id

    new 
numplayers[32]; 
    
get_players(playersnum"gh"); 
    for(new 
0numa++) 
    { 
        new 
players[a]; 
        if(
get_user_team(id) != get_user_team(i)) 
            
client_cmd(i"spk sound/mw/predator_enemy.wav"); 
        else 
            
client_cmd(i"spk sound/mw/predator_friend.wav"); 
    } 
    
print_info(id"Predator Missle"); 
    
    new 
Float:Origin[3], Float:Angle[3], Float:Velocity[3], ent
    
    
velocity_by_aim(id700Velocity); 
    
entity_get_vector(idEV_VEC_originOrigin); 
    
entity_get_vector(idEV_VEC_v_angleAngle); 
    
    
Angle[0] *= -1.0
    
    
create_ent(id"predator""models/cod_predator.mdl"25Originent); 
    
    
entity_set_vector(entEV_VEC_velocityVelocity); 
    
entity_set_vector(entEV_VEC_anglesAngle); 
    
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY); 
    
write_byte(TE_BEAMFOLLOW); 
    
write_short(ent); 
    
write_short(cache_trail); 
    
write_byte(10); 
    
write_byte(5); 
    
write_byte(205); 
    
write_byte(237); 
    
write_byte(163); 
    
write_byte(200); 
    
message_end(); 
    
    
predator[id] = false
    
    
attach_view(ident); 
    
user_controll[id] = ent
}  

public 
touchedpredator(entid

    if(!
is_valid_ent(ent)) 
        return 
PLUGIN_CONTINUE
    
    new 
owner entity_get_edict(entEV_ENT_owner); 
    
bombs_explode(ent220.0400.0); 
    
attach_view(ownerowner); 
    
user_controll[owner] = 0
    return 
PLUGIN_CONTINUE


//sentry gun 
public CreateSentry(id)  

    if(!(
entity_get_int(idEV_INT_flags) & FL_ONGROUND))  
        return; 
    
    new 
entlist[3]; 
    if(
find_sphere_class(id"func_bomb_target"650.0entlist2)) 
    { 
        
client_print(idprint_chat"[KillStrike] Jestes zbyt blisko BS'A."); 
        return; 
    } 
    if(
find_sphere_class(id"func_buyzone"650.0entlist2)) 
    { 
        
client_print(idprint_chat"[KillStrike] Jestes zbyt blisko Respa."); 
        return; 
    } 
    new 
numplayers[32], Float:Origin[3]; 
    
get_players(playersnum"gh"); 
    for(new 
0numa++) 
    { 
        new 
players[a]; 
        if(
get_user_team(id) != get_user_team(i)) 
            
client_cmd(i"spk sound/mw/sentrygun_enemy.wav"); 
        else 
            
client_cmd(i"spk sound/mw/sentrygun_friend.wav"); 
    } 
    
print_info(id"Sentry Gun"); 
    
    
entity_get_vector(idEV_VEC_originOrigin); 
    
Origin[2] += 45.0
    
    new 
health[12], ent create_entity("func_breakable"); 
    
get_cvar_string("ks_hpsentry",healthcharsmax(health)); 
    
    
DispatchKeyValue(ent"health"health); 
    
DispatchKeyValue(ent"material""6"); 
    
    
entity_set_string(entEV_SZ_classname"sentry"); 
    
entity_set_model(ent"models/sentrygun_mw2.mdl"); 
    
    
entity_set_float(entEV_FL_takedamageDAMAGE_YES); 
    
    
entity_set_size(entFloat:{-16.0, -16.00.0}, Float:{16.016.048.0}); 
    
    
entity_set_origin(entOrigin); 
    
entity_set_int(entEV_INT_solidSOLID_SLIDEBOX); 
    
entity_set_int(entEV_INT_movetypeMOVETYPE_TOSS); 
    
entity_set_int(entEV_INT_iuser2id); 
    
entity_set_vector(entEV_VEC_anglesFloat:{0.00.00.0}); 
    
entity_set_byte(entEV_BYTE_controller2127); 
    
    
entity_set_float(entEV_FL_nextthinkget_gametime()+1.0); 
    
    
sentrys[id] = false
    
emit_sound(entCHAN_ITEM"mw/plant.wav"1.0ATTN_NORM0PITCH_NORM); 


public 
SentryThink(ent

    if(!
is_valid_ent(ent))  
        return 
PLUGIN_CONTINUE
    
    new 
Float:SentryOrigin[3], Float:closestOrigin[3]; 
    
entity_get_vector(entEV_VEC_originSentryOrigin); 
    
    new 
id entity_get_int(entEV_INT_iuser2); 
    new 
target entity_get_edict(entEV_ENT_euser1); 
    new 
firemods entity_get_int(entEV_INT_iuser1); 
    
    if(
firemods
    {  
        if(
/*ExecuteHam(Ham_FVisible, target, ent)*/fm_is_ent_visible(targetent) && is_user_alive(target))  
        { 
            if(
UTIL_In_FOV(target,ent)) 
            { 
                goto 
fireoff
            } 
            
            new 
Float:TargetOrigin[3]; 
            
entity_get_vector(targetEV_VEC_originTargetOrigin); 
            
            
emit_sound(entCHAN_AUTO"mw/firemw.wav"1.0ATTN_NORM0PITCH_NORM); 
            
sentry_turntotarget(entSentryOriginTargetOrigin); 
            
            new 
Float:hitRatio random_float(0.01.0) - 0.2
            if(
hitRatio <= 0.0
            { 
                
UTIL_Kill(idtargetrandom_float(5.035.0), DMG_BULLET1); 
                
                
message_begin(MSG_BROADCASTSVC_TEMPENTITY); 
                
write_byte(TE_TRACER); 
                
write_coord(floatround(SentryOrigin[0])); 
                
write_coord(floatround(SentryOrigin[1])); 
                
write_coord(floatround(SentryOrigin[2])); 
                
write_coord(floatround(TargetOrigin[0])); 
                
write_coord(floatround(TargetOrigin[1])); 
                
write_coord(floatround(TargetOrigin[2])); 
                
message_end(); 
            } 
            
entity_set_float(entEV_FL_nextthinkget_gametime()+0.1); 
            return 
PLUGIN_CONTINUE
        } 
        else 
        { 
            
fireoff
            
firemods 0
            
entity_set_int(entEV_INT_iuser10); 
            
entity_set_edict(entEV_ENT_euser10); 
            
emit_sound(entCHAN_AUTO"mw/sentrygun_stops.wav"1.0ATTN_NORM0PITCH_NORM); 
            
            
entity_set_float(entEV_FL_nextthinkget_gametime()+1.0); 
            return 
PLUGIN_CONTINUE
        } 
    } 
    
    new 
closestTarget getClosestPlayer(ent
    if(
closestTarget
    { 
        
emit_sound(entCHAN_AUTO"mw/sentrygun_starts.wav"1.0ATTN_NORM0PITCH_NORM); 
        
entity_get_vector(closestTargetEV_VEC_originclosestOrigin); 
        
sentry_turntotarget(entSentryOriginclosestOrigin); 
        
        
entity_set_int(entEV_INT_iuser11); 
        
entity_set_edict(entEV_ENT_euser1closestTarget); 
        
        
entity_set_float(entEV_FL_nextthinkget_gametime()+1.0); 
        return 
PLUGIN_CONTINUE
    } 
    
    if(!
firemods
    { 
        new 
controler1 entity_get_byte(entEV_BYTE_controller1)+1
        if(
controler1 255
            
controler1 0
        
entity_set_byte(entEV_BYTE_controller1controler1); 
        
        new 
controler2 entity_get_byte(entEV_BYTE_controller2); 
        if(
controler2 127 || controler2 127
            
entity_set_byte(entEV_BYTE_controller2127); 
        
        
entity_set_float(entEV_FL_nextthinkget_gametime()+0.05); 
    } 
    return 
PLUGIN_CONTINUE 


public 
sentry_turntotarget(entFloat:sentryOrigin[3], Float:closestOrigin[3])  

    new 
newTripFloat:newAngle floatatan(((closestOrigin[1]-sentryOrigin[1])/(closestOrigin[0]-sentryOrigin[0])), radian) * 57.2957795
    
    if(
closestOrigin[0] < sentryOrigin[0]) 
        
newAngle += 180.0
    if(
newAngle 0.0
        
newAngle += 360.0
    
    
sentryOrigin[2] += 35.0 
    
if(closestOrigin[2] > sentryOrigin[2]) 
        
newTrip 0
    if(
closestOrigin[2] < sentryOrigin[2]) 
        
newTrip 255
    if(
closestOrigin[2] == sentryOrigin[2]) 
        
newTrip 127
    
    
entity_set_byte(entEV_BYTE_controller1,floatround(newAngle*0.70833)); 
    
entity_set_byte(entEV_BYTE_controller2newTrip); 
    
entity_set_byte(entEV_BYTE_controller3entity_get_byte(entEV_BYTE_controller3)+20>2550entity_get_byte(entEV_BYTE_controller3)+20); 


public 
TakeDamage(entidinflictorattackerFloat:damagedamagebits

    if(!
is_user_alive(attacker)) 
        return 
HAM_IGNORED
    
    new 
classname[32]; 
    
entity_get_string(entEV_SZ_classnameclassname31); 
    
    if(
equal(classname"sentry"))  
    { 
        new 
id entity_get_int(entEV_INT_iuser2); 
        if(
get_user_team(attacker) == get_user_team(id)) 
            return 
HAM_SUPERCEDE
        
        if(
damage >= entity_get_float(entEV_FL_health)) 
        { 
            new 
Float:Origin[3]; 
            
entity_get_vector(entEV_VEC_originOrigin);     
            new 
entlist[33]; 
            new 
numfound find_sphere_class(ent"player"190.0entlist32); 
            
            for(new 
i=0numfoundi++) 
            {         
                new 
pid entlist[i]; 
                
                if(!
is_user_alive(pid) || get_user_team(id) == get_user_team(pid)) 
                    continue; 
                
UTIL_Kill(idpid70.0, (1<<24)); 
            } 
            
client_cmd(id"spk sound/mw/sentrygun_gone.wav"); 
            
//Sprite_Blast(Origin); 
            //remove_entity(ent); //jak to dam to cresh serwer bo odrazu usuwa sentry guna :O 
            
set_task(1.0"del_sentry"ent); //jak tego nie dam to sentry jest jako byt i strzela 
        

    } 
    return 
HAM_IGNORED


public 
del_sentry(ent
    
remove_entity(ent); 

//wybuch 
bombs_explode(entFloat:zadajeFloat:promien) { 
    if(!
is_valid_ent(ent))  
        return; 
    
    new 
attacker entity_get_edict(entEV_ENT_owner); 
    
    new 
Float:entOrigin[3], Float:fDamageFloat:Origin[3]; 
    
entity_get_vector(entEV_VEC_originentOrigin); 
    
entOrigin[2] += 1.0
    
    new 
entlist[33]; 
    new 
numfound find_sphere_class(ent"player"promienentlist32);     
    for(new 
i=0numfoundi++) 
    {         
        new 
victim entlist[i];         
        if(!
is_user_alive(victim) || get_user_team(attacker) == get_user_team(victim)) 
            continue; 
        
        
entity_get_vector(victimEV_VEC_originOrigin); 
        
fDamage zadaje floatmul(zadajefloatdiv(get_distance_f(OriginentOrigin), promien)); 
        
fDamage *= estimate_take_hurt(entOriginvictim0); 
        if(
fDamage>0.0
            
UTIL_Kill(attackervictimfDamageDMG_BULLET); 
    } 
    
Sprite_Blast(entOrigin); 
    
remove_entity(ent); 


public 
cmdKill() 
    return 
FMRES_SUPERCEDE

public 
message_DeathMsg() 

    new 
killer get_msg_arg_int(1); 
    if(
ZmienKilla[0] & (1<<killer)) 
    { 
        
set_msg_arg_string(4"grenade"); 
        return 
PLUGIN_CONTINUE
    } 
    if(
ZmienKilla[1] & (1<<killer)) 
    { 
        
set_msg_arg_string(4"m249"); 
        return 
PLUGIN_CONTINUE
    } 
    return 
PLUGIN_CONTINUE


stock create_ent(idszName[], szModel[], iSolidiMovetypeFloat:fOrigin[3], &ent=-1

    new 
ent1 create_entity("info_target"); 
    
entity_set_string(ent1EV_SZ_classnameszName); 
    
entity_set_model(ent1szModel); 
    
entity_set_int(ent1EV_INT_solidiSolid); 
    
entity_set_int(ent1EV_INT_movetypeiMovetype); 
    
entity_set_edict(ent1EV_ENT_ownerid); 
    
entity_set_origin(ent1fOrigin); 
    
    if(
ent != -1
        
ent ent1


stock Sprite_Blast(Float:iOrigin[3]) 

    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY); 
    
write_byte(TE_EXPLOSION); 
    
write_coord(floatround(iOrigin[0])); 
    
write_coord(floatround(iOrigin[1]));  
    
write_coord(floatround(iOrigin[2])); 
    
write_short(sprite_blast); 
    
write_byte(32); 
    
write_byte(20);  
    
write_byte(0); 
    
message_end(); 


stock Float:estimate_take_hurt(Float:fPoint[3], entignored)  

    new 
Float:fFractionFloat:fOrigin[3], tr
    
entity_get_vector(entEV_VEC_originfOrigin); 
    
engfunc(EngFunc_TraceLinefPointfOriginDONT_IGNORE_MONSTERSignoredtr); 
    
get_tr2(trTR_flFractionfFraction); 
    if(
fFraction == 1.0 || get_tr2(trTR_pHit) == ent
        return 
1.0
    return 
0.6


stock bartime(idnumber

    
message_begin(MSG_ONEget_user_msgid("BarTime"), _id); 
    
write_short(number); 
    
message_end();     


stock Display_Fade(id,duration,holdtime,fadetype,red,green,blue,alpha

    
message_begin(MSG_ONEget_user_msgid("ScreenFade"),{0,0,0},id); 
    
write_short(duration); 
    
write_short(holdtime); 
    
write_short(fadetype); 
    
write_byte(red); 
    
write_byte(green); 
    
write_byte(blue); 
    
write_byte(alpha); 
    
message_end(); 


stock find_drop_pack(id, const class[]) 

    new 
Float:origin[3], classname[32], ent
    
entity_get_vector(idEV_VEC_originorigin); 
    
    while((
ent find_ent_in_sphere(entorigin75.0)) != 0)  
    { 
        
entity_get_string(entEV_SZ_classnameclassname31); 
        if(
equali(classname, class)) 
            return 
ent
    } 
    return 
0


stock print_info(id, const nagroda[], const nazwa[] = "y"

    new 
nick[64]; 
    
get_user_name(idnick63); 
    
client_print(0print_chat"%s wezwan%s przez %s"nagrodanazwanick); 


stock UTIL_Kill(atakujacyobrywajacyFloat:damagedamagebitsile=0

    
ZmienKilla[ile] |= (1<<atakujacy); 
    
ExecuteHam(Ham_TakeDamageobrywajacyatakujacyatakujacydamagedamagebits); 
    
ZmienKilla[ile] &= ~(1<<atakujacy); 


stock getClosestPlayer(ent

    new 
iClosestPlayer 0Float:flClosestDist MAX_DISTFloat:flDistanseFloat:fOrigin[2][3]; 
    new 
numplayers[32]; 
    
get_players(playersnum"gh"
    for(new 
0numa++) 
    { 
        new 
players[a]; 
        if(!
is_user_connected(i) || !is_user_alive(i) || /*!ExecuteHam(Ham_FVisible, i, ent)*/!fm_is_ent_visible(ient) || get_user_team(i) == get_user_team(entity_get_int(entEV_INT_iuser2))) 
            continue; 
        
        if(
UTIL_In_FOV(ient)) 
            continue; 
        
        
entity_get_vector(iEV_VEC_originfOrigin[0]); 
        
entity_get_vector(entEV_VEC_originfOrigin[1]); 
        
        
flDistanse get_distance_f(fOrigin[0], fOrigin[1]); 
        
        if(
flDistanse <= flClosestDist
        { 
            
iClosestPlayer i
            
flClosestDist flDistanse
        } 
    } 
    return 
iClosestPlayer


stock bool:UTIL_In_FOV(id,ent

    if((
get_pdata_int(id510) & (1<<16)) && (Find_Angle(ident) > 0.0)) 
        return 
true
    return 
false


stock Float:Find_Angle(idtarget

    new 
Float:Origin[3], Float:TargetOrigin[3]; 
    
pev(id,pev_originOrigin); 
    
pev(target,pev_origin,TargetOrigin); 
    
    new 
Float:Angles[3], Float:vec2LOS[3]; 
    
pev(id,pev_anglesAngles); 
    
    
xs_vec_sub(TargetOriginOriginvec2LOS); 
    
vec2LOS[2] = 0.0
    
    new 
Float:veclength vector_length(vec2LOS); 
    if (
veclength <= 0.0
        
vec2LOS[0] = vec2LOS[1] = 0.0
    else 
    { 
        new 
Float:flLen 1.0 veclength
        
vec2LOS[0] = vec2LOS[0]*flLen
        
vec2LOS[1] = vec2LOS[1]*flLen
    } 
    
engfunc(EngFunc_MakeVectorsAngles); 
    
    new 
Float:v_forward[3]; 
    
get_global_vector(GL_v_forwardv_forward); 
    
    new 
Float:flDot vec2LOS[0]*v_forward[0]+vec2LOS[1]*v_forward[1]; 
    if(
flDot 0.5
        return 
flDot
    
    return 
0.0


stock bool:fm_is_ent_visible(indexentityignoremonsters 0) { 
    new 
Float:start[3], Float:dest[3]; 
    
pev(indexpev_originstart); 
    
pev(indexpev_view_ofsdest); 
    
xs_vec_add(startdeststart); 
    
    
pev(entitypev_origindest); 
    
engfunc(EngFunc_TraceLinestartdestignoremonstersindex0); 
    
    new 
Float:fraction
    
get_tr2(0TR_flFractionfraction); 
    if (
fraction == 1.0 || get_tr2(0TR_pHit) == entity
        return 
true
    
    return 
false


Last edited by eNNkds; 04-15-2018 at 18:43. Reason: forgett something to add..
eNNkds is offline
Send a message via Skype™ to eNNkds
eNNkds
Member
Join Date: Sep 2012
Location: Romania
Old 04-17-2018 , 13:59   Re: Request Delete something in this plugin.
Reply With Quote #2

bump.. somebody!?
eNNkds is offline
Send a message via Skype™ to eNNkds
sekac
Senior Member
Join Date: Nov 2016
Old 04-17-2018 , 15:11   Re: Request Delete something in this plugin.
Reply With Quote #3

Probably not gonna work but try this:
PHP Code:
#include <amxmodx> 
#include <cstrike> 
#include <hamsandwich> 
#include <engine> 
#include <fakemeta> 
#include <fun> 
#include <xs> 

#define PLUGIN "KillStreak" 
#define VERSION "1.3.4" 
#define AUTHOR "cypis" 

#define MAX_DIST 8192.0 
#define MAX 32 

new const maxAmmo[31]={0,52,0,90,1,32,1,100,90,1,120,100,100,90,90,90,100,120,30,120,200,32,90,120,90,2,35,90,90,0,100}; 

new 
sprite_blastcache_trail

new 
emp_czasowe;

new 
licznik_zabic[MAX+1], bool:nalot[MAX+1], bool:predator[MAX+1], bool:nuke[MAX+1], bool:pack[MAX+1], bool:sentrys[MAX+1]; 
new 
user_controll[MAX+1], bool:nuke_player[MAX+1]; 
new 
PobraneOrigin[3], ZmienKilla[2], team_use;

public 
plugin_init()  

    
register_plugin(PLUGINVERSIONAUTHOR
    
    
register_think("sentry","SentryThink"); 
    
    
register_touch("predator""*""touchedpredator"); 
    
register_touch("bomb""*""touchedrocket"); 
    
    
register_forward(FM_ClientKill"cmdKill"); 
    
    
RegisterHam(Ham_TakeDamage"func_breakable""TakeDamage"); 
    
RegisterHam(Ham_Killed"player""SmiercGracza"1); 
    
    
register_event("CurWeapon","CurWeapon","be""1=1"); 
    
register_event("HLTV""NowaRunda""a""1=0""2=0"); 
    
register_message(get_user_msgid("DeathMsg"), "message_DeathMsg"
    
    
register_cvar("ks_hpsentry""2500"); 
    
register_cvar("ks_sentry_remove""1"); 
    
    
team_use register_cvar("ks_can_use""0"// 0 - both / 1 - T / 2 - CT
    
    
register_clcmd("say /ks""uzyj_nagrody"); 
    
register_clcmd("say /killstreak""uzyj_nagrody"); 
    
set_task(2.0,"radar_scan",_,_,_,"b"); 


public 
plugin_precache() 

    
sprite_blast precache_model("sprites/dexplo.spr"); 
    
cache_trail precache_model("sprites/smoke.spr"); 
    
    
precache_model("models/p_hegrenade.mdl"); 
    
precache_model("models/cod_carepackage.mdl"); 
    
precache_model("models/cod_plane.mdl"); 
    
precache_model("models/cod_predator.mdl"); 
    
precache_model("models/sentrygun_mw2.mdl"); 
    
    
precache_sound("mw/nuke_friend.wav"); 
    
precache_sound("mw/nuke_enemy.wav"); 
    
precache_sound("mw/nuke_give.wav"); 
    
    
precache_sound("mw/jet_fly1.wav"); 
    
//precache_sound("mw/jet_fly2.wav"); 
    
    
precache_sound("mw/air_friend.wav"); 
    
precache_sound("mw/air_enemy.wav"); 
    
precache_sound("mw/air_give.wav"); 
    
    
precache_sound("mw/predator_friend.wav"); 
    
precache_sound("mw/predator_enemy.wav"); 
    
precache_sound("mw/predator_give.wav"); 
    
    
    
precache_sound("mw/carepackage_friend.wav"); 
    
precache_sound("mw/carepackage_enemy.wav"); 
    
precache_sound("mw/carepackage_give.wav"); 
    
    
precache_sound("mw/firemw.wav"); 
    
precache_sound("mw/plant.wav"); 
    
precache_sound("mw/sentrygun_starts.wav"); 
    
precache_sound("mw/sentrygun_stops.wav"); 
    
precache_sound("mw/sentrygun_gone.wav"); 
    
precache_sound("mw/sentrygun_friend.wav"); 
    
precache_sound("mw/sentrygun_enemy.wav"); 
    
precache_sound("mw/sentrygun_give.wav"); 
    
    
precache_model("models/computergibs.mdl"); 
    
/*precache_sound("mw/emergairdrop_friend.wav"); 
    precache_sound("mw/emergairdrop_enemy.wav"); 
    precache_sound("mw/emergairdrop_give.wav");*/ 


public 
uzyj_nagrody(id

    if(
cs_get_user_team(id) != CS_TEAM_CT) return
    new 
menu menu_create("KillStreak:""Nagrody_Handler"); 
    
    new 
cb menu_makecallback("Nagrody_Callback"); 
    
    
menu_additem(menu"Care Package"__cb); 
    
menu_additem(menu"Sentry Gun"__cb); 
    
menu_additem(menu"Predator Missle"__cb); 
    
menu_additem(menu"Airstrike"__cb); 
    
menu_additem(menu"Nuke"__cb); 
    
    
menu_setprop(menuMPROP_EXITNAME"Wyjdz^n\yKill Streak v1.3.4 by \rCypis"); 
    
    if(
get_pcvar_num(team_use) == 0) {
        if(
cs_get_user_team(id) != CS_TEAM_SPECTATOR && cs_get_user_team(id) != CS_TEAM_UNASSIGNED)
            
menu_display(idmenu
    }
    
    else if(
get_pcvar_num(team_use) == 1) {
        if(
cs_get_user_team(id) == CS_TEAM_T)
            
menu_display(idmenu)
    }
    
    else if(
get_pcvar_num(team_use) == 2) {
        if(
cs_get_user_team(id) == CS_TEAM_CT)
            
menu_display(idmenu)
    }


public 
Nagrody_Callback(idmenuitem

    if(!
pack[id] && item == || !sentrys[id] && item == || !predator[id] && item == || !nalot[id] && item == || !nuke[id] && item == 4
        return 
ITEM_DISABLED
    
    return 
ITEM_ENABLED


public 
Nagrody_Handler(idmenuitem

    if(!
is_user_alive(id)) 
        return 
PLUGIN_HANDLED
    
    if(
item == MENU_EXIT
    { 
        
menu_destroy(menu); 
        return 
PLUGIN_HANDLED
    } 
    
    switch(
item
    { 
        case 
0:{ 
            if(!
emp_czasowe || (emp_czasowe && get_user_team(id) == get_user_team(emp_czasowe))) 
                
CreatePack(id); 
        }   
        case 
1:{ 
            if(!
emp_czasowe || (emp_czasowe && get_user_team(id) == get_user_team(emp_czasowe))) 
                
CreateSentry(id); 
        }  
        case 
2:{ 
            if(!
emp_czasowe || (emp_czasowe && get_user_team(id) == get_user_team(emp_czasowe))) 
                
CreatePredator(id); 
        }  
        case 
3:{ 
            if(!
emp_czasowe || (emp_czasowe && get_user_team(id) == get_user_team(emp_czasowe))) 
                
CreateNalot(id); 
        }  
        case 
4CreateNuke(id); 
        }         
    return 
PLUGIN_HANDLED


public 
NowaRunda() 

    new 
numplayers[32]; 
    
get_players(playersnum"gh"); 
    for(new 
0numi++) 
    { 
        if(
task_exists(players[i]+997)) 
            
remove_task(players[i]+997); 
    } 
    
    
remove_entity_name("predator"
    
remove_entity_name("bomb"
    
    if(
get_cvar_num("ks_sentry_remove")) 
        
remove_entity_name("sentry"


public 
client_putinserver(id){ 
    
licznik_zabic[id] = 0
    
user_controll[id] = 0
    
nalot[id] = false
    
predator[id] = false
    
nuke[id] = false
    
pack[id] = false
    
sentrys[id] = false


public 
client_disconnect(id

    new 
ent = -
    
while((ent find_ent_by_class(ent"sentry"))) 
    { 
        if(
entity_get_int(entEV_INT_iuser2) == id
            
remove_entity(ent); 
    } 
    return 
PLUGIN_CONTINUE


public 
SmiercGracza(idattacker
{     
    if(!
is_user_alive(attacker) || !is_user_connected(attacker)) 
        return 
HAM_IGNORED
    
    if(
get_user_team(attacker) != get_user_team(id) && !nuke_player[attacker]) 
    { 
        
licznik_zabic[attacker]++; 
        switch(
licznik_zabic[attacker]) 
        { 
            case 
4
            { 
                        
pack[attacker] = true
                        
OdgrajDzwieki(attacker"Care Package^nWpisz /ks i wybierz zeby go uzyc""carepackage"); 
                    
                
            } 
            case 
5
            { 
                
predator[attacker] = true
                
OdgrajDzwieki(attacker"Predator Missible^nWpisz /ks i wybierz zeby go uzyc""predator"); 
            } 
            case 
6
            { 
                
nalot[attacker] = true
                
OdgrajDzwieki(attacker"Airstreak^nWpisz /ks i wybierz zeby go uzyc""air"); 
            } 
            case 
8
            { 
                
sentrys[attacker] = true
                
OdgrajDzwieki(attacker"Sentry Gun^nWpisz /ks i wybierz zeby go postawic""sentrygun"); 
            } 
            case 
20
            { 
                
nuke[attacker] = true
                
OdgrajDzwieki(attacker"Nuke^nWpisz /ks i wybierz zeby go uzyc""nuke"); 
            } 
        } 
    } 
    
licznik_zabic[id] = 0
    
user_controll[id] = 0
    
    new 
ent find_drop_pack(id"pack"
    if(
is_valid_ent(ent)) 
    { 
        if(
task_exists(2571+ent)) 
        { 
            
remove_task(2571+ent); 
            
bartime(id0); 
        } 
    } 
    return 
HAM_IGNORED


public 
OdgrajDzwieki(idszNazwa[], scieszka[]) 

    
set_hudmessage(255255255, -1.00.2506.07.0); 
    
ShowSyncHudMsg(idCreateHudSyncObj(), szNazwa); 
    
client_cmd(id"spk sound/mw/%s_give.wav"scieszka); 


//airpack 
public CreatePack(id

    new 
numplayers[32]; 
    
get_players(playersnum"gh"); 
    for(new 
0numa++) { 
        new 
players[a]; 
        if(
get_user_team(id) != get_user_team(i)) 
            
client_cmd(i"spk sound/mw/carepackage_enemy.wav"); 
        else 
            
client_cmd(i"spk sound/mw/carepackage_friend.wav"); 
    } 
    
print_info(id"Care Package"); 
    
CreatePlane(id
    
pack[id] = false 
    set_task
(1.0"CarePack"id+742


public 
CarePack(taskid

    new 
id = (taskid 742
    
    
PobraneOrigin[2] += 150;  
    new 
Float:LocVecs[3]; 
    
IVecFVec(PobraneOriginLocVecs); 
    
create_ent(id"pack""models/cod_carepackage.mdl"16LocVecs); 


public 
pickup_pack(info[2]) 

    new 
id info[0]; 
    new 
ent info[1]; 
    
    if(!
is_user_connected(id) || !is_user_alive(id)) 
        return; 
    
    new 
weapons[32], weaponsnum
    
get_user_weapons(idweaponsweaponsnum); 
    for(new 
i=0i<weaponsnumi++) 
        if(
maxAmmo[weapons[i]] > 0
        
cs_set_user_bpammo(idweapons[i], maxAmmo[weapons[i]]); 
    
    
give_item(id"weapon_hegrenade"); 
    
give_item(id"weapon_flashbang"); 
    
give_item(id"weapon_flashbang");             
    
give_item(id"weapon_smokegrenade"); 
    
    switch(
random(5))     
    { 
        case 
0
        { 
            
predator[id] = true
            
client_cmd(id"spk sound/mw/predator_give.wav"); 
        } 
        case 
1
        { 
            
nalot[id] = true
            
client_cmd(id"spk sound/mw/air_give.wav"); 
        } 
        case 
2
        { 
            
sentrys[id] = true
            
client_cmd(id"spk sound/mw/sentrygun_give.wav"); 
        } 
    }         
    
remove_entity(ent); 


public 
client_PreThink(id
{     
    if(!
is_user_alive(id)) 
        return 
PLUGIN_CONTINUE;                 
    if(
user_controll[id]) 
    { 
        new 
ent2 user_controll[id]; 
        if(
is_valid_ent(ent2)) 
        { 
            new 
Float:Velocity[3], Float:Angle[3]; 
            
velocity_by_aim(id500Velocity); 
            
entity_get_vector(idEV_VEC_v_angleAngle); 
            
            
entity_set_vector(ent2EV_VEC_velocityVelocity); 
            
entity_set_vector(ent2EV_VEC_anglesAngle); 
        } 
        else 
            
attach_view(idid); 
    } 
    static 
ent_id[MAX+1]; 
    new 
ent find_drop_pack(id"pack"); 
    if(
is_valid_ent(ent)) 
    { 
        if(!
task_exists(2571+ent)) 
        { 
            
ent_id[id] = ent
            
bartime(id3)     
            
            new 
info[2]; 
            
info[0] = id
            
info[1] = ent
            
set_task(3.0"pickup_pack"2571+entinfo2); 
        } 
    } 
    else 
    { 
        if(
task_exists(2571+ent_id[id])) 
        { 
            
remove_task(2571+ent_id[id]); 
            
bartime(id0); 
            
ent_id[id] = 0
        } 
    } 
    return 
PLUGIN_CONTINUE


public 
CurWeapon(id

    if(
get_user_team(id) != get_user_team(emp_czasowe) && emp_czasowe
    { 
        
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("HideWeapon"), _id);  
        
write_byte(0x29); //(1<<0)|(1<<3)|(1<<5) 
        
message_end();  
    } 


//nuke 
public CreateNuke(id

    new 
numplayers[32]; 
    
get_players(playersnum"gh"); 
    for(new 
0numa++) 
    { 
        new 
players[a]; 
        if(
is_user_alive(i)) 
            
Display_Fade(i,(10<<12),(10<<12),(1<<16),2554242,171); 
        
        if(
get_user_team(id) != get_user_team(i)) 
            
client_cmd(i"spk sound/mw/nuke_enemy.wav"); 
        else 
            
client_cmd(i"spk sound/mw/nuke_friend.wav"); 
    } 
    
print_info(id"Nuke""e"); 
    
set_task(10.0,"shakehud"); 
    
set_task(13.5,"del_nuke"id); 
    
nuke[id] = false


public 
shakehud() 

    new 
numplayers[32]; 
    
get_players(playersnum"gh"); 
    for(new 
0numa++) 
    { 
        new 
players[a]; 
        if(
is_user_alive(i)) 
        { 
            
Display_Fade(i,(3<<12),(3<<12),(1<<16),2558542,215); 
            
message_begin(MSG_ONEget_user_msgid("ScreenShake"), {0,0,0}, i); 
            
write_short(255<<12); 
            
write_short(4<<12); 
            
write_short(255<<12); 
            
message_end(); 
        } 
    } 


public 
del_nuke(id

    new 
numplayers[32]; 
    
get_players(playersnum"gh"); 
    for(new 
0numa++) 
    { 
        new 
players[a]; 
        if(
is_user_alive(i)) 
        { 
            if(
get_user_team(id) != get_user_team(i)) 
            { 
                
cs_set_user_armor(i0CS_ARMOR_NONE); 
                
UTIL_Kill(idifloat(get_user_health(i)), DMG_BULLET
            } 
            else 
                
user_silentkill(i); 
        } 
    } 
    
nuke_player[id] = false
    
licznik_zabic[id] = 0


//nalot 
public CreateNalot(id

    new 
numplayers[32]; 
    
get_players(playersnum"gh"); 
    for(new 
0numa++) 
    { 
        new 
players[a]; 
        if(
get_user_team(id) != get_user_team(i)) 
            
client_cmd(i"spk sound/mw/air_enemy.wav"); 
        else 
            
client_cmd(i"spk sound/mw/air_friend.wav"); 
    } 
    
print_info(id"Airstrike"); 
    
set_task(1.0"CreateBombs"id+997__"a"3); 
    
CreatePlane(id); 
    
nalot[id] = false


public 
CreateBombs(taskid
{     
    new 
id = (taskid-997); 
    
    new 
radlocation[3]; 
    
PobraneOrigin[0] += random_num(-300,300); 
    
PobraneOrigin[1] += random_num(-300,300); 
    
PobraneOrigin[2] += 50
    
    for(new 
i=0i<15i++)  
    { 
        
radlocation[0] = PobraneOrigin[0]+1*random_num(-150,150);  
        
radlocation[1] = PobraneOrigin[1]+1*random_num(-150,150);  
        
radlocation[2] = PobraneOrigin[2];  
        
        new 
Float:LocVec[3];  
        
IVecFVec(radlocationLocVec);  
        
create_ent(id"bomb""models/p_hegrenade.mdl"210LocVec); 
    } 
}   

public 
CreatePlane(id

    new 
Float:Origin[3], Float:Angle[3], Float:Velocity[3], ent
    
    
get_user_origin(idPobraneOrigin3); 
    
    
velocity_by_aim(id1000Velocity); 
    
entity_get_vector(idEV_VEC_originOrigin); 
    
entity_get_vector(idEV_VEC_v_angleAngle); 
    
    
Angle[0] = Velocity[2] = 0.0
    
Origin[2] += 200.0
    
    
create_ent(id"samolot""models/cod_plane.mdl"28Originent); 
    
    
entity_set_vector(entEV_VEC_velocityVelocity); 
    
entity_set_vector(entEV_VEC_anglesAngle); 
    
    
emit_sound(entCHAN_ITEM"mw/jet_fly1.wav"1.0ATTN_NORM0PITCH_NORM); 
    
set_task(4.5"del_plane"ent+5731); 


public 
del_plane(taskid
    
remove_entity(taskid-5731); 

public 
touchedrocket(entid

    if(!
is_valid_ent(ent)) 
        return 
PLUGIN_CONTINUE
    
    
bombs_explode(ent100.0150.0); 
    return 
PLUGIN_CONTINUE


//predator 
public CreatePredator(id

    new 
numplayers[32]; 
    
get_players(playersnum"gh"); 
    for(new 
0numa++) 
    { 
        new 
players[a]; 
        if(
get_user_team(id) != get_user_team(i)) 
            
client_cmd(i"spk sound/mw/predator_enemy.wav"); 
        else 
            
client_cmd(i"spk sound/mw/predator_friend.wav"); 
    } 
    
print_info(id"Predator Missle"); 
    
    new 
Float:Origin[3], Float:Angle[3], Float:Velocity[3], ent
    
    
velocity_by_aim(id700Velocity); 
    
entity_get_vector(idEV_VEC_originOrigin); 
    
entity_get_vector(idEV_VEC_v_angleAngle); 
    
    
Angle[0] *= -1.0
    
    
create_ent(id"predator""models/cod_predator.mdl"25Originent); 
    
    
entity_set_vector(entEV_VEC_velocityVelocity); 
    
entity_set_vector(entEV_VEC_anglesAngle); 
    
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY); 
    
write_byte(TE_BEAMFOLLOW); 
    
write_short(ent); 
    
write_short(cache_trail); 
    
write_byte(10); 
    
write_byte(5); 
    
write_byte(205); 
    
write_byte(237); 
    
write_byte(163); 
    
write_byte(200); 
    
message_end(); 
    
    
predator[id] = false
    
    
attach_view(ident); 
    
user_controll[id] = ent
}  

public 
touchedpredator(entid

    if(!
is_valid_ent(ent)) 
        return 
PLUGIN_CONTINUE
    
    new 
owner entity_get_edict(entEV_ENT_owner); 
    
bombs_explode(ent220.0400.0); 
    
attach_view(ownerowner); 
    
user_controll[owner] = 0
    return 
PLUGIN_CONTINUE


//sentry gun 
public CreateSentry(id)  

    if(!(
entity_get_int(idEV_INT_flags) & FL_ONGROUND))  
        return; 
    
    new 
entlist[3]; 
    if(
find_sphere_class(id"func_bomb_target"650.0entlist2)) 
    { 
        
client_print(idprint_chat"[KillStrike] Jestes zbyt blisko BS'A."); 
        return; 
    } 
    if(
find_sphere_class(id"func_buyzone"650.0entlist2)) 
    { 
        
client_print(idprint_chat"[KillStrike] Jestes zbyt blisko Respa."); 
        return; 
    } 
    new 
numplayers[32], Float:Origin[3]; 
    
get_players(playersnum"gh"); 
    for(new 
0numa++) 
    { 
        new 
players[a]; 
        if(
get_user_team(id) != get_user_team(i)) 
            
client_cmd(i"spk sound/mw/sentrygun_enemy.wav"); 
        else 
            
client_cmd(i"spk sound/mw/sentrygun_friend.wav"); 
    } 
    
print_info(id"Sentry Gun"); 
    
    
entity_get_vector(idEV_VEC_originOrigin); 
    
Origin[2] += 45.0
    
    new 
health[12], ent create_entity("func_breakable"); 
    
get_cvar_string("ks_hpsentry",healthcharsmax(health)); 
    
    
DispatchKeyValue(ent"health"health); 
    
DispatchKeyValue(ent"material""6"); 
    
    
entity_set_string(entEV_SZ_classname"sentry"); 
    
entity_set_model(ent"models/sentrygun_mw2.mdl"); 
    
    
entity_set_float(entEV_FL_takedamageDAMAGE_YES); 
    
    
entity_set_size(entFloat:{-16.0, -16.00.0}, Float:{16.016.048.0}); 
    
    
entity_set_origin(entOrigin); 
    
entity_set_int(entEV_INT_solidSOLID_SLIDEBOX); 
    
entity_set_int(entEV_INT_movetypeMOVETYPE_TOSS); 
    
entity_set_int(entEV_INT_iuser2id); 
    
entity_set_vector(entEV_VEC_anglesFloat:{0.00.00.0}); 
    
entity_set_byte(entEV_BYTE_controller2127); 
    
    
entity_set_float(entEV_FL_nextthinkget_gametime()+1.0); 
    
    
sentrys[id] = false
    
emit_sound(entCHAN_ITEM"mw/plant.wav"1.0ATTN_NORM0PITCH_NORM); 


public 
SentryThink(ent

    if(!
is_valid_ent(ent))  
        return 
PLUGIN_CONTINUE
    
    new 
Float:SentryOrigin[3], Float:closestOrigin[3]; 
    
entity_get_vector(entEV_VEC_originSentryOrigin); 
    
    new 
id entity_get_int(entEV_INT_iuser2); 
    new 
target entity_get_edict(entEV_ENT_euser1); 
    new 
firemods entity_get_int(entEV_INT_iuser1); 
    
    if(
firemods
    {  
        if(
/*ExecuteHam(Ham_FVisible, target, ent)*/fm_is_ent_visible(targetent) && is_user_alive(target))  
        { 
            if(
UTIL_In_FOV(target,ent)) 
            { 
                goto 
fireoff
            } 
            
            new 
Float:TargetOrigin[3]; 
            
entity_get_vector(targetEV_VEC_originTargetOrigin); 
            
            
emit_sound(entCHAN_AUTO"mw/firemw.wav"1.0ATTN_NORM0PITCH_NORM); 
            
sentry_turntotarget(entSentryOriginTargetOrigin); 
            
            new 
Float:hitRatio random_float(0.01.0) - 0.2
            if(
hitRatio <= 0.0
            { 
                
UTIL_Kill(idtargetrandom_float(5.035.0), DMG_BULLET1); 
                
                
message_begin(MSG_BROADCASTSVC_TEMPENTITY); 
                
write_byte(TE_TRACER); 
                
write_coord(floatround(SentryOrigin[0])); 
                
write_coord(floatround(SentryOrigin[1])); 
                
write_coord(floatround(SentryOrigin[2])); 
                
write_coord(floatround(TargetOrigin[0])); 
                
write_coord(floatround(TargetOrigin[1])); 
                
write_coord(floatround(TargetOrigin[2])); 
                
message_end(); 
            } 
            
entity_set_float(entEV_FL_nextthinkget_gametime()+0.1); 
            return 
PLUGIN_CONTINUE
        } 
        else 
        { 
            
fireoff
            
firemods 0
            
entity_set_int(entEV_INT_iuser10); 
            
entity_set_edict(entEV_ENT_euser10); 
            
emit_sound(entCHAN_AUTO"mw/sentrygun_stops.wav"1.0ATTN_NORM0PITCH_NORM); 
            
            
entity_set_float(entEV_FL_nextthinkget_gametime()+1.0); 
            return 
PLUGIN_CONTINUE
        } 
    } 
    
    new 
closestTarget getClosestPlayer(ent
    if(
closestTarget
    { 
        
emit_sound(entCHAN_AUTO"mw/sentrygun_starts.wav"1.0ATTN_NORM0PITCH_NORM); 
        
entity_get_vector(closestTargetEV_VEC_originclosestOrigin); 
        
sentry_turntotarget(entSentryOriginclosestOrigin); 
        
        
entity_set_int(entEV_INT_iuser11); 
        
entity_set_edict(entEV_ENT_euser1closestTarget); 
        
        
entity_set_float(entEV_FL_nextthinkget_gametime()+1.0); 
        return 
PLUGIN_CONTINUE
    } 
    
    if(!
firemods
    { 
        new 
controler1 entity_get_byte(entEV_BYTE_controller1)+1
        if(
controler1 255
            
controler1 0
        
entity_set_byte(entEV_BYTE_controller1controler1); 
        
        new 
controler2 entity_get_byte(entEV_BYTE_controller2); 
        if(
controler2 127 || controler2 127
            
entity_set_byte(entEV_BYTE_controller2127); 
        
        
entity_set_float(entEV_FL_nextthinkget_gametime()+0.05); 
    } 
    return 
PLUGIN_CONTINUE 


public 
sentry_turntotarget(entFloat:sentryOrigin[3], Float:closestOrigin[3])  

    new 
newTripFloat:newAngle floatatan(((closestOrigin[1]-sentryOrigin[1])/(closestOrigin[0]-sentryOrigin[0])), radian) * 57.2957795
    
    if(
closestOrigin[0] < sentryOrigin[0]) 
        
newAngle += 180.0
    if(
newAngle 0.0
        
newAngle += 360.0
    
    
sentryOrigin[2] += 35.0 
    
if(closestOrigin[2] > sentryOrigin[2]) 
        
newTrip 0
    if(
closestOrigin[2] < sentryOrigin[2]) 
        
newTrip 255
    if(
closestOrigin[2] == sentryOrigin[2]) 
        
newTrip 127
    
    
entity_set_byte(entEV_BYTE_controller1,floatround(newAngle*0.70833)); 
    
entity_set_byte(entEV_BYTE_controller2newTrip); 
    
entity_set_byte(entEV_BYTE_controller3entity_get_byte(entEV_BYTE_controller3)+20>2550entity_get_byte(entEV_BYTE_controller3)+20); 


public 
TakeDamage(entidinflictorattackerFloat:damagedamagebits

    if(!
is_user_alive(attacker)) 
        return 
HAM_IGNORED
    
    new 
classname[32]; 
    
entity_get_string(entEV_SZ_classnameclassname31); 
    
    if(
equal(classname"sentry"))  
    { 
        new 
id entity_get_int(entEV_INT_iuser2); 
        if(
get_user_team(attacker) == get_user_team(id)) 
            return 
HAM_SUPERCEDE
        
        if(
damage >= entity_get_float(entEV_FL_health)) 
        { 
            new 
Float:Origin[3]; 
            
entity_get_vector(entEV_VEC_originOrigin);     
            new 
entlist[33]; 
            new 
numfound find_sphere_class(ent"player"190.0entlist32); 
            
            for(new 
i=0numfoundi++) 
            {         
                new 
pid entlist[i]; 
                
                if(!
is_user_alive(pid) || get_user_team(id) == get_user_team(pid)) 
                    continue; 
                
UTIL_Kill(idpid70.0, (1<<24)); 
            } 
            
client_cmd(id"spk sound/mw/sentrygun_gone.wav"); 
            
//Sprite_Blast(Origin); 
            //remove_entity(ent); //jak to dam to cresh serwer bo odrazu usuwa sentry guna :O 
            
set_task(1.0"del_sentry"ent); //jak tego nie dam to sentry jest jako byt i strzela 
        

    } 
    return 
HAM_IGNORED


public 
del_sentry(ent
    
remove_entity(ent); 

//wybuch 
bombs_explode(entFloat:zadajeFloat:promien) { 
    if(!
is_valid_ent(ent))  
        return; 
    
    new 
attacker entity_get_edict(entEV_ENT_owner); 
    
    new 
Float:entOrigin[3], Float:fDamageFloat:Origin[3]; 
    
entity_get_vector(entEV_VEC_originentOrigin); 
    
entOrigin[2] += 1.0
    
    new 
entlist[33]; 
    new 
numfound find_sphere_class(ent"player"promienentlist32);     
    for(new 
i=0numfoundi++) 
    {         
        new 
victim entlist[i];         
        if(!
is_user_alive(victim) || get_user_team(attacker) == get_user_team(victim)) 
            continue; 
        
        
entity_get_vector(victimEV_VEC_originOrigin); 
        
fDamage zadaje floatmul(zadajefloatdiv(get_distance_f(OriginentOrigin), promien)); 
        
fDamage *= estimate_take_hurt(entOriginvictim0); 
        if(
fDamage>0.0
            
UTIL_Kill(attackervictimfDamageDMG_BULLET); 
    } 
    
Sprite_Blast(entOrigin); 
    
remove_entity(ent); 


public 
cmdKill() 
    return 
FMRES_SUPERCEDE

public 
message_DeathMsg() 

    new 
killer get_msg_arg_int(1); 
    if(
ZmienKilla[0] & (1<<killer)) 
    { 
        
set_msg_arg_string(4"grenade"); 
        return 
PLUGIN_CONTINUE
    } 
    if(
ZmienKilla[1] & (1<<killer)) 
    { 
        
set_msg_arg_string(4"m249"); 
        return 
PLUGIN_CONTINUE
    } 
    return 
PLUGIN_CONTINUE


stock create_ent(idszName[], szModel[], iSolidiMovetypeFloat:fOrigin[3], &ent=-1

    new 
ent1 create_entity("info_target"); 
    
entity_set_string(ent1EV_SZ_classnameszName); 
    
entity_set_model(ent1szModel); 
    
entity_set_int(ent1EV_INT_solidiSolid); 
    
entity_set_int(ent1EV_INT_movetypeiMovetype); 
    
entity_set_edict(ent1EV_ENT_ownerid); 
    
entity_set_origin(ent1fOrigin); 
    
    if(
ent != -1
        
ent ent1


stock Sprite_Blast(Float:iOrigin[3]) 

    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY); 
    
write_byte(TE_EXPLOSION); 
    
write_coord(floatround(iOrigin[0])); 
    
write_coord(floatround(iOrigin[1]));  
    
write_coord(floatround(iOrigin[2])); 
    
write_short(sprite_blast); 
    
write_byte(32); 
    
write_byte(20);  
    
write_byte(0); 
    
message_end(); 


stock Float:estimate_take_hurt(Float:fPoint[3], entignored)  

    new 
Float:fFractionFloat:fOrigin[3], tr
    
entity_get_vector(entEV_VEC_originfOrigin); 
    
engfunc(EngFunc_TraceLinefPointfOriginDONT_IGNORE_MONSTERSignoredtr); 
    
get_tr2(trTR_flFractionfFraction); 
    if(
fFraction == 1.0 || get_tr2(trTR_pHit) == ent
        return 
1.0
    return 
0.6


stock bartime(idnumber

    
message_begin(MSG_ONEget_user_msgid("BarTime"), _id); 
    
write_short(number); 
    
message_end();     


stock Display_Fade(id,duration,holdtime,fadetype,red,green,blue,alpha

    
message_begin(MSG_ONEget_user_msgid("ScreenFade"),{0,0,0},id); 
    
write_short(duration); 
    
write_short(holdtime); 
    
write_short(fadetype); 
    
write_byte(red); 
    
write_byte(green); 
    
write_byte(blue); 
    
write_byte(alpha); 
    
message_end(); 


stock find_drop_pack(id, const class[]) 

    new 
Float:origin[3], classname[32], ent
    
entity_get_vector(idEV_VEC_originorigin); 
    
    while((
ent find_ent_in_sphere(entorigin75.0)) != 0)  
    { 
        
entity_get_string(entEV_SZ_classnameclassname31); 
        if(
equali(classname, class)) 
            return 
ent
    } 
    return 
0


stock print_info(id, const nagroda[], const nazwa[] = "y"

    new 
nick[64]; 
    
get_user_name(idnick63); 
    
client_print(0print_chat"%s wezwan%s przez %s"nagrodanazwanick); 


stock UTIL_Kill(atakujacyobrywajacyFloat:damagedamagebitsile=0

    
ZmienKilla[ile] |= (1<<atakujacy); 
    
ExecuteHam(Ham_TakeDamageobrywajacyatakujacyatakujacydamagedamagebits); 
    
ZmienKilla[ile] &= ~(1<<atakujacy); 


stock getClosestPlayer(ent

    new 
iClosestPlayer 0Float:flClosestDist MAX_DISTFloat:flDistanseFloat:fOrigin[2][3]; 
    new 
numplayers[32]; 
    
get_players(playersnum"gh"
    for(new 
0numa++) 
    { 
        new 
players[a]; 
        if(!
is_user_connected(i) || !is_user_alive(i) || /*!ExecuteHam(Ham_FVisible, i, ent)*/!fm_is_ent_visible(ient) || get_user_team(i) == get_user_team(entity_get_int(entEV_INT_iuser2))) 
            continue; 
        
        if(
UTIL_In_FOV(ient)) 
            continue; 
        
        
entity_get_vector(iEV_VEC_originfOrigin[0]); 
        
entity_get_vector(entEV_VEC_originfOrigin[1]); 
        
        
flDistanse get_distance_f(fOrigin[0], fOrigin[1]); 
        
        if(
flDistanse <= flClosestDist
        { 
            
iClosestPlayer i
            
flClosestDist flDistanse
        } 
    } 
    return 
iClosestPlayer


stock bool:UTIL_In_FOV(id,ent

    if((
get_pdata_int(id510) & (1<<16)) && (Find_Angle(ident) > 0.0)) 
        return 
true
    return 
false


stock Float:Find_Angle(idtarget

    new 
Float:Origin[3], Float:TargetOrigin[3]; 
    
pev(id,pev_originOrigin); 
    
pev(target,pev_origin,TargetOrigin); 
    
    new 
Float:Angles[3], Float:vec2LOS[3]; 
    
pev(id,pev_anglesAngles); 
    
    
xs_vec_sub(TargetOriginOriginvec2LOS); 
    
vec2LOS[2] = 0.0
    
    new 
Float:veclength vector_length(vec2LOS); 
    if (
veclength <= 0.0
        
vec2LOS[0] = vec2LOS[1] = 0.0
    else 
    { 
        new 
Float:flLen 1.0 veclength
        
vec2LOS[0] = vec2LOS[0]*flLen
        
vec2LOS[1] = vec2LOS[1]*flLen
    } 
    
engfunc(EngFunc_MakeVectorsAngles); 
    
    new 
Float:v_forward[3]; 
    
get_global_vector(GL_v_forwardv_forward); 
    
    new 
Float:flDot vec2LOS[0]*v_forward[0]+vec2LOS[1]*v_forward[1]; 
    if(
flDot 0.5
        return 
flDot
    
    return 
0.0


stock bool:fm_is_ent_visible(indexentityignoremonsters 0) { 
    new 
Float:start[3], Float:dest[3]; 
    
pev(indexpev_originstart); 
    
pev(indexpev_view_ofsdest); 
    
xs_vec_add(startdeststart); 
    
    
pev(entitypev_origindest); 
    
engfunc(EngFunc_TraceLinestartdestignoremonstersindex0); 
    
    new 
Float:fraction
    
get_tr2(0TR_flFractionfraction); 
    if (
fraction == 1.0 || get_tr2(0TR_pHit) == entity
        return 
true
    
    return 
false

sekac is offline
eNNkds
Member
Join Date: Sep 2012
Location: Romania
Old 04-17-2018 , 16:19   Re: Request Delete something in this plugin.
Reply With Quote #4

i will post tomorrow if its works.. thank you for helping
eNNkds is offline
Send a message via Skype™ to eNNkds
eNNkds
Member
Join Date: Sep 2012
Location: Romania
Old 04-21-2018 , 13:28   Re: Request Delete something in this plugin.
Reply With Quote #5

Code:
L 04/21/2018 - 20:21:29: Info (map "bb_dust2") (file "addons/amxmodx/logs/error_20180421.log")
L 04/21/2018 - 20:21:29: Function is not present (function "radar_scan") (plugin "streak.amxx")
L 04/21/2018 - 20:21:29: [AMXX] Displaying debug trace (plugin "streak.amxx")
L 04/21/2018 - 20:21:29: [AMXX] Run time error 10: native error (native "set_task")
L 04/21/2018 - 20:21:29: [AMXX]    [0] streak.sma::plugin_init (line 51)
eNNkds is offline
Send a message via Skype™ to eNNkds
sekac
Senior Member
Join Date: Nov 2016
Old 04-21-2018 , 18:08   Re: Request Delete something in this plugin.
Reply With Quote #6

Quote:
Originally Posted by eNNkds View Post
Code:
L 04/21/2018 - 20:21:29: Info (map "bb_dust2") (file "addons/amxmodx/logs/error_20180421.log")
L 04/21/2018 - 20:21:29: Function is not present (function "radar_scan") (plugin "streak.amxx")
L 04/21/2018 - 20:21:29: [AMXX] Displaying debug trace (plugin "streak.amxx")
L 04/21/2018 - 20:21:29: [AMXX] Run time error 10: native error (native "set_task")
L 04/21/2018 - 20:21:29: [AMXX]    [0] streak.sma::plugin_init (line 51)
Well I don't have time for this now, but try adding this function at the bottom.

PHP Code:
public radar_scan() 

    new 
numplayers[32]; 
    
get_players(playersnum"gh"
    for(new 
i=0i<numi++) 
    { 
        new 
id players[i]; 
        if(!
is_user_alive(id) || !radar[get_user_team(id) == 101]) 
            continue; 
        
        if(!
emp_czasowe
            
radar_continue(id
        else if(
get_user_team(id) == get_user_team(emp_czasowe)) 
            
radar_continue(id
    } 

sekac is offline
eNNkds
Member
Join Date: Sep 2012
Location: Romania
Old 04-22-2018 , 09:45   Re: Request Delete something in this plugin.
Reply With Quote #7

the public radar_scan don't work .. i think the problem it was this line.
Code:
set_task(2.0,"radar_scan",_,_,_,"b");
and i have a question.. how to set(Create) cvar to the sentry/predator/airstrike damage make?
eNNkds is offline
Send a message via Skype™ to eNNkds
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:21.


Powered by vBulletin®
Copyright ©2000 - 2022, vBulletin Solutions, Inc.
Theme made by Freecode