Raised This Month: $51 Target: $400
 12% 

Help / Support [Laser MIne]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
amir saiaoud
Senior Member
Join Date: May 2015
Location: essaouira , maroc
Old 10-13-2015 , 08:24   [Laser MIne]
Reply With Quote #1

I need laser mine can set and dellet only by his owner and only human's nOt FOR cs team and only zombie can hit it :/
soory for my bad english
__________________

Last edited by amir saiaoud; 10-13-2015 at 14:28.
amir saiaoud is offline
Send a message via Skype™ to amir saiaoud
Chihuahuax
Senior Member
Join Date: Oct 2014
Location: Malaysia
Old 10-13-2015 , 09:10   Re: [Laser MIne]
Reply With Quote #2

https://forums.alliedmods.net/showpo...8&postcount=81
Chihuahuax is offline
Send a message via Skype™ to Chihuahuax
amir saiaoud
Senior Member
Join Date: May 2015
Location: essaouira , maroc
Old 10-13-2015 , 13:27   Re: [Laser MIne]
Reply With Quote #3

not this one bro :/
__________________
amir saiaoud is offline
Send a message via Skype™ to amir saiaoud
dr hicham
Senior Member
Join Date: Sep 2015
Location: Morocco
Old 10-13-2015 , 14:13   Re: [Laser MIne]
Reply With Quote #4

Try This Bro :
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <xs>
#include <zombie_plague_advance>


#if AMXX_VERSION_NUM < 180
    #assert AMX Mod X v1.8.0 or greater library required!
#endif

#define PLUGIN "[ZP] LaserMine Final"
#define VERSION "1.0"
#define AUTHOR "SandStriker / Shidla / QuZ/DJ_WEST / Depresie / WaLkMaN//POLISH TRANSLATE by Truskawkowy "

#define RemoveEntity(%1)    engfunc(EngFunc_RemoveEntity,%1)
#define TASK_PLANT            15100
#define TASK_RESET            15500
#define TASK_RELEASE        15900

#define LASERMINE_TEAM        pev_iuser1 //EV_INT_iuser1
#define LASERMINE_OWNER        pev_iuser2 //EV_INT_iuser3
#define LASERMINE_STEP        pev_iuser3
#define LASERMINE_HITING    pev_iuser4
#define LASERMINE_COUNT        pev_fuser1

#define LASERMINE_POWERUP    pev_fuser2
#define LASERMINE_BEAMTHINK    pev_fuser3

#define LASERMINE_BEAMENDPOINT    pev_vuser1
#define MAX_MINES            10
#define MODE_LASERMINE        0
#define OFFSET_TEAM            114
#define OFFSET_MONEY        115
#define OFFSET_DEATH        444

#define cs_get_user_team(%1)    CsTeams:get_offset_value(%1,OFFSET_TEAM)
#define cs_get_user_deaths(%1)    get_offset_value(%1,OFFSET_DEATH)

// ???? ?? ???? ???????????? ? ????. ???????? ???? ???????? ??????!
new const LMCost 0


/*########### ????? ??? ? ???????? ????? ###########*/
// ???? ???? ? ?????? ?????
new const
    
Red_Hum        172,
    
Green_Hum     151,
    
Blue_Hum    94;

// ???? ???? ? ?????? ?????
new const
    
Red_Zomb    0,
    
Green_Zomb     255,
    
Blue_Zomb    0;
/*####### ????? ??? ? ???????? ????? (?????) #######*/

enum CsTeams {
CS_TEAM_UNASSIGNED 0,
CS_TEAM_T 1,
CS_TEAM_CT 2,
CS_TEAM_SPECTATOR 3
};

enum tripmine_e {
    
TRIPMINE_IDLE1 0,
    
TRIPMINE_IDLE2,
    
TRIPMINE_ARM1,
    
TRIPMINE_ARM2,
    
TRIPMINE_FIDGET,
    
TRIPMINE_HOLSTER,
    
TRIPMINE_DRAW,
    
TRIPMINE_WORLD,
    
TRIPMINE_GROUND,
};

enum
{
    
POWERUP_THINK,
    
BEAMBREAK_THINK,
    
EXPLOSE_THINK
};

enum
{
    
POWERUP_SOUND,
    
ACTIVATE_SOUND,
    
STOP_SOUND
};

new const
    
ENT_MODELS[]    = "models/zombie_plague/lasermine_final/v_laser_mine1.mdl",
    
ENT_SOUND1[]    = "weapons/mine_deploy.wav",
    
ENT_SOUND2[]    = "weapons/mine_charge.wav",
    
ENT_SOUND3[]    = "weapons/mine_activate.wav",
    
ENT_SOUND4[]    = "debris/beamstart4.wav",
    
ENT_SOUND5[]    = "items/gunpickup2.wav",
    
ENT_SOUND6[]    = "debris/bustglass1.wav",
    
ENT_SOUND7[]    = "debris/bustglass2.wav",
    
ENT_SPRITE1[]    = "sprites/laserbeam.spr",
    
ENT_SPRITE2[]    = "sprites/lm_explode.spr";

new const
    
ENT_CLASS_NAME[]    =    "lasermine",
    
ENT_CLASS_NAME3[]    =    "func_breakable",
    
gSnarkClassName[]    =    "wpn_snark",    // ??? ????????????? ? ???????? "Snark"
    
barnacle_class[]    =    "barnacle",        // ??? ????????????? ? ???????? "Barnacle"
    
weapon_box[]        =    "weaponbox";

new 
g_EntMinebeamboom
new g_LENABLEg_LFMONEYg_LAMMOg_LDMGg_LBEOg_LTMAXg_LCOSTg_LHEALTHg_LMODEg_LRADIUSg_NOROUNDg_NEMROUNDg_SURVROUNDg_ASSASSINROUNDg_SNIPERROUNDg_LNJROUNDg_PLAGUEROUNDg_AVSg_SWARMROUND
new g_LRDMG,g_LFF,g_LCBTg_LDELAYg_LVISIBLEg_LSTAMMOg_LACCESSg_LGLOWg_LDMGMODEg_LCLMODE
new g_LCBRIGHTg_LDSECg_LCMDMODEg_LBUYMODEg_LME;
new 
g_msgDeathMsg,g_msgScoreInfo,g_msgDamage,g_msgStatusText;
new 
g_dcount[33],g_nowtime,g_MaxPL
new bool:g_settinglaser[33]
new 
Float:plspeed[33], plsetting[33], g_havemine[33], g_deployed[33];
//new CVAR_LMCost

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);

    
// ???????????? ExtraItem

    
g_LME zp_register_extra_item("Laser Mine"LMCostZP_TEAM_ANY)

    
// ???????? ??????? Laser_TakeDamage ??? ????????? ????? ???????? ENT_CLASS_NAME3 (func_breakable)
    
RegisterHam(Ham_TakeDamageENT_CLASS_NAME3"Laser_TakeDamage")
    
// Add your code here...
    
register_clcmd("+setlaser","CreateLaserMine_Progress_b");
    
register_clcmd("-setlaser","StopCreateLaserMine");
    
register_clcmd("+dellaser","ReturnLaserMine_Progress");
    
register_clcmd("-dellaser","StopReturnLaserMine");
    
register_clcmd("say","say_lasermine");
    
register_clcmd("buy_lasermine","BuyLasermine");

    
g_LENABLE    register_cvar("zp_ltm","1")
    
g_LACCESS    register_cvar("zp_ltm_acs","0"//0 all, 1 admin
    
g_LMODE        register_cvar("zp_ltm_mode","0"//0 lasermine, 1 tripmine
    
g_LAMMO        register_cvar("zp_ltm_ammo","5")
    
g_LDMG        register_cvar("zp_ltm_dmg","60"//laser hit dmg
    
g_LCOST        register_cvar("zp_ltm_cost","0")
    
g_LFMONEY    register_cvar("zp_ltm_fragmoney","1")
    
g_LHEALTH    register_cvar("zp_ltm_health","5")
    
g_LTMAX        register_cvar("zp_ltm_teammax","100")
    
g_LRADIUS    register_cvar("zp_ltm_radius","320.0")
    
g_LRDMG        register_cvar("zp_ltm_rdmg","100"//radius damage
    
g_LFF        register_cvar("zp_ltm_ff","0")
    
g_LCBT        register_cvar("zp_ltm_cbt","ALL")
    
g_LDELAY    register_cvar("zp_ltm_delay","0.1")
    
g_LVISIBLE    register_cvar("zp_ltm_line","1")
    
g_LGLOW        register_cvar("zp_ltm_glow","0")
    
g_LCBRIGHT    register_cvar("zp_ltm_bright","255")//laser line brightness.
    
g_LCLMODE    register_cvar("zp_ltm_color","0"//0 is team color,1 is green
    
g_LDMGMODE    register_cvar("zp_ltm_ldmgmode","0"//0 - frame dmg, 1 - once dmg, 2 - 1 second dmg
    
g_LDSEC        register_cvar("zp_ltm_ldmgseconds","1"//mode 2 only, damage / seconds. default 1 (sec)
    
g_LSTAMMO    register_cvar("zp_ltm_startammo","1")
    
g_LBUYMODE    register_cvar("zp_ltm_buymode","1");
    
g_LCMDMODE    register_cvar("zp_ltm_cmdmode","0");        //0 is +USE key, 1 is bind, 2 is each.
    
g_LBEO        register_cvar("zp_ltm_brokeenemy","1");
    
g_NOROUND    register_cvar("zp_ltm_noround","1");
    
g_NEMROUND    register_cvar("zp_ltm_nemround","1");
    
g_SURVROUND    register_cvar("zp_ltm_survround","1");
    
g_AVS        register_cvar("zp_ltm_avsround","1");
    
g_SWARMROUND    register_cvar("zp_ltm_swarmround","1");
    
g_LNJROUND    register_cvar("zp_ltm_lnjround","1");
    
g_ASSASSINROUND register_cvar("zp_ltm_assassinround","1");
    
g_SNIPERROUND   register_cvar("zp_ltm_sniperround","1");
    
g_PLAGUEROUND   register_cvar("zp_ltm_plagueround","1");
     

    
register_event("DeathMsg""DeathEvent""a");
    
register_event("CurWeapon""standing""be""1=1");
    
register_event("ResetHUD""delaycount""a");
    
register_event("ResetHUD""newround""b");
    
register_logevent("endround"2"0=World triggered""1=Round_End");    // ???????????? ????? ??????
    
register_event("Damage","CutDeploy_onDamage","b");
    
g_msgDeathMsg    get_user_msgid("DeathMsg");
    
g_msgScoreInfo    get_user_msgid("ScoreInfo");
    
g_msgDamage        get_user_msgid("Damage");
    
g_msgStatusText get_user_msgid("StatusText");

    
// Forward.
    
register_forward(FM_Think"ltm_Think");
    
register_forward(FM_PlayerPostThink"ltm_PostThink");
    
register_forward(FM_PlayerPreThink"ltm_PreThink");

    
// ??????????? ???? ??????
    
register_dictionary("LaserMines.txt")
    
register_cvar("Shidla""[ZP] LaserMines v.2.8.1 Final"FCVAR_SERVER|FCVAR_SPONLY)

}

public 
plugin_precache() 
{
    
precache_sound(ENT_SOUND1);
    
precache_sound(ENT_SOUND2);
    
precache_sound(ENT_SOUND3);
    
precache_sound(ENT_SOUND4);
    
precache_sound(ENT_SOUND5);
    
precache_sound(ENT_SOUND6);
    
precache_sound(ENT_SOUND7);
    
precache_model(ENT_MODELS);
    
beam precache_model(ENT_SPRITE1);
    
boom precache_model(ENT_SPRITE2);
    return 
PLUGIN_CONTINUE;
}

public 
plugin_modules() 
{
    
require_module("fakemeta");
    
require_module("cstrike");
}

public 
plugin_cfg()
{
    
g_EntMine engfunc(EngFunc_AllocString,ENT_CLASS_NAME3);
    
arrayset(g_havemine,0,sizeof(g_havemine));
    
arrayset(g_deployed,0,sizeof(g_deployed));
    
g_MaxPL get_maxplayers();

    new 
file[64]; get_localinfo("amxx_configsdir",file,63);
    
format(file63"%s/zp_ltm_cvars_ap.cfg"file);
    if(
file_exists(file)) server_cmd("exec %s"file), server_exec();
}

public 
Laser_TakeDamage(victiminflictorattackerFloat:f_Damagebit_Damage)
{
    if(
get_pcvar_num(g_LBEO))
    {
        new 
i_Owner

        
// ???????? ID ??????, ??????? ???????? ????
        
i_Owner pev(victimLASERMINE_OWNER)

        
// ???? ??????? ????, ??? ???????? ???? ? ????, ??? ???????? ?????????
        
if(CsTeams:pev(victimLASERMINE_TEAM) == cs_get_user_team(attacker))
        
// ???? ??? ??? ???????? ????, ?? ????????? ? ???, ??? ?? ????????, ?? ?????????? ??????????
        
if(i_Owner != attacker)
            return 
HAM_SUPERCEDE
        
return PLUGIN_CONTINUE
    
}
    return 
PLUGIN_CONTINUE
}

public 
delaycount(id)
{
    
g_dcount[id] = floatround(get_gametime());
}
bool:CheckTime(id)
{
    
g_nowtime floatround(get_gametime()) - g_dcount[id];

    if(
g_nowtime >= get_pcvar_num(g_LDELAY))
        return 
true;

    return 
false;
}

public 
CreateLaserMine_Progress_b(id)
{
    if(
get_pcvar_num(g_LCMDMODE) != 0)
        
CreateLaserMine_Progress(id);
    return 
PLUGIN_HANDLED;
}

public 
CreateLaserMine_Progress(id)
{
    if(!
CreateCheck(id))
        return 
PLUGIN_HANDLED;
    
g_settinglaser[id] = true;

    
message_begin(MSG_ONE108, {0,0,0}, id);
    
write_byte(1);
    
write_byte(0);
    
message_end();

    
set_task(1.2"Spawn", (TASK_PLANT id));

    return 
PLUGIN_HANDLED;
}

public 
ReturnLaserMine_Progress(id)
{

    if(!
ReturnCheck(id))
        return 
PLUGIN_HANDLED;
    
g_settinglaser[id] = true;

    
message_begin(MSG_ONE108, {0,0,0}, id);
    
write_byte(1);
    
write_byte(0);
    
message_end();

    
set_task(1.2"ReturnMine", (TASK_RELEASE id));

    return 
PLUGIN_HANDLED;
}

public 
StopCreateLaserMine(id)
{

    
DeleteTask(id);
    
message_begin(MSG_ONE108, {0,0,0}, id);
    
write_byte(0);
    
write_byte(0);
    
message_end();

    return 
PLUGIN_HANDLED;
}

public 
StopReturnLaserMine(id)
{

    
DeleteTask(id);
    
message_begin(MSG_ONE108, {0,0,0}, id);
    
write_byte(0);
    
write_byte(0);
    
message_end();

    return 
PLUGIN_HANDLED;
}

public 
ReturnMine(id)
{
    
id -= TASK_RELEASE;
    new 
tgt,body,Float:vo[3],Float:to[3];
    
get_user_aiming(id,tgt,body);
    if(!
pev_valid(tgt)) return;
    
pev(id,pev_origin,vo);
    
pev(tgt,pev_origin,to);
    if(
get_distance_f(vo,to) > 70.0) return;
    new 
EntityName[32];
    
pev(tgtpev_classnameEntityName31);
    if(!
equal(EntityNameENT_CLASS_NAME)) return;
    if(
pev(tgt,LASERMINE_OWNER) != id) return;
    
RemoveEntity(tgt);

    
g_havemine[id] ++;
    
g_deployed[id] --;
    
emit_sound(idCHAN_ITEMENT_SOUND5VOL_NORMATTN_NORM0PITCH_NORM)
    
ShowAmmo(id)

    return;
}

public 
Spawn(id)
{
    
id -= TASK_PLANT
    
// motor
    
new i_Ent engfunc(EngFunc_CreateNamedEntity,g_EntMine);
    if(!
i_Ent)
    {
        
client_print(idprint_chat,"[Laesrmine Debug] Can't Create Entity");
        return 
PLUGIN_HANDLED_MAIN;
    }
    
set_pev(i_Ent,pev_classname,ENT_CLASS_NAME);

    
engfunc(EngFunc_SetModel,i_Ent,ENT_MODELS);

    
set_pev(i_Ent,pev_solid,SOLID_NOT);
    
set_pev(i_Ent,pev_movetype,MOVETYPE_FLY);

    
set_pev(i_Ent,pev_frame,0);
    
set_pev(i_Ent,pev_body,3);
    
set_pev(i_Ent,pev_sequence,TRIPMINE_WORLD);
    
set_pev(i_Ent,pev_framerate,0);
    
set_pev(i_Ent,pev_takedamage,DAMAGE_YES);
    
set_pev(i_Ent,pev_dmg,100.0);
    
set_user_health(i_Ent,get_pcvar_num(g_LHEALTH));
    new 
Float:vOrigin[3];
    new    
Float:vNewOrigin[3],Float:vNormal[3],Float:vTraceDirection[3],
        
Float:vTraceEnd[3],Float:vEntAngles[3];
    
pev(idpev_originvOrigin);
    
velocity_by_aim(id128vTraceDirection);
    
xs_vec_add(vTraceDirectionvOriginvTraceEnd);
    
engfunc(EngFunc_TraceLinevOriginvTraceEndDONT_IGNORE_MONSTERSid0);
    new 
Float:fFraction;
    
get_tr2(0TR_flFractionfFraction);

    
// -- We hit something!
    
if(fFraction 1.0)
    {
        
// -- Save results to be used later.
        
get_tr2(0TR_vecEndPosvTraceEnd);
        
get_tr2(0TR_vecPlaneNormalvNormal);
    }


    
xs_vec_mul_scalar(vNormal8.0vNormal);
    
xs_vec_add(vTraceEndvNormalvNewOrigin);

    
engfunc(EngFunc_SetSizei_EntFloat:{ -4.0, -4.0, -4.0 }, Float:{ 4.04.04.0 });
    
engfunc(EngFunc_SetOrigini_EntvNewOrigin);

    
// -- Rotate tripmine.
    
vector_to_angle(vNormal,vEntAngles);
    
set_pev(i_Ent,pev_angles,vEntAngles);

    
// -- Calculate laser end origin.
    
new Float:vBeamEnd[3], Float:vTracedBeamEnd[3];
         
    
xs_vec_mul_scalar(vNormal8192.0vNormal);
    
xs_vec_add(vNewOriginvNormalvBeamEnd);

    
engfunc(EngFunc_TraceLinevNewOriginvBeamEndIGNORE_MONSTERS, -10);

    
get_tr2(0TR_vecPlaneNormalvNormal);
    
get_tr2(0TR_vecEndPosvTracedBeamEnd);

    
// -- Save results to be used later.
    
set_pev(i_EntLASERMINE_OWNERid);
    
set_pev(i_Ent,LASERMINE_BEAMENDPOINT,vTracedBeamEnd);
    
set_pev(i_Ent,LASERMINE_TEAM,int:cs_get_user_team(id));
    new 
Float:fCurrTime get_gametime();

    
set_pev(i_Ent,LASERMINE_POWERUPfCurrTime 2.5);
    
set_pev(i_Ent,LASERMINE_STEP,POWERUP_THINK);
    
set_pev(i_Ent,pev_nextthinkfCurrTime 0.2);

    
PlaySound(i_Ent,POWERUP_SOUND);
    
g_deployed[id]++;
    
g_havemine[id]--;
    
DeleteTask(id);
    
ShowAmmo(id);
    return 
1;
}

stock TeamDeployedCount(id)
{
    static 
i;
    static 
CsTeams:t;cs_get_user_team(id);
    static 
cnt;cnt=0;

    for(
1;<= g_MaxPL;i++)
    {
        if(
is_user_connected(i))
            if(
== cs_get_user_team(i))
                
cnt += g_deployed[i];
    }

    return 
cnt;
}

bool:CheckCanTeam(id)
{
    new 
arg[5],CsTeam:num;
    
get_pcvar_string(g_LCBT,arg,3);
    if(
equali(arg,"Z"))
    {
        
num CsTeam:CS_TEAM_T;
    }
    else if(
equali(arg,"H"))
    {
        
num CsTeam:CS_TEAM_CT;
    }
    else if(
equali(arg,"ALL") || equali(arg,"HZ") || equali(arg,"ZH"))
    {
        
num CsTeam:CS_TEAM_UNASSIGNED;
    }
    else
    {
        
num CsTeam:CS_TEAM_UNASSIGNED;
    }
    if(
num != CsTeam:CS_TEAM_UNASSIGNED && num != CsTeam:cs_get_user_team(id))
        return 
false;
    return 
true;
}

bool:CanCheck(id,mode)    // ????????: ????? ????? ??????? ????
{
    if(!
get_pcvar_num(g_LENABLE))
    {
        
client_print(idprint_chat"%L %L"id"CHATTAG",id"STR_NOTACTIVE")

        return 
false;
    }
    if(
get_pcvar_num(g_LACCESS) != 0)
        if(!(
get_user_flags(id) & ADMIN_IMMUNITY))
        {
            
client_print(idprint_chat"%L %L"id"CHATTAG",id"STR_NOACCESS")
            return 
false;
        }
    if(!
pev_user_alive(id)) return false;
    if(!
CheckCanTeam(id))
    {
        
client_print(idprint_chat"%L %L"id"CHATTAG",id"STR_CBT")
        return 
false;
    }
    if(
mode == 0)
    {
        if(
g_havemine[id] <= 0)
        {
            
client_print(idprint_chat"%L %L"id"CHATTAG",id"STR_DONTHAVEMINE")
            return 
false;
        }
    }
    if(
mode == 1)
    {
        if(
get_pcvar_num(g_LBUYMODE) == 0)
        {
            
client_print(idprint_chat"%L %L"id"CHATTAG",id"STR_CANTBUY")
            return 
false;
        }
        if(
g_havemine[id] >= get_pcvar_num(g_LAMMO))
        {
            
client_print(idprint_chat"%L %L"id"CHATTAG",id"STR_HAVEMAX")
            return 
false;
        }
        if(
zp_get_user_ammo_packs(id) < get_pcvar_num(g_LCOST))
        {
            
client_print(idprint_chat"%L %L%d %L"id"CHATTAG",id"STR_NOMONEY",get_pcvar_num(g_LCOST),id"STR_NEEDED")
            return 
false;
        }
    }
    if(!
CheckTime(id))
    {
        
client_print(idprint_chat"%L %L %d %L"id"CHATTAG",id"STR_DELAY",get_pcvar_num(g_LDELAY)-g_nowtime,id"STR_SECONDS")
        return 
false;
    }

    return 
true;
}

bool:ReturnCheck(id)
{
    if(!
CanCheck(id,-1)) return false;
    if(
g_havemine[id] + get_pcvar_num(g_LAMMO)) return false;
    new 
tgt,body,Float:vo[3],Float:to[3];
    
get_user_aiming(id,tgt,body);
    if(!
pev_valid(tgt)) return false;
    
pev(id,pev_origin,vo);
    
pev(tgt,pev_origin,to);
    if(
get_distance_f(vo,to) > 70.0) return false;
    new 
EntityName[32];
    
pev(tgtpev_classnameEntityName31);
    if(!
equal(EntityNameENT_CLASS_NAME)) return false;
    if(
pev(tgt,LASERMINE_OWNER) != id) return false;
    return 
true;
}

bool:CreateCheck(id)
{
    if(!
CanCheck(id,0)) return false;

    
// ???????? ?? ??????????
    
if(!zp_has_round_started() && get_pcvar_num(g_NOROUND))
    {
        
client_print(idprint_chat"%L %L"id"CHATTAG",id"STR_NOROUND")
        return 
false;
    }

    if(
zp_is_nemesis_round() && get_pcvar_num(g_NEMROUND))
    {
        
client_print(idprint_chat"%L %L"id"CHATTAG",id"STR_NEMROUND")
        return 
false;
        
    }
    
    if(
zp_is_avs_round() && get_pcvar_num(g_AVS))
    {
        
client_print(idprint_chat"%L %L"id"CHATTAG",id"STR_AVSROUND")
        return 
false;
        
    }
    
    if(
zp_is_assassin_round() && get_pcvar_num(g_ASSASSINROUND))
    {
        
client_print(idprint_chat"%L %L"id"CHATTAG",id"STR_ASSASSINROUND")
        return 
false;
    }

    if(
zp_is_sniper_round() && get_pcvar_num(g_SNIPERROUND))
    {
        
client_print(idprint_chat"%L %L"id"CHATTAG",id"STR_SNIPERROUND")
        return 
false;
    }
    
    if(
zp_is_lnj_round() && get_pcvar_num(g_LNJROUND))
    {
        
client_print(idprint_chat"%L %L"id"CHATTAG",id"STR_LNJROUND")
        return 
false;
    }
    
    if(
zp_is_plague_round() && get_pcvar_num(g_PLAGUEROUND))
    {
        
client_print(idprint_chat"%L %L"id"CHATTAG",id"STR_PLAGUEROUND")
        return 
false;
    }
    
    if(
zp_is_swarm_round() && get_pcvar_num(g_SWARMROUND))
    {
        
client_print(idprint_chat"%L %L"id"CHATTAG",id"STR_PLAGUEROUND")
        return 
false;
    }

    if(
zp_is_survivor_round() && get_pcvar_num(g_SURVROUND))
    {
        
client_print(idprint_chat"%L %L"id"CHATTAG",id"STR_SURVROUND")
        return 
false;
    }

    if(
g_deployed[id] >= get_pcvar_num(g_LAMMO))
    {
        
client_print(idprint_chat"%L %L"id"CHATTAG",id"STR_MAXDEPLOY")
        return 
false;
    }

    if(
TeamDeployedCount(id) >= get_pcvar_num(g_LTMAX))
    {
        
client_print(idprint_chat"%L %L"id"CHATTAG",id"STR_MANYPPL")
        return 
false;
    }
    new 
Float:vTraceDirection[3], Float:vTraceEnd[3],Float:vOrigin[3];
    
pev(idpev_originvOrigin);
    
velocity_by_aim(id128vTraceDirection);
    
xs_vec_add(vTraceDirectionvOriginvTraceEnd);
    
engfunc(EngFunc_TraceLinevOriginvTraceEndDONT_IGNORE_MONSTERSid0);
    new 
Float:fFraction,Float:vTraceNormal[3];
    
get_tr2(0TR_flFractionfFraction);
    
// -- We hit something!
    
if(fFraction 1.0)
    {
        
// -- Save results to be used later.
        
get_tr2(0TR_vecEndPosvTraceEnd);
        
get_tr2(0TR_vecPlaneNormalvTraceNormal);

        return 
true;
    }

    
client_print(idprint_chat"%L %L"id"CHATTAG",id"STR_PLANTWALL")
    
DeleteTask(id);
    
// -- Did not touched something. (not solid)
    
return false;
}

public 
ltm_Think(i_Ent)
{
    if(!
pev_valid(i_Ent))
        return 
FMRES_IGNORED;
    new 
EntityName[32];
    
pev(i_Entpev_classnameEntityName31);
    if(!
get_pcvar_num(g_LENABLE)) return FMRES_IGNORED;
    
// -- Entity is not a tripmine, ignoring the next...
    
if(!equal(EntityNameENT_CLASS_NAME))
        return 
FMRES_IGNORED;

    static 
Float:fCurrTime;
    
fCurrTime get_gametime();

    switch(
pev(i_EntLASERMINE_STEP))
    {
        case 
POWERUP_THINK :
        {
            new 
Float:fPowerupTime;
            
pev(i_EntLASERMINE_POWERUPfPowerupTime);

            if(
fCurrTime fPowerupTime)
            {
                
set_pev(i_Entpev_solidSOLID_BBOX);
                
set_pev(i_EntLASERMINE_STEPBEAMBREAK_THINK);

                
PlaySound(i_EntACTIVATE_SOUND);
            }
            if(
get_pcvar_num(g_LGLOW)!=0)
            {
                if(
get_pcvar_num(g_LCLMODE)==0)
                {
                    switch (
pev(i_Ent,LASERMINE_TEAM))
                    {
                        
// ???? ?????? ?????
                        
case CS_TEAM_Tset_rendering(i_Ent,kRenderFxGlowShell,Red_Zomb,Green_Zomb,Blue_Zomb,kRenderNormal,5);
                        
// ???? ?????? ????????
                        
case CS_TEAM_CT:set_rendering(i_Ent,kRenderFxGlowShell,Red_Hum,Green_Hum,Blue_Hum,kRenderNormal,5);
                    }
                }else
                {
                    
// ???? ??????, ???? ????? "?????????? ??? ????" ????
                    
set_rendering(i_Ent,kRenderFxGlowShell,random_num(50 200),random_num(50 200),random_num(50 200),kRenderNormal,5);
                }
            }
            
set_pev(i_Entpev_nextthinkfCurrTime 0.1);
        }
        case 
BEAMBREAK_THINK :
        {
            static 
Float:vEnd[3],Float:vOrigin[3];
            
pev(i_Entpev_originvOrigin);
            
pev(i_EntLASERMINE_BEAMENDPOINTvEnd);

            static 
iHitFloat:fFraction;
            
engfunc(EngFunc_TraceLinevOriginvEndDONT_IGNORE_MONSTERSi_Ent0);

            
get_tr2(0TR_flFractionfFraction);
            
iHit get_tr2(0TR_pHit);

            
// -- Something has passed the laser.
            
if(fFraction 1.0)
            {
                
// -- Ignoring others tripmines entity.
                
if(pev_valid(iHit))
                {
                    
pev(iHitpev_classnameEntityName31);
                    
// ??????? ?????? ?????
                    
if(!equal(EntityNameENT_CLASS_NAME) && !equal(EntityNamegSnarkClassName) && !equal(EntityNamebarnacle_class) && !equal(EntityNameweapon_box))
                    {
                        
set_pev(i_Entpev_enemyiHit);

                        if(
get_pcvar_num(g_LMODE) == MODE_LASERMINE)
                            
CreateLaserDamage(i_Ent,iHit);
                        else
                            if(
get_pcvar_num(g_LFF) || CsTeams:pev(i_Ent,LASERMINE_TEAM) != cs_get_user_team(iHit))
                                
set_pev(i_EntLASERMINE_STEPEXPLOSE_THINK);

                        if (!
pev_valid(i_Ent))    // ???? ?? ?????? ?????? - ?????? ?? ??????. ??????? DJ_WEST
                            
return FMRES_IGNORED;

                        
set_pev(i_Entpev_nextthinkfCurrTime random_float(0.10.3));
                    }
                }
            }
            if(
get_pcvar_num(g_LDMGMODE)!=0)
                if(
pev(i_Ent,LASERMINE_HITING) != iHit)
                    
set_pev(i_Ent,LASERMINE_HITING,iHit);
 
            
// -- Tripmine is still there.
            
if(pev_valid(i_Ent))
            {
                static 
Float:fHealth;
                
pev(i_Entpev_healthfHealth);

                if(
fHealth <= 0.0 || (pev(i_Ent,pev_flags) & FL_KILLME))
                {
                
set_pev(i_EntLASERMINE_STEPEXPLOSE_THINK);
                
set_pev(i_Entpev_nextthinkfCurrTime random_float(0.10.3));
                }
                                         
                static 
Float:fBeamthink;
                
pev(i_EntLASERMINE_BEAMTHINKfBeamthink);
                         
                if(
fBeamthink fCurrTime && get_pcvar_num(g_LVISIBLE))
                {
                    
DrawLaser(i_EntvOriginvEnd);
                    
set_pev(i_EntLASERMINE_BEAMTHINKfCurrTime 0.1);
                }
                
set_pev(i_Entpev_nextthinkfCurrTime 0.01);
            }
        }
        case 
EXPLOSE_THINK :
        {
            
// -- Stopping entity to think
            
set_pev(i_Entpev_nextthink0.0);
            
PlaySound(i_EntSTOP_SOUND);
            
g_deployed[pev(i_Ent,LASERMINE_OWNER)]--;
            
CreateExplosion(i_Ent);
            
CreateDamage(i_Ent,get_pcvar_float(g_LRDMG),get_pcvar_float(g_LRADIUS))
            
RemoveEntity    (i_Ent);
        }
    }

    return 
FMRES_IGNORED;
}

PlaySound(i_Enti_SoundType)
{
    switch (
i_SoundType)
    {
        case 
POWERUP_SOUND :
        {
            
emit_sound(i_EntCHAN_VOICEENT_SOUND1VOL_NORMATTN_NORM0PITCH_NORM);
            
emit_sound(i_EntCHAN_BODY ENT_SOUND20.2ATTN_NORM0PITCH_NORM);
        }
        case 
ACTIVATE_SOUND :
        {
            
emit_sound(i_EntCHAN_VOICEENT_SOUND30.5ATTN_NORM175);
        }
        case 
STOP_SOUND :
        {
            
emit_sound(i_EntCHAN_BODY ENT_SOUND20.2ATTN_NORMSND_STOPPITCH_NORM);
            
emit_sound(i_EntCHAN_VOICEENT_SOUND30.5ATTN_NORMSND_STOP75);
        }
    }
}

DrawLaser(i_Ent, const Float:v_Origin[3], const Float:v_EndOrigin[3])
{
    new 
tcolor[3];
    new 
teamid pev(i_EntLASERMINE_TEAM);
    if(
get_pcvar_num(g_LCLMODE) == 0)
    {
        switch(
teamid){
            case 
1:{
                
// ???? ???? ??? ?????
                
tcolor[0] = Red_Zomb;
                
tcolor[1] = Green_Zomb;
                
tcolor[2] = Blue_Zomb;
            }
            case 
2:{
                
// ???? ???? ??? ????????
                
tcolor[0] = Red_Hum;
                
tcolor[1] = Green_Hum;
                
tcolor[2] = Blue_Hum;
            }
        }
    }else
    {
        
// ???? ???? ??? ???? ??? ?????? 1-? ??? ??? ????
        
tcolor[0] = random_num(50 200);
        
tcolor[1] = random_num(50 200);
        
tcolor[2] = random_num(50 200);
    }
    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
    
write_byte(TE_BEAMPOINTS);
    
engfunc(EngFunc_WriteCoord,v_Origin[0]);
    
engfunc(EngFunc_WriteCoord,v_Origin[1]);
    
engfunc(EngFunc_WriteCoord,v_Origin[2]);
    
engfunc(EngFunc_WriteCoord,v_EndOrigin[0]); //Random
    
engfunc(EngFunc_WriteCoord,v_EndOrigin[1]); //Random
    
engfunc(EngFunc_WriteCoord,v_EndOrigin[2]); //Random
    
write_short(beam);
    
write_byte(0);
    
write_byte(0);
    
write_byte(1);    //Life
    
write_byte(5);    //Width
    
write_byte(0);    //wave
    
write_byte(tcolor[0]); // r
    
write_byte(tcolor[1]); // g
    
write_byte(tcolor[2]); // b
    
write_byte(get_pcvar_num(g_LCBRIGHT));
    
write_byte(255);
    
message_end();
}

CreateDamage(iCurrent,Float:DmgMAX,Float:Radius)
{
    
// Get given parameters
    
new Float:vecSrc[3];
    
pev(iCurrentpev_originvecSrc);

    new 
AtkID =pev(iCurrent,LASERMINE_OWNER);
    new 
TeamID=pev(iCurrent,LASERMINE_TEAM);

    new 
ent = -1;
    new 
Float:tmpdmg DmgMAX;

    new 
Float:kickback 0.0;
    
// Needed for doing some nice calculations :P
    
new Float:Tabsmin[3], Float:Tabsmax[3];
    new 
Float:vecSpot[3];
    new 
Float:Aabsmin[3], Float:Aabsmax[3];
    new 
Float:vecSee[3];
    new 
trRes;
    new 
Float:flFraction;
    new 
Float:vecEndPos[3];
    new 
Float:distance;
    new 
Float:origin[3], Float:vecPush[3];
    new 
Float:invlen;
    new 
Float:velocity[3];
    new 
iHitHP,iHitTeam;
    
// Calculate falloff
    
new Float:falloff;
    if(
Radius 0.0)
    {
        
falloff DmgMAX Radius;
    } else {
        
falloff 1.0;
    }
    
// Find monsters and players inside a specifiec radius
    
while((ent engfunc(EngFunc_FindEntityInSphereentvecSrcRadius)) != 0)
    {
        if(!
pev_valid(ent)) continue;
        if(!(
pev(entpev_flags) & (FL_CLIENT FL_FAKECLIENT FL_MONSTER)))
        {
            
// Entity is not a player or monster, ignore it
            
continue;
        }
        if(!
pev_user_alive(ent)) continue;
        
// Reset data
        
kickback 1.0;
        
tmpdmg DmgMAX;
        
// The following calculations are provided by Orangutanz, THANKS!
        // We use absmin and absmax for the most accurate information
        
pev(entpev_absminTabsmin);
        
pev(entpev_absmaxTabsmax);
        
xs_vec_add(Tabsmin,Tabsmax,Tabsmin);
        
xs_vec_mul_scalar(Tabsmin,0.5,vecSpot);
        
pev(iCurrentpev_absminAabsmin);
        
pev(iCurrentpev_absmaxAabsmax);
        
xs_vec_add(Aabsmin,Aabsmax,Aabsmin);
        
xs_vec_mul_scalar(Aabsmin,0.5,vecSee);
        
engfunc(EngFunc_TraceLinevecSeevecSpot0iCurrenttrRes);
        
get_tr2(trResTR_flFractionflFraction);
        
// Explosion can 'see' this entity, so hurt them! (or impact through objects has been enabled xD)
        
if(flFraction >= 0.9 || get_tr2(trResTR_pHit) == ent)
        {
            
// Work out the distance between impact and entity
            
get_tr2(trResTR_vecEndPosvecEndPos);
            
distance get_distance_f(vecSrcvecEndPos) * falloff;
            
tmpdmg -= distance;
            if(
tmpdmg 0.0)
                
tmpdmg 0.0;
            
// Kickback Effect
            
if(kickback != 0.0)
            {
                
xs_vec_sub(vecSpot,vecSee,origin);
                
invlen 1.0/get_distance_f(vecSpotvecSee);

                
xs_vec_mul_scalar(origin,invlen,vecPush);
                
pev(entpev_velocityvelocity)
                
xs_vec_mul_scalar(vecPush,tmpdmg,vecPush);
                
xs_vec_mul_scalar(vecPush,kickback,vecPush);
                
xs_vec_add(velocity,vecPush,velocity);
                if(
tmpdmg 60.0)
                {
                    
xs_vec_mul_scalar(velocity,12.0,velocity);
                } else {
                    
xs_vec_mul_scalar(velocity,4.0,velocity);
                }
                if(
velocity[0] != 0.0 || velocity[1] != 0.0 || velocity[2] != 0.0)
                {
                    
// There's some movement todo :)
                    
set_pev(entpev_velocityvelocity)
                }
            }

            
iHitHP pev_user_health(ent) - floatround(tmpdmg)
            
iHitTeam int:cs_get_user_team(ent)
            if(
iHitHP <= 0)
            {
                if(
iHitTeam != TeamID)
                {
                    
zp_set_user_ammo_packs(AtkID,zp_get_user_ammo_packs(AtkID) + get_pcvar_num(g_LFMONEY))
                    
set_score(AtkID,ent,1,iHitHP)
                }else
                {
                    if(
get_pcvar_num(g_LFF))
                    {
                        
zp_set_user_ammo_packs(AtkID,zp_get_user_ammo_packs(AtkID) - get_pcvar_num(g_LFMONEY))
                        
set_score(AtkID,ent,-1,iHitHP)
                    }
                }
            }else
            {
                if(
iHitTeam != TeamID || get_pcvar_num(g_LFF))
                {
                    
//set_pev(Player,pev_health,iHitHP)
                    
set_user_health(entiHitHP)
                    
engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,g_msgDamage,{0.0,0.0,0.0},ent);
                    
write_byte(floatround(tmpdmg))
                    
write_byte(floatround(tmpdmg))
                    
write_long(DMG_BULLET)
                    
engfunc(EngFunc_WriteCoord,vecSrc[0])
                    
engfunc(EngFunc_WriteCoord,vecSrc[1])
                    
engfunc(EngFunc_WriteCoord,vecSrc[2])
                    
message_end()
                }
            }
        }
    }
    return
}

bool:pev_user_alive(ent)
{
    new 
deadflag pev(ent,pev_deadflag);
    if(
deadflag != DEAD_NO)
        return 
false;
    return 
true;
}

CreateExplosion(iCurrent)
{
    new 
Float:vOrigin[3];
    
pev(iCurrent,pev_origin,vOrigin);

    
message_begin(MSG_BROADCASTSVC_TEMPENTITY);
    
write_byte(99); //99 = KillBeam
    
write_short(iCurrent);
    
message_end();

    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYvOrigin0);
    
write_byte(TE_EXPLOSION);
    
engfunc(EngFunc_WriteCoord,vOrigin[0]);
    
engfunc(EngFunc_WriteCoord,vOrigin[1]);
    
engfunc(EngFunc_WriteCoord,vOrigin[2]);
    
write_short(boom);
    
write_byte(30);
    
write_byte(15);
    
write_byte(0);
    
message_end();
}

CreateLaserDamage(iCurrent,isHit)
{
    if(
isHit 0) return PLUGIN_CONTINUE
    
switch(get_pcvar_num(g_LDMGMODE))
    {
        case 
1:
        {
            if(
pev(iCurrent,LASERMINE_HITING) == isHit)
                return 
PLUGIN_CONTINUE
        
}
        case 
2:
        {
            if(
pev(iCurrent,LASERMINE_HITING) == isHit)
            {
                static 
Float:cnt
                
static now,htime;now floatround(get_gametime())

                
pev(iCurrent,LASERMINE_COUNT,cnt)
                
htime floatround(cnt)
                if(
now htime get_pcvar_num(g_LDSEC))
                {
                    return 
PLUGIN_CONTINUE;
                }else{
                    
set_pev(iCurrent,LASERMINE_COUNT,get_gametime())
                }
            }else
            {
                
set_pev(iCurrent,LASERMINE_COUNT,get_gametime())
            }
        }
    }

    new 
Float:vOrigin[3],Float:vEnd[3]
    
pev(iCurrent,pev_origin,vOrigin)
    
pev(iCurrent,pev_vuser1,vEnd)

    new 
teamid pev(iCurrentLASERMINE_TEAM)

    new 
szClassName[32]
    new 
Alive,God
    
new iHitTeam,iHitHP,id
    
new hitscore

    szClassName
[0] = '^0'
    
pev(isHit,pev_classname,szClassName,32)
    if((
pev(isHitpev_flags) & (FL_CLIENT FL_FAKECLIENT FL_MONSTER)))
    {
        
Alive pev_user_alive(isHit)
        
God get_user_godmode(isHit)
        if(!
Alive || God) return PLUGIN_CONTINUE
        iHitTeam 
int:cs_get_user_team(isHit)
        
iHitHP pev_user_health(isHit) - get_pcvar_num(g_LDMG)
        
id pev(iCurrent,LASERMINE_OWNER)//, szNetName[32]
        
if(iHitHP <= 0)
        {
            if(
iHitTeam != teamid)
            {
                
emit_sound(isHitCHAN_WEAPONENT_SOUND41.0ATTN_NORM0PITCH_NORM)
                
hitscore 1
                zp_set_user_ammo_packs
(id,zp_get_user_ammo_packs(id) + get_pcvar_num(g_LFMONEY))
                
set_score(id,isHit,hitscore,iHitHP)
            }else
            {
                if(
get_pcvar_num(g_LFF))
                {
                    
emit_sound(isHitCHAN_WEAPONENT_SOUND41.0ATTN_NORM0PITCH_NORM)
                    
hitscore = -1
                    zp_set_user_ammo_packs
(id,zp_get_user_ammo_packs(id) - get_pcvar_num(g_LFMONEY))
                    
set_score(id,isHit,hitscore,iHitHP)
                }
            }
        }else if(
iHitTeam != teamid || get_pcvar_num(g_LFF))
        {
            
emit_sound(isHitCHAN_WEAPONENT_SOUND41.0ATTN_NORM0PITCH_NORM)
            
set_user_health(isHit,iHitHP)
            
set_pev(iCurrent,LASERMINE_HITING,isHit);
            
engfunc(EngFunc_MessageBegin,MSG_ONE_UNRELIABLE,g_msgDamage,{0.0,0.0,0.0},isHit);
            
write_byte(get_pcvar_num(g_LDMG))
            
write_byte(get_pcvar_num(g_LDMG))
            
write_long(DMG_BULLET)
            
engfunc(EngFunc_WriteCoord,vOrigin[0])
            
engfunc(EngFunc_WriteCoord,vOrigin[1])
            
engfunc(EngFunc_WriteCoord,vOrigin[2])
            
message_end()
        }
    }else if(
equal(szClassNameENT_CLASS_NAME3))
    {
        new 
hl;
        
hl pev_user_health(isHit);
        
set_user_health(isHit,hl-get_pcvar_num(g_LDMG));
    }
    return 
PLUGIN_CONTINUE
}

stock pev_user_health(id)
{
    new 
Float:health
    pev
(id,pev_health,health)
    return 
floatround(health)
}

stock set_user_health(id,health)
{
    
health set_pev(idpev_healthfloat(health)) : dllfunc(DLLFunc_ClientKillid);
}

stock get_user_godmode(index) {
    new 
Float:val
    pev
(indexpev_takedamageval)

    return (
val == DAMAGE_NO)
}

stock set_user_frags(indexfrags)
{
    
set_pev(indexpev_fragsfloat(frags))

    return 
1
}

stock pev_user_frags(index)
{
    new 
Float:frags;
    
pev(index,pev_frags,frags);
    return 
floatround(frags);
}

set_score(id,target,hitscore,HP){

    new 
idfrags pev_user_frags(id) + hitscore// get_user_frags(id) + hitscore
    
set_user_frags(id,idfrags)
    new 
tarfrags pev_user_frags(target) + //get_user_frags(target) + 1
    
set_user_frags(target,tarfrags)
    new 
idteam int:cs_get_user_team(id)
    new 
iddeaths cs_get_user_deaths(id)


    
message_begin(MSG_ALLg_msgDeathMsg, {000} ,0)
    
write_byte(id)
    
write_byte(target)
    
write_byte(0)
    
write_string(ENT_CLASS_NAME)
    
message_end()

    
message_begin(MSG_ALLg_msgScoreInfo)
    
write_byte(id)
    
write_short(idfrags)
    
write_short(iddeaths)
    
write_short(0)
    
write_short(idteam)
    
message_end()

    
set_msg_block(g_msgDeathMsgBLOCK_ONCE)

    
set_user_health(targetHP)

}

public 
BuyLasermine(id)
{
    if(!
CanCheck(id,1)) return PLUGIN_CONTINUE

    zp_set_user_ammo_packs
(id,zp_get_user_ammo_packs(id) - get_pcvar_num(g_LCOST))
    
g_havemine[id]++;

    
client_print(idprint_chat"%L %L"id"CHATTAG",id"STR_BOUGHT")

    
emit_sound(idCHAN_ITEMENT_SOUND5VOL_NORMATTN_NORM0PITCH_NORM)
    
ShowAmmo(id)
    return 
PLUGIN_HANDLED
}

public 
zp_extra_item_selected(iditemid)
{
    if(
itemid == g_LME)
        {
        
zp_set_user_ammo_packs(idzp_get_user_ammo_packs(id) + LMCost)
        
BuyLasermine(id)
        }
    return 
PLUGIN_CONTINUE
}

ShowAmmo(id)

    new 
ammo[51
    new 
PlugStat555 char ];
    
formatex(PlugStatcharsmax(PlugStat), "%L"LANG_PLAYER"STR_STATE")
    
formatex(ammo50"%s %i/%i",PlugStatg_havemine[id],get_pcvar_num(g_LAMMO))

    
message_begin(MSG_ONEg_msgStatusText, {0,0,0}, id
    
write_byte(0
    
write_string(ammo
    
message_end() 


public 
showInfo(id)
{
    
client_print(idprint_chat"%L"id"STR_REF")
}

public 
say_lasermine(id){
    new 
said[32]
    
read_argv(1,said,31);
    if(!
get_pcvar_num(g_LENABLE))
    {
        return 
PLUGIN_CONTINUE
    
}
    if(
equali(said,"/buy lasermine")||equali(said,"/lm")||equali(said,"buy_lasermine")){
        
BuyLasermine(id)
    }else if(
equali(said"lasermine") || equali(said"/lasermine")){
        const 
SIZE 1024
        
new msg[SIZE+1],len 0;
        
len += formatex(msg[len], SIZE len"<html><body>")
        
len += formatex(msg[len], SIZE len"<p><b>LaserMiny</b></p><br/><br/>")
        
len += formatex(msg[len], SIZE len"<p>Mozesz stawiac laserminy tylko na podlodze/scianach.</p><br/>")
        
len += formatex(msg[len], SIZE len"<p>Po dotknieciu, laserminy zadaja obrazenia.</p><br/><br/>")
        
len += formatex(msg[len], SIZE len"<p><b>Bindy oraz komendy na laserminy</b></p><br/><br/>")
        
len += formatex(msg[len], SIZE len"<p><b>Napisz na czacie /buy lasermine</b> lub <b>Say /lm</b> aby kupic lasermine<br/>")
        
len += formatex(msg[len], SIZE len"<b>buy_lasermine</b> Aby kupic laserminy automatycznie, uzyj binda, bind x say /lm<br/>")
        
len += formatex(msg[len], SIZE len"<b>+setlaser</b> Aby postawic lm, musisz zbindowac klawisz: bind p +setlaser<br/>")
        
len += formatex(msg[len], SIZE len"<b>+dellaser</b> Aby sciagnac lm, musisz zbindowac klawisz: bind v +dellaser<br/>")
        
len += formatex(msg[len], SIZE len"<p><b>Plugin spolszczony i skonfigurowany przez <font color=^"#3E8D1F^">Truskawkowy</font> </b></p><br/><br/>")
        
len += formatex(msg[len], SIZE len"<p><b>Zapraszamy na forum! <font color=^"#7D92FF^">Cs-Mazury.cba.pl</font> lub <font color=^"#7D92FF^">Cs-Mazury.pl</font></b></p><br/><br/>")
        
len += formatex(msg[len], SIZE len"</body></html>")
        
show_motd(idmsg"Lasermine Entity help")
        return 
PLUGIN_CONTINUE
    
}
    else if(
containi(said"laser") != -1) {
        
showInfo(id)
        return 
PLUGIN_CONTINUE
    
}
    return 
PLUGIN_CONTINUE
}

public 
standing(id
{
    if(!
g_settinglaser[id])
        return 
PLUGIN_CONTINUE

    set_pev
(idpev_maxspeed1.0)

    return 
PLUGIN_CONTINUE
}

public 
ltm_PostThink(id
{
    if(!
g_settinglaser[id] && plsetting[id]){
        
resetspeed(id)
    }
    else if(
g_settinglaser[id] && !plsetting[id]) {
        
pev(idpev_maxspeed,plspeed[id])
        
set_pev(idpev_maxspeed1.0)
    }
    
plsetting[id] = g_settinglaser[id]
    return 
FMRES_IGNORED
}

public 
ltm_PreThink(id)
{
    if(!
pev_user_alive(id) || g_settinglaser[id] == true || is_user_bot(id) || get_pcvar_num(g_LCMDMODE) == 1)
        return 
FMRES_IGNORED;

    if(
pev(idpev_button) & IN_USE && !(pev(idpev_oldbuttons) & IN_USE))
        
CreateLaserMine_Progress(id)
    return 
FMRES_IGNORED;
}

resetspeed(id)
{
    
set_pev(idpev_maxspeedplspeed[id])
}

public 
client_putinserver(id){
    
g_deployed[id] = 0;
    
g_havemine[id] = 0;
    
DeleteTask(id);
    
set_task1.0"Task_CheckAiming"id 3389__"b" ); 
    return 
PLUGIN_CONTINUE
}

public 
client_disconnect(id){
    if(!
get_pcvar_num(g_LENABLE))
        return 
PLUGIN_CONTINUE
    DeleteTask
(id);
    
RemoveAllTripmines(id);
    return 
PLUGIN_CONTINUE
}


public 
newround(id){
    if(!
get_pcvar_num(g_LENABLE))
        return 
PLUGIN_CONTINUE
    pev
(idpev_maxspeed,plspeed[id])
    
DeleteTask(id);
    
RemoveAllTripmines(id);
    
//client_print(id, print_chat, "[ZP][LM][DeBug] All Mines removied!");
    
delaycount(id);
    
SetStartAmmo(id);
    return 
PLUGIN_CONTINUE
}

public 
endround(id)
{
    if(!
get_pcvar_num(g_LENABLE))
        return 
PLUGIN_CONTINUE

    
// ???????? ??? ????? ????? ??????
    
DeleteTask(id);
    
RemoveAllTripmines(id);

    return 
PLUGIN_CONTINUE
}

public 
DeathEvent(){
    if(!
get_pcvar_num(g_LENABLE))
        return 
PLUGIN_CONTINUE

    
new id read_data(2)
    if(
is_user_connected(id)) DeleteTask(id);
    return 
PLUGIN_CONTINUE
}

public 
RemoveAllTripmines(i_Owner)
{
    new 
iEnt g_MaxPL 1;
    new 
clsname[32];
    while((
iEnt engfunc(EngFunc_FindEntityByStringiEnt"classname"ENT_CLASS_NAME)))
    {
        if(
i_Owner)
        {
            if(
pev(iEntLASERMINE_OWNER) != i_Owner)
                continue;
            
clsname[0] = '^0'
            
pev(iEntpev_classnameclsnamesizeof(clsname)-1);
            if(
equali(clsnameENT_CLASS_NAME))
            {
                
PlaySound(iEntSTOP_SOUND);
                
RemoveEntity(iEnt);
            }
        }
        else
            
set_pev(iEntpev_flagsFL_KILLME);
    }
    
g_deployed[i_Owner]=0;
}

SetStartAmmo(id)
{
    new 
stammo get_pcvar_num(g_LSTAMMO);
    if(
stammo <= 0) return PLUGIN_CONTINUE;
    
g_havemine[id] = (g_havemine[id] <= stammo) ? stammo g_havemine[id];
    return 
PLUGIN_CONTINUE;
}

public 
CutDeploy_onDamage(id)
{
    if(
get_user_health(id) < 1)
        
DeleteTask(id);
}

DeleteTask(id)
{
    if(
task_exists((TASK_PLANT id)))
    {
        
remove_task((TASK_PLANT id))
    }
    if(
task_exists((TASK_RELEASE id)))
    {
        
remove_task((TASK_RELEASE id))
    }
    
g_settinglaser[id] = false
    
return PLUGIN_CONTINUE;
}

stock set_rendering(entityfx kRenderFxNone255255255render kRenderNormalamount 16)
{
    static 
Float:RenderColor[3];
    
RenderColor[0] = float(r);
    
RenderColor[1] = float(g);
    
RenderColor[2] = float(b);

    
set_pev(entitypev_renderfxfx);
    
set_pev(entitypev_rendercolorRenderColor);
    
set_pev(entitypev_rendermoderender);
    
set_pev(entitypev_renderamtfloat(amount));

    return 
1
}

// Gets offset data
get_offset_value(idtype)
{
    new 
key = -1;
    switch(
type)
    {
        case 
OFFSET_TEAMkey OFFSET_TEAM;
        case 
OFFSET_MONEY:
        
key OFFSET_MONEY;
        case 
OFFSET_DEATHkey OFFSET_DEATH;
    }
    if(
key != -1)
    {
        if(
is_amd64_server()) key += 25;
        return 
get_pdata_int(idkey);
    }
    return -
1;
}


public 
Task_CheckAimingiTaskIndex )
{
    static 
iClient;
    
iClient iTaskIndex 3389;
    
    if( 
is_user_aliveiClient ) )
    {
        static 
iEntityiDummycClassname32 ];
        
get_user_aimingiClientiEntityiDummy9999 );
        
        if( 
pev_validiEntity ) )
        {
            
peviEntitypev_classnamecClassname31 );
            
            if( 
equalcClassname"lasermine" ) )
            {
                new 
name32 ];
                new 
aim peviEntityLASERMINE_OWNER );
                
get_user_nameaimnamecharsmaxname ) - )
                
set_hudmessage255255255, -1.00.6006.01.10.00.0, -)
                
show_hudmessageiClient"[ Health: %d ]-[ Owner: %s]"peviEntitypev_health ), name);
            }
        }
    }

__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
dr hicham is offline
amir saiaoud
Senior Member
Join Date: May 2015
Location: essaouira , maroc
Old 10-13-2015 , 14:28   Re: [Laser MIne]
Reply With Quote #5

Quote:
Originally Posted by amir saiaoud View Post
I need laser mine can set and dellet only by his owner and only human's nOt FOR cs team and only zombie can hit it :/
soory for my bad english
read this again please this is not what i want but than's any way ^_^
__________________
amir saiaoud is offline
Send a message via Skype™ to amir saiaoud
Chihuahuax
Senior Member
Join Date: Oct 2014
Location: Malaysia
Old 10-14-2015 , 02:08   Re: [Laser MIne]
Reply With Quote #6

Find the addon named Laser Destroy Preventer
Chihuahuax is offline
Send a message via Skype™ to Chihuahuax
amir saiaoud
Senior Member
Join Date: May 2015
Location: essaouira , maroc
Old 10-14-2015 , 05:49   Re: [Laser MIne]
Reply With Quote #7

thank's @chihiahuax
__________________
amir saiaoud is offline
Send a message via Skype™ to amir saiaoud
Reply



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 16:06.


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