Smokerio problemos. Ir boomer

Forumas skirtas spręsti problemas iškilusias su CS 1.6 serveriais.
Post Reply
kesiukas
Jau po truputį tampa savu
Posts: 187
Joined: 2011 Jan 11 18:32
Skype: kesys19
Location: Kaunas/Batniava

Smokerio problemos. Ir boomer

Post by kesiukas »

1) Kaip nustatyti, kiek laiko smokeris gali laikyti zmogu??
2) Kodel kai tik atsirandi smokeriu, ir paspaudvi v raide (v tai cia dragina) tada iskarto dingsta hud vieta kur rodo zm klase ir gyvybes ir neatsiranda iki tol, kol nepasikeicia map. Ant kitu zm visks normaliai buna.
3) Kodel kai boomer prieina prie zmogaus, ir su mouse2 bando pavemti, tai apsiviame tik is kokio 4 ar 5 karto.?

User avatar
nuodas159
Flooderis arba specialistas
Posts: 522
Joined: 2010 Sep 03 15:30
Skype: nuodas159
Location: SunCity

Re: Smokerio problemos. Ir boomer

Post by nuodas159 »

Tai cia visu pirma ne cia parasei ,o reikejo i scriptingo pagalbos ir reikia umbrella_swarm.sma ar kaip vadinasi ,kad tavo tas problemas galetu istaisyti :).
Image

kesiukas
Jau po truputį tampa savu
Posts: 187
Joined: 2011 Jan 11 18:32
Skype: kesys19
Location: Kaunas/Batniava

Re: Smokerio problemos. Ir boomer

Post by kesiukas »

Va .sma kodas:
Sorry, kad neidejau į

Code: Select all

, nes kai idedu y jy, nerodo viso .sma failo kodo

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>
#include <cstrike>
#include <fun>
#include <hamsandwich>
 
#define PLUGIN "Umbrella Swarm"
#define VERSION "3.0"
#define AUTHOR "KieC"
 
//--[Zombie Class System]--//
#define CLASS_COLLECTION 0
#define MAX_ZOMBIE_CLASS 3
//------------------------//
 
//---------------------[Hide Objects]---------------------//
#define HIDE_HUD (1<<0) //crosshair, ammo, weapons list
#define HIDE_FLASH (1<<1) //flashlight, +
#define HIDE_HP_HUD (1<<3) //Health, armour and radar
#define HIDE_MONEY (1<<5) //money, +
#define HIDE_NONE (1<<7) //+
//------------------------------------------------------//
 
//----------------[TASKS]----------------//
#define TASKID_MODEL 0
#define TASKID_NVG 3
//--------------------------------------------//
 
//----------------[Chainsaw Knife Damage]----------------//
#define CHAINSAW_SLASH_MIN 25.0
#define CHAINSAW_SLASH_MAX 30.0
#define CHAINSAW_STAB_MIN 150.0
#define CHAINSAW_STAB_MAX 200.0
//-----------------------------------------------------//
 
//----------------------------[Tank Moves]---------------------------//
#define IN_MOVE (IN_FORWARD | IN_BACK | IN_MOVELEFT | IN_MOVERIGHT)
//------------------------------------------------------------------//
 
//--------------------------------------[Models]-----------------------------------//
new const Zombie_Player_Class_Models[][] = 
{
    "l4d_hunter", //Hunter player model
    "l4d_boomer", //Boomer player model
    "l4d_smoker", //Smoker player model
    "l4d_chainsaw", //Zombie player model
    "l4d_tank" //Tank player model
}
new const Zombie_Class_Models[][] = 
{
    "models/player/l4d_hunter/l4d_hunter.mdl", //Hunter class model
    "models/player/l4d_boomer/l4d_boomer.mdl", //Boomer class model
    "models/player/l4d_smoker/l4d_smoker.mdl", //Smoker class model
    "models/player/l4d_chainsaw/l4d_chainsaw.mdl", //Zombie class model
    "models/player/l4d_tank/l4d_tank.mdl" //Tank class model
}
 
new const Zombie_Class_Knife_Models[][] =
{
    "models/umbrella_swarm/v_knife_zombies.mdl", //Hunter knife model
    "models/umbrella_swarm/v_knife_zombies.mdl", //Boomer knife model
    "models/umbrella_swarm/v_knife_zombies.mdl", //Smoker knife model
    "models/umbrella_swarm/v_chainsaw.mdl", //Zombie knife model
    "models/umbrella_swarm/v_knife_zombies.mdl" //Tank knife model
}
 
new const Zombie_Class_Names[][] = 
{
    "Hunter", //Hunter class name
    "Boomer", //Boomer class name
    "Smoker", //Smoker class name
    "Chainsaw", //Zombie class name
    "Tank" //Tank class name
}
//--------------------------------------------------------------------------------//
 
//--------------------------------------[Sounds]-----------------------------------//
new const Zombie_Class_Miss_Sounds[][] =
{
    "umbrella/zombies/hunter/miss1.wav", //Hunter knife slash sound
    "umbrella/zombies/boomer/miss1.wav", //Boomer knife slash sound
    "umbrella/zombies/smoker/miss1.wav", //Smoker knife slash sound
    "umbrella/zombies/chain_miss1.wav", //Zombie knife slash sound
    "umbrella/zombies/tank/miss1.wav" //Tank knife slash sound
}
 
new const Zombie_Class_Hit_Sounds[][] =
{
    "umbrella/zombies/hunter/hit1.wav", //Hunter knife stab sound
    "umbrella/zombies/boomer/hit1.wav", //Boomer knife stab sound
    "umbrella/zombies/smoker/hit1.wav", //Smoker knife stab sound
    "umbrella/zombies/chain_hit1.wav", //Zombie knife stab sound
    "umbrella/zombies/tank/hit1.wav" //Tank knife stab sound
}
 
new const Zombie_Class_Pain_Sounds[][] =
{
    "umbrella/zombies/hunter/pain1.wav", //Hunter pain sound
    "umbrella/zombies/boomer/pain1.wav", //Boomer pain sound
    "umbrella/zombies/smoker/pain1.wav", //Smoker pain sound
    "umbrella/zombies/pain1.wav", //Zombie pain sound
    "umbrella/zombies/tank/pain1.wav" //Tank pain sound
}
 
new const Zombie_Class_Die_Sounds[][] =
{
    "umbrella/zombies/hunter/die1.wav", //Hunter die sound
    "umbrella/zombies/boomer/die1.wav", //Boomer die sound
    "umbrella/zombies/smoker/die1.wav", //Smoker die sound
    "umbrella/zombies/die1.wav", //Zombie die sound
    "umbrella/zombies/tank/die1.wav" //Tank die sound
}
 
new const Zombie_Class_Power_Sounds[][] =
{
    "umbrella/zombies/hunter/leap.wav", //Hunter LongJump sound
    "umbrella/zombies/boomer/voomit.wav", //Boomer Vommit sound
    "umbrella/zombies/smoker/drag.wav" //Smoker DragPlayer sound
}
 
new const Zombie_Class_Power_Miss_Sounds[][] =
{
    "...",
    "...",
    "umbrella/zombies/smoker/drag_miss.wav" //Smoker DragMiss sound
}
 
new const Zombie_Class_Footsteps_Sounds[][] = 
{
    "...",
    "...",
    "...",
    "...",
    "umbrella/zombies/tank/footstep.wav" //Tank Step sound
}
//--------------------------------------------------------------------------------//
 
//--------------------------------------[Win Sounds]-----------------------------------//
new const Zombie_Team_Win_Sounds[][] =
{
    "umbrella/zombies/zombie_win.wav"
}
 
new const Human_Team_Win_Sounds[][] =
{
    "umbrella/zombies/human_win.wav"
}
 
new const No_One_Team_Win_Sounds[][] =
{
    "ambience/3dmstart.wav"
}
//----------------------------------------------------------------------------------//
 
//----------------------------[Remove Map Entitys]-------------------------//
new const g_remove_entities[][] = 
{ 
    "func_bomb_target",    
    "info_bomb_target", 
    "hostage_entity",      
    "monster_scientist", 
    "func_hostage_rescue", 
    "info_hostage_rescue",
    "info_vip_start",      
    "func_vip_safetyzone", 
    "func_escapezone",     
    "func_buyzone"
}
//------------------------------------------------------------------------//
 
//-------[News]-------//
new g_zombie_class[33]
new player_model[33][32]
new msg_hideweapon
new g_hudsync
new g_msgScreenFade
new g_drag[33]
new g_drags_left[33]
new g_Line
new g_buyzone
new g_fw_spawn
//-------------------//
 
//--------[Floats]--------//
new Float: g_LastLeap[33]
new Float: g_LastVommit[33]
new Float: g_LastDrag[33]
new Float: g_LastStep[33]
new Float: g_counter
new Float: g_buytime
//-----------------------//
 
//--------[Bools]--------//
new bool: g_zombie[33]
new bool: g_umbrella[33]
new bool: g_tank[33]
new bool: g_model[33]
new bool: g_infreezetime
new bool: g_pain_schok[33]
new bool: g_pain_schok2[33]
new bool: g_hegrenade[33]
//--------------------//
 
//--------[OFFESETS]--------//
const OFFSET_LINUX = 5
const OFFSET_PAINSHOCK = 108
//-------------------------//
 
//------------------------------------[Cvars]------------------------------------//
new cvar_hunter_health, cvar_hunter_gravity, cvar_hunter_speed, cvar_hunter_leap, 
cvar_hunter_leap_cooldown, cvar_hunter_leap_force, cvar_hunter_leap_height
 
new cvar_boomer_health, cvar_boomer_gravity, cvar_boomer_speed, cvar_boomer_vommit,
cvar_boomer_vommit_cooldown, cvar_boomer_vommit_fade, cvar_boomer_explode, 
cvar_boomer_explode_distance, cvar_boomer_exlopde_fade
 
new cvar_smoker_health, cvar_smoker_gravity, cvar_smoker_speed, cvar_smoker_drags_max,
cvar_smoker_drag_cooldown, cvar_smoker_drag_team_mates, cvar_smoker_drag_speed
 
new cvar_chainsaw_health, cvar_chainsaw_gravity, cvar_chainsaw_speed
 
new cvar_tank_health, cvar_tank_gravity, cvar_tank_speed, cvar_tank_spawn, cvar_tank_respawn,
cvar_tank_respawn_time, cvar_tank_new_time, cvar_tank_bot, cvar_tank_steps, cvar_tank_step_cooldown
 
new cvar_autonvg, cvar_respawn, cvar_respawn_time
 
new cvar_umbrella_health, cvar_umbrella_armor, cvar_umbrella_gravity, cvar_umbrella_speed,
cvar_umbrella_crosshair
 
new cvar_skyname, cvar_buytime, cvar_lighthing, cvar_light_level
 
new cvar_he_explode_damage
//----------------------------------------------------------------------------//
 
public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    //----------------------------[Cvars]--------------------------//
    cvar_hunter_health = register_cvar("umbrella_hunter_health", "900")
    cvar_hunter_gravity = register_cvar("umbrella_hunter_gravity", "700")
    cvar_hunter_speed = register_cvar("umbrella_hunter_speed", "275")
    cvar_hunter_leap = register_cvar("umbrella_hunter_leap", "1")
    cvar_hunter_leap_cooldown = register_cvar("umbrella_hunter_leap_cooldown", "3")
    cvar_hunter_leap_force = register_cvar("umbrella_hunter_leap_force", "500")
    cvar_hunter_leap_height = register_cvar("umbrella_hunter_leap_height", "350")
    
    cvar_boomer_health = register_cvar("umbrella_boomer_health", "1000")
    cvar_boomer_gravity = register_cvar("umbrella_boomer_gravity", "720")
    cvar_boomer_speed = register_cvar("umbrella_boomer_speed", "265")
    cvar_boomer_vommit = register_cvar("umbrella_boomer_vommit", "1")
    cvar_boomer_vommit_cooldown = register_cvar("umbrella_boomer_vommit_cooldown", "5.0")
    cvar_boomer_vommit_fade = register_cvar("umbrella_boomer_vommit_fade", "3.0")
    cvar_boomer_explode = register_cvar("umbrella_boomer_explode", "1")
    cvar_boomer_explode_distance = register_cvar("umbrella_boomer_explode_distance", "225")
    cvar_boomer_exlopde_fade = register_cvar("umbrella_boomer_explode_fade", "4.0")
    
    cvar_smoker_health = register_cvar("umbrella_smoker_health", "1000")
    cvar_smoker_gravity = register_cvar("umbrella_smoker_gravity", "710")
    cvar_smoker_speed = register_cvar("umbrella_smoker_speed", "265")
    cvar_smoker_drags_max = register_cvar("umbrella_smoker_drag_max", "25")
    cvar_smoker_drag_cooldown = register_cvar("umbrella_smoker_drag_cooldown", "0")
    cvar_smoker_drag_team_mates = register_cvar("umbrella_smoker_drag_team_mates", "0")
    cvar_smoker_drag_speed = register_cvar("umbrella_smoker_drag_speed", "150")
    
    cvar_chainsaw_health = register_cvar("umbrella_chainsaw_health", "1200")
    cvar_chainsaw_gravity = register_cvar("umbrella_chainsaw_gravity", "730")
    cvar_chainsaw_speed = register_cvar("umbrella_chainsaw_speed", "252")
    
    cvar_tank_health = register_cvar("umbrella_tank_health", "3000")
    cvar_tank_gravity = register_cvar("umbrella_tank_gravity", "680")
    cvar_tank_speed = register_cvar("umbrella_tank_speed", "260")
    cvar_tank_spawn = register_cvar("umbrella_tank_spawn", "1")
    cvar_tank_respawn = register_cvar("umbrella_tank_respawn", "0")
    cvar_tank_respawn_time = register_cvar("umbrella_tank_respawn_time", "5")
    cvar_tank_new_time = register_cvar("umbrella_tank_new_spawn_time", "125.0")
    cvar_tank_bot = register_cvar("umbrella_tank_bot", "1")
    cvar_tank_steps = register_cvar("umbrella_tank_steps", "1")
    cvar_tank_step_cooldown = register_cvar("umbrella_tank_step_cooldown", "0.5")
    
    cvar_autonvg = register_cvar("umbrella_zombie_auto_nvg", "1")
    cvar_respawn = register_cvar("umbrella_zombie_respawn", "0")
    cvar_respawn_time = register_cvar("umbrella_zombie_respawn_time", "3")
    
    cvar_umbrella_health = register_cvar("umbrella_health", "100")
    cvar_umbrella_armor = register_cvar("umbrella_armor", "100")
    cvar_umbrella_gravity = register_cvar("umbrella_gravity", "800")
    cvar_umbrella_speed = register_cvar("umbrella_speed", "250")
    cvar_umbrella_crosshair = register_cvar("umbrella_extra_crosshair", "1")
    
    cvar_skyname = register_cvar("umbrella_obj_skyname", "Night")
    cvar_buytime = register_cvar("umbrella_obj_buytime", "0")
    cvar_lighthing = register_cvar("umbrella_obj_lighthing", "1")
    cvar_light_level = register_cvar("umbrella_obj_light_level", "g")
    
    cvar_he_explode_damage = register_cvar("umbrella_he_explode_damage", "500")
    //------------------------------------------------------------//
    
    //-------------------------[Round Events]-----------------------//
    register_logevent("Event_Round_Start", 2, "1=Round_Start")
    register_logevent("Event_Round_End", 2, "1=Round_End")
    register_event("HLTV", "Event_New_Round", "a", "1=0", "2=0")
    //-------------------------------------------------------------//
    
    //----------------------------[Events]--------------------------//
    register_event("CurWeapon", "Event_Zombie_Knife", "be")
    register_event("DeathMsg", "Event_Boomer_Death", "a")
    register_event("DeathMsg", "Event_Zombies_Respawn", "a")
    //-------------------------------------------------------------//
    
    //----------------------------[Messages]--------------------------//
    register_message(get_user_msgid("TextMsg"), "Message_Text")
    register_message(get_user_msgid("SendAudio"), "Message_Team_Sounds")
    //---------------------------------------------------------------//
    
    //----------------------------[Bacons]----------------------------//
    RegisterHam(Ham_Spawn, "player", "Bacon_Player_Spawn", 1);
    RegisterHam(Ham_TakeDamage, "player", "Bacon_Tank_Pain_Schok", 1)
    RegisterHam(Ham_TakeDamage, "player", "Bacon_Chainsaw_Pain_Schok", 1)
    RegisterHam(Ham_TakeDamage,"player", "Bacon_Chainsaw_Take_Damage")
    RegisterHam(Ham_Touch, "weaponbox", "Bacon_Touch_Weapon")
    RegisterHam(Ham_Touch, "armoury_entity", "Bacon_Touch_Weapon")
    RegisterHam(Ham_Touch, "weapon_shield", "Bacon_Touch_Weapon")
    RegisterHam(Ham_TakeDamage, "player", "Ham_DamageWeapon")
    //---------------------------------------------------------------//
    
    //----------------------------[Forwards]----------------------------//
    register_forward(FM_PlayerPreThink, "fw_PlayerPreThink", 1)
    register_forward(FM_SetClientKeyValue, "fw_SetClientKeyValue")
    register_forward(FM_ClientUserInfoChanged, "fw_ClientUserInfoChanged")
    register_forward(FM_EmitSound, "fw_EmitSound")
    register_forward(FM_EmitSound, "fw_EmitSound2")
    register_forward(FM_PlayerPostThink, "fw_player_postthink")
    unregister_forward(FM_Spawn, g_fw_spawn)
    register_forward(FM_CmdStart, "fw_CmdStart")
    //-----------------------------------------------------------------//
    
    //----------------[Message IDS]----------------//
    msg_hideweapon =  get_user_msgid("HideWeapon")
    g_msgScreenFade = get_user_msgid("ScreenFade")
    g_hudsync = CreateHudSyncObj()
    //--------------------------------------------//
    
    //----------------------------[Client Commands]----------------------------//
    register_clcmd("+drag","drag_start", ADMIN_USER, "bind ^"key^" ^"+drag^"")
        register_clcmd("-drag","drag_end")
    //------------------------------------------------------------------------//
    
    //----------------------------[SkyName]----------------------------//
    new skyname[32]
    get_pcvar_string(cvar_skyname, skyname, 31)
    
    set_cvar_string("sv_skyname", skyname)
    set_cvar_num("sv_skycolor_r", 0) 
    set_cvar_num("sv_skycolor_g", 0)
    set_cvar_num("sv_skycolor_b", 0)
    server_cmd("sv_maxspeed 2000")
    //---------------------------------------------------------------//
    
    //----------------------------[Lang File]----------------------------//
    register_dictionary("umbrella_swarm.txt")
    //------------------------------------------------------------------//
}
 
public plugin_precache()
{
    new i
    
    //---------------[Precache Models]-----------------//
    for (i = 0; i < sizeof (Zombie_Class_Models); i++)
    {
        precache_model(Zombie_Class_Models[i])
    }
    
    for (i = 0; i < sizeof (Zombie_Class_Knife_Models); i++)
    {
        precache_model(Zombie_Class_Knife_Models[i])
    }
    //-----------------------------------------------//
    
    //---------------[Precache Sounds]-----------------//
    for (i = 0; i < sizeof (Zombie_Class_Miss_Sounds); i++)
    {
        precache_sound(Zombie_Class_Miss_Sounds[i])
    }
    
    for (i = 0; i < sizeof (Zombie_Class_Hit_Sounds); i++)
    {
        precache_sound(Zombie_Class_Hit_Sounds[i])
    }
    
    for (i = 0; i < sizeof (Zombie_Class_Pain_Sounds); i++)
    {
        precache_sound(Zombie_Class_Pain_Sounds[i])
    }
    
    for (i = 0; i < sizeof (Zombie_Class_Die_Sounds); i++)
    {
        precache_sound(Zombie_Class_Die_Sounds[i])
    }
    
    for (i = 0; i < sizeof (Zombie_Class_Power_Sounds); i++)
    {
        precache_sound(Zombie_Class_Power_Sounds[i])
    }
    
    for (i = 0; i < sizeof (Zombie_Class_Footsteps_Sounds); i++)
    {
        precache_sound(Zombie_Class_Footsteps_Sounds[i])
    }
    //-----------------------------------------------//
    
    //---------------[Precache Win Sounds]-----------------//
    for (i = 0; i < sizeof (Zombie_Team_Win_Sounds); i++)
    {
        precache_sound(Zombie_Team_Win_Sounds[i])
    }
    
    for (i = 0; i < sizeof (Human_Team_Win_Sounds); i++)
    {
        precache_sound(Human_Team_Win_Sounds[i])
    }
    
    for (i = 0; i < sizeof (No_One_Team_Win_Sounds); i++)
    {
        precache_sound(No_One_Team_Win_Sounds[i])
    }
    //----------------------------------------------------//
    
    //------------[Precache Sprites]--------------//
    g_Line = precache_model("sprites/zbeam4.spr")
    //-------------------------------------------//
    
    //------------[Remove Entity]--------------//
    g_fw_spawn = register_forward(FM_Spawn, "fw_spawn")
    
    g_buyzone = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "func_buyzone"))
    if(g_buyzone) 
    {
        dllfunc(DLLFunc_Spawn, g_buyzone)
        set_pev(g_buyzone, pev_solid, SOLID_NOT)
    }
    
    new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_bomb_target"))
    if(ent) 
    {
        dllfunc(DLLFunc_Spawn, ent)
        set_pev(ent, pev_solid, SOLID_NOT)
    }
    //----------------------------------------//
}
 
//***************************************************************************************//
//**************************************[Clients]****************************************//
//***************************************************************************************//
public client_putinserver(id)
{
    // Set the custom HUD display task
    set_task(0.1, "ShowHUD", id, _, _, "b")
    
    // Set the custom light settings
    if (get_pcvar_num(cvar_lighthing) == 1)
        set_task(0.1, "Event_Light_Settings")
}
 
public client_connect(id) 
{
    g_hegrenade[id] = true
}
//***************************************************************************************//
//***********************************[Round Events]**************************************//
//***************************************************************************************//
public Event_New_Round(id)
{
    g_infreezetime = true
    
    static buytime 
    buytime = get_pcvar_num(cvar_buytime)
    
    if(buytime) 
        g_buytime = buytime + get_gametime()
}
 
public Event_Round_Start(id)
{
    g_infreezetime = false
    
    if (get_pcvar_num(cvar_tank_spawn) == 1)
    {
        set_task(0.1, "Tank_Spawn")
    }
}
 
public Event_Round_End(id)
{
    
}
 
//***************************************************************************************//
//**************************************[Events]*****************************************//
//***************************************************************************************//
public Event_Zombie_Knife(id)
{
    if(!is_user_alive(id))
        return PLUGIN_HANDLED
    
    if (g_zombie[id])
    {
        new weapon = read_data(2)
        
        if (weapon != CSW_KNIFE)
        { 
            engclient_cmd(id, "weapon_knife")
            set_pev(id, pev_viewmodel2, Zombie_Class_Knife_Models[g_zombie_class[id]])
            set_pev(id, pev_weaponmodel2, "")
        }
        
      message_begin(MSG_ONE_UNRELIABLE, msg_hideweapon, _ , id)
        write_byte(HIDE_FLASH | HIDE_MONEY)
        message_end()
    }
    else if (g_tank[id])
    {
        new weapon = read_data(2)
        
        if (weapon != CSW_KNIFE)
        { 
            engclient_cmd(id, "weapon_knife")
            set_pev(id, pev_viewmodel2, Zombie_Class_Knife_Models[4])
            set_pev(id, pev_weaponmodel2, "")
        }
        
        message_begin(MSG_ONE_UNRELIABLE, msg_hideweapon, _ , id)
        write_byte(HIDE_FLASH | HIDE_MONEY)
        message_end()
    }
    else if (g_umbrella[id])
    {
        if (get_pcvar_num(cvar_umbrella_crosshair))
        {
            message_begin(MSG_ONE_UNRELIABLE, msg_hideweapon, _ , id)
            write_byte(HIDE_NONE)
            message_end()
        }
    }
    
    return PLUGIN_CONTINUE
}
 
public Event_Boomer_Death(id, player)
{
    new i_victim = read_data(2)
    new i_attacker = read_data(1)
    
    new iplayersID[32]
    new xPlayers
    get_players(iplayersID, xPlayers, "a")
    new origin[3]
    get_user_origin(i_victim, origin)
    
    new targetorigin[3], i, distancebetween
    for (i = 0; i < xPlayers; ++i)
    {
        i_attacker = iplayersID[i]
        get_user_origin (i_attacker, targetorigin)
        distancebetween = get_distance (origin, targetorigin)
        
        if ((distancebetween < get_pcvar_num(cvar_boomer_explode_distance)) && g_zombie[i_victim] && get_user_team(i_victim) == 1 && g_zombie_class[i_victim] == 1 && get_user_team(i_attacker) != get_user_team(i_victim))
        {
            if(get_pcvar_num(cvar_boomer_explode))
            {
                new gmsgShake = get_user_msgid("ScreenShake") 
                message_begin(MSG_ONE, gmsgShake, _, i_attacker)
                write_short(255<< 3) //ammount 
                write_short(10 << 4) //lasts this long 
                write_short(255<< 14) //frequency 
                message_end() 
 
                message_begin(MSG_ONE, g_msgScreenFade, _, i_attacker)
                write_short(4096 * get_pcvar_num(cvar_boomer_exlopde_fade))
                write_short(4096 * get_pcvar_num(cvar_boomer_exlopde_fade))
                write_short(4096)
                write_byte(0)
                write_byte(150)
                write_byte(0)
                write_byte(255)
                message_end()
            }
        }
    }
}
 
public Event_Zombies_Respawn(id)
{
    if(get_pcvar_num(cvar_respawn) == 1)
    {   
        set_task(get_pcvar_float(cvar_respawn_time), "Event_Respawn")
    }
    
    if(get_pcvar_num(cvar_tank_respawn) == 1)
    {   
        set_task(get_pcvar_float(cvar_tank_respawn_time), "Event_Respawn2")
    }
}
 
public Event_Respawn(id)
{
    if(g_zombie[id] || get_pcvar_num(cvar_respawn) == 1)
    {   
        ExecuteHamB(Ham_CS_RoundRespawn, id)
    }
}
 
public Event_Respawn2(id)
{
    if(g_tank[id] || get_pcvar_num(cvar_tank_respawn) == 1)
    {
        set_task(0.1, "Event_Respawn")
        set_task(get_pcvar_float(cvar_tank_new_time), "Task_Tank_Spawn")
        client_print(id, print_center, "Naujas Tankas Pasirodys uz 25.0 sek")
    }
}
 
public Event_Light_Settings()
{
    // light level [a iki z].
    static lighthing[2]
    get_pcvar_string(cvar_light_level, lighthing, sizeof lighthing - 1)
    strtolower(lighthing)
    
    // Sviesumo nustatymai
    if (lighthing[0] >= 'a' && lighthing[0] <= 'd')
    {
        engfunc(EngFunc_LightStyle, 0, lighthing)
    }
}
//***************************************************************************************//
//*************************************[Messages]****************************************//
//***************************************************************************************//
public Message_Text(msg_id, msg_dest, id)
{
    if(get_msg_arg_int(1) != 4)
        return PLUGIN_CONTINUE
    
    new text_msg[25], win_msg[32]
    get_msg_arg_string(2, text_msg, charsmax(text_msg))
    
    if(equal(text_msg[1], "Game_bomb_drop") || equal(text_msg[1], "Terrorist_cant_buy"))
        return PLUGIN_HANDLED
 
    else if(equal(text_msg[1], "Terrorists_Win"))
    {
        formatex(win_msg, charsmax(win_msg), "%L", LANG_SERVER, "Zombie_team_win")
        set_msg_arg_string(2, win_msg)
    }
    else if(equal(text_msg[1], "Target_Saved") || equal(text_msg[1], "CTs_Win"))
    {
        formatex(win_msg, charsmax(win_msg) , "%L", LANG_SERVER, "Human_team_win")
        set_msg_arg_string(2, win_msg)
    }
    else if(equal(text_msg[1], "Round_Draw"))
    {
        formatex(win_msg, charsmax(win_msg) , "%L", LANG_SERVER, "No_one_team_win")
        set_msg_arg_string(2, win_msg)
    }
    return PLUGIN_CONTINUE
}
 
public Message_Team_Sounds(msg_id, msg_dest, id)
{
    new AudioCode[22]
    get_msg_arg_string(2, AudioCode, charsmax(AudioCode))
    
    if(equal(AudioCode, "%!MRAD_terwin"))
        set_msg_arg_string(2, Zombie_Team_Win_Sounds[random_num(0, sizeof Zombie_Team_Win_Sounds - 1)])
        
    else if(equal(AudioCode, "%!MRAD_ctwin"))
        set_msg_arg_string(2, Human_Team_Win_Sounds[random_num(0, sizeof Human_Team_Win_Sounds - 1)])
        
    else if(equal(AudioCode, "%!MRAD_rounddraw"))
        set_msg_arg_string(2, No_One_Team_Win_Sounds[random_num(0, sizeof No_One_Team_Win_Sounds - 1)])
    
    return PLUGIN_CONTINUE
}
 
//***************************************************************************************//
//**************************************[Bacons]*****************************************//
//***************************************************************************************//
public Bacon_Player_Spawn(id)
{   
    if (!is_user_alive(id))
        return
    
    if (get_user_team(id) == 1) // Zombies
    {
        g_zombie[id] = true
        g_umbrella[id] = false
        g_tank[id] = false
        g_pain_schok[id] = false
    
        g_zombie_class[id] = random_num((CLASS_COLLECTION), (MAX_ZOMBIE_CLASS))
        
        if (g_zombie[id] && g_zombie_class[id] == 0)
        {
            new health, Float:gravity
            health = get_pcvar_num(cvar_hunter_health)
            gravity = get_pcvar_float(cvar_hunter_gravity) / 800
        
            set_user_health(id, health);
            set_user_gravity(id, gravity);
            
            copy(player_model[id], 31, Zombie_Player_Class_Models[g_zombie_class[id]])
        
            new currentmodel[32];
            fm_get_user_model(id, currentmodel, charsmax(currentmodel))
        
            if(!equal(currentmodel, player_model[id]))
            {
                set_task(0.25 + g_counter, "Task_Model", id + TASKID_MODEL)
                g_counter += 0.1;
            }
        }
        
        if (g_zombie[id] && g_zombie_class[id] == 1)
        {
            new health2, Float:gravity2
            health2 = get_pcvar_num(cvar_boomer_health)
            gravity2 = get_pcvar_float(cvar_boomer_gravity) / 800
        
            set_user_health(id, health2);
            set_user_gravity(id, gravity2);
            
            copy(player_model[id], 31, Zombie_Player_Class_Models[g_zombie_class[id]])
        
            new currentmodel[32];
            fm_get_user_model(id, currentmodel, charsmax(currentmodel))
        
            if(!equal(currentmodel, player_model[id]))
            {
                set_task(0.25 + g_counter, "Task_Model", id + TASKID_MODEL)
                g_counter += 0.1;
            }
        }
        
        if (g_zombie[id] && g_zombie_class[id] == 2)
        {
            new health3, Float:gravity3
            health3 = get_pcvar_num(cvar_smoker_health)
            gravity3 = get_pcvar_float(cvar_smoker_gravity) / 800
        
            set_user_health(id, health3);
            set_user_gravity(id, gravity3);
            
            copy(player_model[id], 31, Zombie_Player_Class_Models[g_zombie_class[id]])
        
            new currentmodel[32];
            fm_get_user_model(id, currentmodel, charsmax(currentmodel))
        
            if(!equal(currentmodel, player_model[id]))
            {
                set_task(0.25 + g_counter, "Task_Model", id + TASKID_MODEL)
                g_counter += 0.1;
            }
            
            g_drags_left[id] = get_pcvar_num(cvar_smoker_drags_max)
        }
        
        if (g_zombie[id] && g_zombie_class[id] == 3)
        {
            new health4, Float:gravity4
            health4 = get_pcvar_num(cvar_chainsaw_health)
            gravity4 = get_pcvar_float(cvar_chainsaw_gravity) / 800
        
            set_user_health(id, health4);
            set_user_gravity(id, gravity4);
            
            copy(player_model[id], 31, Zombie_Player_Class_Models[g_zombie_class[id]])
        
            new currentmodel[32];
            fm_get_user_model(id, currentmodel, charsmax(currentmodel))
        
            if(!equal(currentmodel, player_model[id]))
            {
                set_task(0.25 + g_counter, "Task_Model", id + TASKID_MODEL)
                g_counter += 0.1;
            }
        }
        
        set_task(random_float(0.1,0.5), "WeaponStrip", id)
        
        if (!cs_get_user_nvg(id))
            cs_set_user_nvg(id)
        
        if (get_pcvar_num(cvar_autonvg))
            set_task(0.2, "Task_NVG", TASKID_NVG + id)
    }
    else if (get_user_team(id) == 2) // Humans
    {
        g_umbrella[id] = true
        g_zombie[id] = false
        g_tank[id] = false
        g_pain_schok[id] = false
        
        fm_reset_user_model(id)
        
        new health6, Float:gravity6, armor6
        health6 = get_pcvar_num(cvar_umbrella_health)
        armor6 = get_pcvar_num(cvar_umbrella_armor)
        gravity6 = get_pcvar_float(cvar_umbrella_gravity) / 800
        
        set_user_health(id, health6);
        cs_set_user_armor(id, armor6, CS_ARMOR_VESTHELM);
        set_user_gravity(id, gravity6);
        
        give_item(id, "weapon_hegrenade")
        give_item(id, "weapon_hegrenade")
        give_item(id, "weapon_hegrenade")
        give_item(id, "weapon_hegrenade")
        give_item(id, "weapon_hegrenade")
        give_item(id, "weapon_hegrenade")
        give_item(id, "weapon_hegrenade")
        give_item(id, "weapon_hegrenade")
    }
}
 
public Bacon_Tank_Pain_Schok(id)
{
    if (!is_user_alive(id) || !g_tank[id])
        return HAM_IGNORED
    
    if (g_tank[id])
    {
        g_pain_schok[id] = true
        set_pdata_float(id, OFFSET_PAINSHOCK, 1.0, OFFSET_LINUX)
    }
    
    return HAM_IGNORED
}
 
public Bacon_Chainsaw_Pain_Schok(id)
{
    if (!is_user_alive(id) || !g_zombie[id])
        return HAM_IGNORED
    
    if (g_zombie[id] && g_zombie_class[id] == 3)
    {
        g_pain_schok2[id] = true
        set_pdata_float(id, OFFSET_PAINSHOCK, 1.0, OFFSET_LINUX)
    }
    
    return HAM_IGNORED
}
 
public Bacon_Chainsaw_Take_Damage(victim, inflictor, attacker, Float:damage, damagetype)
{ 
    if (damagetype & DMG_GENERIC || !is_user_alive(victim) || !is_user_connected(attacker)) 
        return HAM_IGNORED
    
    if (g_zombie[attacker] && g_zombie_class[attacker] == 3)
    {
        new weapon = get_user_weapon(attacker);
        if((weapon == CSW_KNIFE))
        {
            new button = get_user_button(attacker)
            
            if (button & IN_ATTACK)     
                damage = random_float(CHAINSAW_SLASH_MIN, CHAINSAW_SLASH_MAX)
            else if (button & IN_ATTACK2)
                damage = random_float(CHAINSAW_STAB_MIN, CHAINSAW_STAB_MAX)
            
            //if(g_hitgroups[victim] == HIT_HEAD)
                //damage = damage * 1.5
                
            SetHamParamFloat(4, damage)
            
            return HAM_HANDLED
        }
    }
 
    return HAM_IGNORED
}
 
public Bacon_Touch_Weapon(weapon, id)
{
    // Not a player
    if (!is_user_connected(id) && !is_user_bot(id))
        return HAM_IGNORED;
    
    // Dont pickup weapons if zombie
    if (g_zombie[id] && g_tank[id])
        return HAM_SUPERCEDE;
    
    return HAM_IGNORED;
}
 
public Ham_DamageWeapon(id, inflictor, attacker, Float:damage, damagebits) 
{
    if (!is_user_alive(attacker) || !g_hegrenade[attacker])
            return HAM_IGNORED; 
 
    new weapon2 = get_user_weapon(attacker, _, _)
    if(weapon2 == CSW_HEGRENADE)
    {
        SetHamParamFloat(4, damage * get_pcvar_float(cvar_he_explode_damage))
        return HAM_HANDLED
    }
 
    return HAM_IGNORED
}
//***************************************************************************************//
//*************************************[Forwards]****************************************//
//***************************************************************************************//
public fw_PlayerPreThink(id)
{
    if(!is_user_alive(id))
        return FMRES_IGNORED
    
    static Float: velocity[3], Float: Time
    static button, flag
    button = pev(id, pev_button)
    flag = pev(id, pev_flags)
    Time = get_gametime()
    
    if (g_zombie[id] && g_zombie_class[id] == 0)
    {
        if ((!g_infreezetime) && (button & IN_DUCK) && (button & IN_ATTACK) && (flag & FL_ONGROUND))
        {
            if (get_pcvar_num(cvar_hunter_leap))
            {
                static Float: cooldown, Float: lheight, lforce
                cooldown = get_pcvar_float(cvar_hunter_leap_cooldown)
                lforce = get_pcvar_num(cvar_hunter_leap_force)
                lheight = get_pcvar_float(cvar_hunter_leap_height)
                if (Time - cooldown > g_LastLeap[id])
                { 
                    set_pev(id, pev_button, button & ~IN_DUCK & ~IN_ATTACK)
                    velocity_by_aim(id, lforce, velocity)
                    velocity[2] = lheight
                    set_pev(id, pev_velocity, velocity)
                    emit_sound(id, CHAN_VOICE, Zombie_Class_Power_Sounds[g_zombie_class[id]], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
                    g_LastLeap[id] = Time
                }
            }
        }
        
        else if (!g_infreezetime)
        {
            static Float:speed; speed = get_pcvar_float(cvar_hunter_speed)
            set_pev(id, pev_maxspeed, speed)
        }
    }
    else if (g_zombie[id] && g_zombie_class[id] == 1)
    {
        if ((!g_infreezetime) && (button & IN_ATTACK2))
        {
            if (get_pcvar_num(cvar_boomer_vommit))
            {
                static Float: cooldown
                cooldown = get_pcvar_float(cvar_boomer_vommit_cooldown)
                    
                if (Time - cooldown > g_LastVommit[id])
                {
                    set_pev(id, pev_button, button & ~IN_ATTACK2)
                    clcmd_vommit(id)
                    g_LastVommit[id] = Time
                }
            }
        }
        
        else if (!g_infreezetime)
        {
            static Float:speed; speed = get_pcvar_float(cvar_boomer_speed)
            set_pev(id, pev_maxspeed, speed)
        }
    }
    else if (g_zombie[id] && g_zombie_class[id] == 2)
    {
        if ((!g_infreezetime) && (button & IN_RELOAD) && (flag & FL_ONGROUND))
        {
            set_pev(id, pev_button, button & ~IN_RELOAD)
            emit_sound(id, CHAN_VOICE, Zombie_Class_Footsteps_Sounds[g_zombie_class[id]], 1.0, ATTN_NORM, 0, PITCH_NORM)
            
        }
        
        else if (!g_infreezetime)
        {
            static Float:speed; speed = get_pcvar_float(cvar_smoker_speed)
            set_pev(id, pev_maxspeed, speed)
        }
    }
    
    else if (g_zombie[id] && g_zombie_class[id] == 3)
    {
        if ((!g_infreezetime) && (button & IN_RELOAD) && (flag & FL_ONGROUND))
        {
            set_pev(id, pev_button, button & ~IN_RELOAD)
            emit_sound(id, CHAN_VOICE, Zombie_Class_Footsteps_Sounds[g_zombie_class[id]], 1.0, ATTN_NORM, 0, PITCH_NORM)
            
        }
        
        else if (!g_infreezetime)
        {
            static Float:speed; speed = get_pcvar_float(cvar_chainsaw_speed)
            set_pev(id, pev_maxspeed, speed)
        }
    }
    
    else if (g_tank[id])
    {
        if ((!g_infreezetime) && (button & IN_MOVE) && (flag & FL_ONGROUND))
        {
            if (get_pcvar_num(cvar_tank_steps))
            {
                static Float: cooldown
                cooldown = get_pcvar_float(cvar_tank_step_cooldown)
                if (Time - cooldown > g_LastStep[id])
                { 
                    set_pev(id, pev_button, button & ~IN_MOVE)
                    emit_sound(id, CHAN_VOICE, Zombie_Class_Footsteps_Sounds[4], 1.0, ATTN_NORM, 0, PITCH_NORM)
                    g_LastStep[id] = Time
                }
            }
        }
        
        else if (!g_infreezetime)
        {
            static Float:speed; speed = get_pcvar_float(cvar_tank_speed)
            set_pev(id, pev_maxspeed, speed)
        }
    }
    
    else if (g_umbrella[id])
    {
        if (!g_infreezetime)
        {
            static Float:speed; speed = get_pcvar_float(cvar_umbrella_speed)
            set_pev(id, pev_maxspeed, speed)
        }
    }
    
    return FMRES_IGNORED
}   
 
public fw_SetClientKeyValue(id, infobuffer, key[], value[])
{   
    if (g_model[id] && equal(key, "model"))
        return FMRES_SUPERCEDE
    
    return FMRES_IGNORED
}
 
public fw_ClientUserInfoChanged(id, infobuffer)
{   
    if (!g_model[id])
        return FMRES_IGNORED
    
    new currentmodel[32]; 
    fm_get_user_model(id, currentmodel, charsmax(currentmodel) );
    
    if(!equal(currentmodel, player_model[id]))
        fm_set_user_model(id, player_model[id]) 
    
    return FMRES_IGNORED
}
 
public fw_EmitSound(id, channel, sample[], Float:volume, Float:attn, flag, pitch)
{
    if(!is_user_connected(id) || !g_zombie[id])
        return FMRES_IGNORED
        
    //KNIFE
    if (sample[0] == 'w' && sample[1] == 'e' && sample[8] == 'k' && sample[9] == 'n')
    {
        switch(sample[17])
        {
            case 'l': 
                return FMRES_SUPERCEDE
                
            case 's', 'w':
            {
                emit_sound(id, CHAN_WEAPON, Zombie_Class_Miss_Sounds[g_zombie_class[id]], volume, attn, flag, pitch)
                return FMRES_SUPERCEDE
            }
            
            case 'b', '1', '2', '3', '4':
            {
                emit_sound(id, CHAN_WEAPON, Zombie_Class_Hit_Sounds[g_zombie_class[id]], volume, attn, flag, pitch)
                return FMRES_SUPERCEDE
            }
        }
    }
    //PAIN
    else if (sample[1] == 'l' && sample[2] == 'a' && sample[3] == 'y' && ( (containi(sample, "bhit") != -1) || (containi(sample, "pain") != -1) || (containi(sample, "shot") != -1)))
    {
        emit_sound(id, CHAN_VOICE, Zombie_Class_Pain_Sounds[g_zombie_class[id]], volume, attn, flag, pitch)
        return FMRES_SUPERCEDE
    }       
    //DEATH
    else if (sample[7] == 'd' && (sample[8] == 'i' && sample[9] == 'e' || sample[12] == '6'))
    {
        emit_sound(id, CHAN_VOICE, Zombie_Class_Die_Sounds[g_zombie_class[id]], volume, attn, flag, pitch)
        return FMRES_SUPERCEDE
    }   
    //NVG
    else if (sample[6] == 'n' && sample[7] == 'v' && sample[8] == 'g')
        return FMRES_SUPERCEDE
        
    return FMRES_IGNORED
}
 
public fw_EmitSound2(id, channel, sample[], Float:volume, Float:attn, flag, pitch)
{
    if(!is_user_connected(id) || !g_tank[id])
        return FMRES_IGNORED
        
    //KNIFE
    if (sample[0] == 'w' && sample[1] == 'e' && sample[8] == 'k' && sample[9] == 'n')
    {
        switch(sample[17])
        {
            case 'l': 
                return FMRES_SUPERCEDE
                
            case 's', 'w':
            {
                emit_sound(id, CHAN_WEAPON, Zombie_Class_Miss_Sounds[4], volume, attn, flag, pitch)
                return FMRES_SUPERCEDE
            }
            
            case 'b', '1', '2', '3', '4':
            {
                emit_sound(id, CHAN_WEAPON, Zombie_Class_Hit_Sounds[4], volume, attn, flag, pitch)
                return FMRES_SUPERCEDE
            }
        }
    }
    //PAIN
    else if (sample[1] == 'l' && sample[2] == 'a' && sample[3] == 'y' && ( (containi(sample, "bhit") != -1) || (containi(sample, "pain") != -1) || (containi(sample, "shot") != -1)))
    {
        emit_sound(id, CHAN_VOICE, Zombie_Class_Pain_Sounds[4], volume, attn, flag, pitch)
        return FMRES_SUPERCEDE
    }       
    //DEATH
    else if (sample[7] == 'd' && (sample[8] == 'i' && sample[9] == 'e' || sample[12] == '6'))
    {
        emit_sound(id, CHAN_VOICE, Zombie_Class_Die_Sounds[4], volume, attn, flag, pitch)
        return FMRES_SUPERCEDE
    }   
    //NVG
    else if (sample[6] == 'n' && sample[7] == 'v' && sample[8] == 'g')
        return FMRES_SUPERCEDE
        
    return FMRES_IGNORED
}
 
public fw_player_postthink(id)
{ 
    if(!is_user_alive(id))
        return FMRES_IGNORED
    
    if(get_pcvar_num(cvar_buytime))
    {
        if(pev_valid(g_buyzone) && g_buytime > get_gametime())
            dllfunc(DLLFunc_Touch, g_buyzone, id)
    }
    return FMRES_IGNORED
}
 
public fw_spawn(ent)
{
    if(!pev_valid(ent)) 
        return FMRES_IGNORED
    
    static classname[32]
    pev(ent, pev_classname, classname, 31)
 
    static i
    for(i = 0; i < sizeof g_remove_entities; ++i)
    {
        if(equal(classname, g_remove_entities[i]))
        {
            engfunc(EngFunc_RemoveEntity, ent)
            return FMRES_SUPERCEDE
        }
    }
    return FMRES_IGNORED
}
 
public fw_CmdStart(id, handle, seed)
{
    if(!is_user_alive(id) || !g_zombie[id] || !(g_tank[id]))
        return FMRES_IGNORED
    
    static impulse; impulse = get_uc(handle, UC_Impulse)
    if(impulse == 100)
    {
        set_uc(handle, UC_Impulse, 0)
        return FMRES_SUPERCEDE
    }
    return FMRES_IGNORED
}
//***************************************************************************************//
//**********************************[Client Commands]************************************//
//***************************************************************************************//
public clcmd_vommit(id)
{
    new iTarget;
    new iDontCare;
    get_user_aiming(id, iTarget, iDontCare);
 
    if (is_user_alive(iTarget))
    {
        new Float: oworigin[3];
        new Float: recorigin[3];
 
        pev(id, pev_origin, oworigin);
        pev(iTarget, pev_origin, recorigin);
 
        if (get_user_team(iTarget) == 2)
        {
            new gmsgShake = get_user_msgid("ScreenShake") 
            message_begin(MSG_ONE, gmsgShake, _, iTarget)
            write_short(255<< 3) //ammount 
            write_short(10 << 4) //lasts this long 
            write_short(255<< 14) //frequency 
            message_end() 
 
            message_begin(MSG_ONE, g_msgScreenFade, _, iTarget);
            write_short(4096 * get_pcvar_num(cvar_boomer_vommit_fade));
            write_short(4096 * get_pcvar_num(cvar_boomer_vommit_fade));
            write_short(4096);
            write_byte(0);
            write_byte(200);
            write_byte(0);
            write_byte(255);
            message_end();
 
            emit_sound(id, CHAN_VOICE, Zombie_Class_Power_Sounds[g_zombie_class[id]], VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
        }
    }
}
 
//***************************************************************************************//
//**********************************[Smoker Draging]************************************//
//***************************************************************************************//
public drag_start(id) // starts drag, checks if player is Smoker, checks cvars
{
    if (g_zombie[id] && g_zombie_class[id] == 2) 
    {    
        static Float:cdown
        cdown = get_pcvar_float(cvar_smoker_drag_cooldown)
        
        if (!is_user_alive(id)) 
        {
            client_print(id, print_chat, "Jus negalite traukti kai esate mires!")
            return
        }
        
        new hooktarget, body
        
        get_user_aiming(id, hooktarget, body)
        
        if (is_user_alive(hooktarget)) 
        {
            if (get_user_team(hooktarget) != get_user_team(id)) 
            {
                g_drag[id] = hooktarget
                emit_sound(hooktarget, CHAN_BODY, Zombie_Class_Power_Sounds[g_zombie_class[id]], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
            }
            else 
            {
                if (is_user_alive(hooktarget)) 
                {
                    
                    if (get_pcvar_num(cvar_smoker_drag_team_mates) == 1) 
                    {
                        g_drag[id] = hooktarget
                        emit_sound(hooktarget, CHAN_BODY, Zombie_Class_Power_Sounds[g_zombie_class[id]], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
                    }
                }
                else
                {
                    g_drag[id] = 33
                    noTarget(id)
                    emit_sound(hooktarget, CHAN_BODY, Zombie_Class_Power_Miss_Sounds[g_zombie_class[id]], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
                    return
                }
            }
            
            new parm[2]
            parm[0] = id
            parm[1] = hooktarget
            
            set_task(0.1, "smoker_reelin", id, parm, 2, "b")
            harpoon_target(id, parm)
            
            set_task(8.0,"drag_end_2",id + 850)
        }
        else 
        {
            g_drag[id] = 33
            noTarget(id)
            emit_sound(hooktarget, CHAN_BODY, Zombie_Class_Power_Miss_Sounds[g_zombie_class[id]], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
            remove_task(id + 850)
        }
    } 
}
 
public drag_end(id) // drags end function
{
    if (g_zombie[id] && g_zombie_class[id] == 2) 
    {
        g_drag[id] = 0
        beam_remove(id)
        remove_task(id)
        remove_task(id + 850)
    
        if (get_gametime() - g_LastDrag[id] <= get_pcvar_float(cvar_smoker_drag_cooldown) + 0.08) 
        {
            return
        } 
        else
        {
            g_LastDrag[id] = get_gametime()
        }
    }
}
 
public drag_end_2(id)
{
    remove_task(id - 850)
        drag_end(id - 850)    
}
 
public smoker_reelin(parm[]) // dragging player to smoker
{
        new id = parm[0]
        new victim = parm[1]
    
        if (!g_drag[id])
        return
    
        if (!is_user_alive(victim)) 
    {
        drag_end(id)
        return
    }
    
    new Float:fl_Velocity[3]
        new idOrigin[3], vicOrigin[3]
    
        get_user_origin(victim, vicOrigin)
        get_user_origin(id, idOrigin)
    
        new distance = get_distance(idOrigin, vicOrigin)
    
        if (distance > 1) 
    {
        new Float:fl_Time = distance / get_pcvar_float(cvar_smoker_drag_speed)
        
        fl_Velocity[0] = (idOrigin[0] - vicOrigin[0]) / fl_Time
        fl_Velocity[1] = (idOrigin[1] - vicOrigin[1]) / fl_Time
        fl_Velocity[2] = (idOrigin[2] - vicOrigin[2]) / fl_Time
            }
    else 
    {
        fl_Velocity[0] = 0.0
        fl_Velocity[1] = 0.0
        fl_Velocity[2] = 0.0
        }
    entity_set_vector(victim, EV_VEC_velocity, fl_Velocity) //<- rewritten. now uses engine
}
 
public harpoon_target(id, parm[]) // set beam (ex. tongue:) if target is player
{
    if (g_zombie[id] && g_zombie_class[id] == 2) 
    {
        new id = parm[0]
        new hooktarget = parm[1]
    
        message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
        write_byte(8)    // TE_BEAMENTS
        write_short(id)
        write_short(hooktarget)
        write_short(g_Line)    // sprite index
        write_byte(0)    // start frame
        write_byte(0)    // framerate
        write_byte(200)    // life
        write_byte(8)    // width
        write_byte(1)    // noise
        write_byte(155)    // r, g, b
        write_byte(155)    // r, g, b
        write_byte(55)    // r, g, b
        write_byte(90)    // brightness
        write_byte(10)    // speed
        message_end()
    }
}
 
public noTarget(id) // set beam if target isn't player
{
    if (g_zombie[id] && g_zombie_class[id] == 2) 
    {
        new endorigin[3]
    
        get_user_origin(id, endorigin, 3)
    
        message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
        write_byte(TE_BEAMENTPOINT); // TE_BEAMENTPOINT
        write_short(id)
        write_coord(endorigin[0])
        write_coord(endorigin[1])
        write_coord(endorigin[2])
        write_short(g_Line) // sprite index
        write_byte(0)    // start frame
        write_byte(0)    // framerate
        write_byte(200)    // life
        write_byte(8)    // width
        write_byte(1)    // noise
        write_byte(155)    // r, g, b
        write_byte(155)    // r, g, b
        write_byte(55)    // r, g, b
        write_byte(75)    // brightness
        write_byte(0)    // speed
        message_end()
    }
} 
 
public beam_remove(id) // remove beam
{
    if (g_zombie[id] && g_zombie_class[id] == 2) 
    {
        message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
        write_byte(99)    //TE_KILLBEAM
        write_short(id)    //entity
        message_end()
    }   
}
//***************************************************************************************//
//***************************************[Tasks]*****************************************//
//***************************************************************************************//
public Task_Model(task)
{
    new id = task - TASKID_MODEL 
    
    fm_set_user_model(id, player_model[id])
}
 
public Task_NVG(task)
{
    new id = task - TASKID_NVG
    
    engclient_cmd(id, "nightvision")
    for(new i = 0; i < 10; i++)
        client_cmd(id, "-nvgadjust")
 
}
 
//***************************************************************************************//
//**************************************[Others]*****************************************//
//***************************************************************************************//
public ShowHUD(id)
{
    if(!is_user_alive(id))
        return PLUGIN_HANDLED
    
    if (g_zombie[id])
    {
        static health, class[32]
        health = get_user_health(id)
        
        copy(class, sizeof class - 1, Zombie_Class_Names[g_zombie_class[id]])
        
        set_hudmessage(0, 255, 0, 0.02, 0.97, 0, 0.0, 0.3, 0.0, 0.0)
        ShowSyncHudMsg(id, g_hudsync, "%L", LANG_PLAYER, "Zombie_class_hud", health, class)
    }
    
    else if (g_tank[id])
    {
        static health, class[32]
        health = get_user_health(id)
        
        copy(class, sizeof class - 1, Zombie_Class_Names[4])
        
        set_hudmessage(255, 0, 0, 0.02, 0.97, 0, 0.0, 0.3, 0.0, 0.0)
        ShowSyncHudMsg(id, g_hudsync, "%L", LANG_PLAYER, "Tank_hud", health, class)
    }
    
    else if (g_umbrella[id])
    {
        static health
        health = get_user_health(id)
        
        set_hudmessage(0, 0, 255, 0.02, 0.90, 0, 0.0, 0.3, 0.0, 0.0)
        ShowSyncHudMsg(id, g_hudsync, "%L", LANG_PLAYER, "Umbrella_hud", health)
    }
    return PLUGIN_CONTINUE
}
 
public WeaponStrip(id) 
{
    if(!is_user_alive(id))
        return PLUGIN_HANDLED
    
    if(g_zombie[id])
    {
        fm_strip_user_weapons(id)
        give_item(id, "weapon_knife")
        set_pev(id, pev_viewmodel2, Zombie_Class_Knife_Models[g_zombie_class[id]])
        set_pev(id, pev_weaponmodel2, "")
        
        if (is_user_bot(id))
        {
            return PLUGIN_HANDLED
        }
    }
    
    else if (g_tank[id])
    {
        fm_strip_user_weapons(id)
        give_item(id, "weapon_knife")
        set_pev(id, pev_viewmodel2, Zombie_Class_Knife_Models[4])
        set_pev(id, pev_weaponmodel2, "")
        
        if (is_user_bot(id))
        {
            return PLUGIN_HANDLED
        }
    }
    
    return PLUGIN_CONTINUE
}
 
public Tank_Spawn()
{
    new iPlayers[32], iNum
 
    if (get_pcvar_num(cvar_tank_bot) == 0)
    {
        get_players(iPlayers, iNum, "aceh", "TERRORIST"); // find a T human player
    }
    
    if (get_pcvar_num(cvar_tank_bot) == 1)
    {
        get_players(iPlayers, iNum, "aeh", "TERRORIST"); // find a T bot player
    }
    
    // there are players to choose from
    if (iNum && get_user_team(iNum) == 1)
    {
        // get a random index of the players array
        new iRandomIndex = random(iNum);
        
        // get the player index
        new iPlayer = iPlayers[iRandomIndex];
        
        // do what you want with iPlayer
        if (iPlayer)
        {
            g_tank[iPlayer] = true
            g_zombie[iPlayer] = false
            g_umbrella[iPlayer] = false
            g_pain_schok[iPlayer] = true
            
            new health5, Float:gravity5
            health5 = get_pcvar_num(cvar_tank_health)
            gravity5 = get_pcvar_float(cvar_tank_gravity) / 800
            
            set_user_health(iPlayer, health5)
            set_user_gravity(iPlayer, gravity5)
            
            static name[32]
            get_user_name(iPlayer, name, 31)
            set_hudmessage(255, 0, 0, -1.0, 0.29, 0, 6.0, 12.0);
            show_hudmessage(0, "%s Yra Tankas", name)
            
            copy(player_model[iPlayer], 31, Zombie_Player_Class_Models[4])
        
            new currentmodel[32];
            fm_get_user_model(iPlayer, currentmodel, charsmax(currentmodel))
        
            if(!equal(currentmodel, player_model[iPlayer]))
            {
                set_task(0.5 + g_counter, "Task_Model", iPlayer + TASKID_MODEL)
                g_counter += 0.2;
            }
        }
            
        set_task(random_float(0.1,0.5), "WeaponStrip", iNum)    
            
        if (get_pcvar_num(cvar_autonvg))
            set_task(0.2, "Task_NVG", TASKID_NVG + iNum)
    }
}
 
//***************************************************************************************//
//**************************************[Stocks]*****************************************//
//***************************************************************************************//
stock fm_strip_user_weapons(id)
{
    static ent
    ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "player_weaponstrip"))
    if (!pev_valid(ent)) return;
    
    dllfunc(DLLFunc_Spawn, ent)
    dllfunc(DLLFunc_Use, ent, id)
    engfunc(EngFunc_RemoveEntity, ent)
}
 
stock fm_set_user_model(player, modelname[])
{   
    engfunc(EngFunc_SetClientKeyValue, player, engfunc(EngFunc_GetInfoKeyBuffer, player), "model", modelname)
    
    g_model[player] = true
}
 
stock fm_get_user_model(player, model[], len)
{   
    engfunc(EngFunc_InfoKeyValue, engfunc(EngFunc_GetInfoKeyBuffer, player), "model", model, len)
}
 
stock fm_reset_user_model(player)
{         
    g_model[player] = false
    
    dllfunc(DLLFunc_ClientUserInfoChanged, player, engfunc(EngFunc_GetInfoKeyBuffer, player))
}

KamiN
Gana aktyvus vartotojas
Posts: 227
Joined: 2011 Apr 23 13:17

Re: Smokerio problemos. Ir boomer

Post by KamiN »

į paimk sma turinį

User avatar
psychical
Viršininkas
Posts: 2094
Joined: 2011 Mar 12 22:19
Skype: tautvydas11
Location: Linksmakalnis
Contact:

Re: Smokerio problemos. Ir boomer

Post by psychical »

http://rez.lt/sma.sma neglaiu talpint failo cia, todel va nuoroda, susikursit sma o i ji copy all ant paste...

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests