[AMX] Tổng hợp Code, Plug do Mem chế hoặc giới thiệu

Thảo luận trong 'Counter Strike' bắt đầu bởi Orpheus, 22/1/11.

  1. buiducduy_111

    buiducduy_111 Mr & Ms Pac-Man

    Tham gia ngày:
    5/3/10
    Bài viết:
    162
    Bác Dias có TUT lào về Eng không ?
     
  2. dias

    dias Mega Man

    Tham gia ngày:
    17/1/10
    Bài viết:
    3,226
    Nơi ở:
    SEOUL
  3. MrKaii

    MrKaii The Warrior of Light

    Tham gia ngày:
    14/6/11
    Bài viết:
    2,208
    Nơi ở:
    Hà Nội
    WTF :6cool_beat_brick:
     
  4. dias

    dias Mega Man

    Tham gia ngày:
    17/1/10
    Bài viết:
    3,226
    Nơi ở:
    SEOUL
    Buồn buồn ngồi share source code

    Món quà thứ First

    1. Robot XT-300 Goliath
    - Resource: Tự Kiếm trong folder cso
    - Sài thế nào ?: đây chỉ là code ko phải gameplay, nên phải tạo = tay, đến vị trí cần tạo rồi gõ /get_origin rồi gõ tiếp /make để tạo goliath ngay chỗ mình vừa get
    - Video:
    [video=youtube;yMWHBXHL4gI]http://www.youtube.com/watch?v=yMWHBXHL4gI[/URL][/video]
    PHP:
    #include <amxmodx>
    #include <engine>
    #include <fakemeta_util>
    #include <fakemeta>
    #include <hamsandwich>
    #include <xs>

    #define PLUGIN "[Dias's NPC] Goliath"
    #define VERSION "1.0"
    #define AUTHOR "Dias"

    #define GOLIATH_HEALTH 500.0
    #define GOLIATH_CLASSNAME "goliath"
    #define ROCKET_DAMAGE 30.0
    #define FIRE_DAMAGE 25.0
    #define SHOOT_DAMAGE 40.0

    new const goliath_model[] = "models/goliath/goliath.mdl"

    // MainCode
    new goliath_model_idg_regg_entg_doing_skillg_doing_specialg_special_countg_special_shoot
    new Float:MyOrigin[3], Float:MyAngles[3], Float:MyVAngle[3], Float:g_last_check
    #define TASK_IDLE 56765

    // Shoot Code
    new g_shoot_vir_ent1g_shoot_vir_ent2g_shoot_vir_ent3g_shoot_vir_ent4
    #define TASK_SHOOT 4123125
    #define TASK_S_ROTATE 412312
    #define TASK_S_ROTATE_M1 412313
    #define TASK_S_ROTATE_M2 412314
    #define TASK_S_ROTATE_M3 42316
    new g_shoot_rotate_modeg_shoot_count
    new g_bloodg_bloodspray

    // Missile
    new const missile_model[] = "models/goliath/dron_missile.mdl"
    new const missile_sound[1][] = {
        
    "goliath/dron_missle_exp.wav"
    }
    #define TASK_DO_MISSILE 322543
    #define MISSILE_TIME 3
    #define MISSILE_CLASSNAME "missile_goliath"
    new g_missile_countg_missile_vir_ent1g_missile_vir_ent2
    new g_exp_spr_idg_smoke_spr_id

    // FireCode
    new const fire_spr_name[] = "sprites/fire_salamander.spr"
    #define FIRE_CLASSNAME "fire_goliath"
    new g_virtual_ent1g_fire_rotate_modeg_fire_count
    #define TASK_FIRE 3123125
    #define TASK_ROTATE 312312
    #define TASK_ROTATE_M1 312313
    #define TASK_ROTATE_M2 312314
    #define TASK_ROTATE_M3 312316

    public plugin_init()
    {
        
    register_plugin(PLUGINVERSIONAUTHOR)
        
        
    register_event("HLTV""event_newround""a""1=0""2=0")
        
        
    // Fire Salamander
        
    register_forward(FM_Touch"fw_touch")
        
    register_think(FIRE_CLASSNAME"fw_fire_think")    
        
    register_think(MISSILE_CLASSNAME"fw_missile_think")    
        
        
    register_clcmd("say /get_origin""get_origin")
        
    register_clcmd("say /make""create_goliath")
        
        
    //register_clcmd("say /did", "did_skill")
    }

    public 
    plugin_precache()
    {
        
    // Fire Code
        
    precache_model(fire_spr_name)
        
        
    // Missile Code
        
    precache_model(missile_model)
        
    g_exp_spr_id precache_model("sprites/zerogxplode.spr")
        
    g_smoke_spr_id precache_model("sprites/steam1.spr")
        for(new 
    0sizeof(missile_sound); i++)
            
    precache_sound(missile_sound[i])
        
        
    g_blood precache_model("sprites/blood.spr")
        
    g_bloodspray precache_model("sprites/bloodspray.spr")    
        
    goliath_model_id engfunc(EngFunc_PrecacheModelgoliath_model)
    }

    public 
    get_origin(id)
    {
        
    pev(idpev_originMyOrigin)
        
    pev(idpev_anglesMyAngles)
        
    pev(idpev_v_angleMyVAngle)
        
        
    message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
    write_byte(TE_EXPLOSION)
        
    engfunc(EngFunc_WriteCoordMyOrigin[0])
        
    engfunc(EngFunc_WriteCoordMyOrigin[0])
        
    engfunc(EngFunc_WriteCoordMyOrigin[0])
        
    write_short(g_exp_spr_id)    // sprite index
        
    write_byte(10)    // scale in 0.1's
        
    write_byte(30)    // framerate
        
    write_byte(4)    // flags
        
    message_end()    
    }

    public 
    create_goliath(id)
    {
        new 
    ent create_entity("info_target")
        
    g_ent ent
        
        entity_set_origin
    (entMyOrigin)

        
    MyVAngle[0] = 0.0
        set_pev
    (entpev_anglesMyVAngle)
        
    set_pev(entpev_v_angleMyVAngle)
        
        
    entity_set_float(entEV_FL_takedamage1.0)
        
    entity_set_float(entEV_FL_healthGOLIATH_HEALTH 1000.0)
        
        
    entity_set_string(ent,EV_SZ_classnameGOLIATH_CLASSNAME)
        
    entity_set_model(entgoliath_model)
        
    entity_set_int(entEV_INT_solidSOLID_BBOX)
        
    entity_set_int(entEV_INT_movetypeMOVETYPE_STEP)
        
        new 
    Float:maxs[3] = {200.0200.0300.0}
        new 
    Float:mins[3] = {-200.0, -200.0, -0.0}
        
    entity_set_size(entminsmaxs)
        
    entity_set_int(entEV_INT_modelindexgoliath_model_id)
        
        
    set_pev(entpev_controller125)
        
    set_pev(entpev_controller_0125)
        
    set_pev(entpev_controller_1125)
        
    set_pev(entpev_controller_2125)
        
    set_pev(entpev_controller_3125)
        
        
    set_entity_anim(ent1)
        
        
    entity_set_float(entEV_FL_nextthinkhalflife_time() + 3.0)
        
    set_task(3.0"start_goliath"ent)
        
        if(!
    g_reg)
        {
            
    RegisterHamFromEntity(Ham_TakeDamageent"fw_takedmg"1)
            
    RegisterHamFromEntity(Ham_Thinkent"fw_think")
            
    g_reg 1
        
    }    
        
        
    g_doing_skill 0
        g_doing_special 
    0
        
        drop_to_floor
    (ent)
    }

    public 
    start_goliath(ent)
    {
        
    set_entity_anim(ent2)
        
    entity_set_float(entEV_FL_nextthinkhalflife_time() + 0.1)
    }

    public 
    did_skill(id)
    {    
        
    //starting_flame(g_ent)
        //starting_missile(g_ent)
        //starting_shoot(g_ent)
    }

    public 
    set_idle(ent)
    {
        
    ent -= TASK_IDLE
        
        set_entity_anim
    (ent2)
        
    g_doing_skill 0
        g_doing_special 
    0
        
        entity_set_float
    (entEV_FL_nextthinkget_gametime() + 1.0)        
    }

    public 
    goliath_death(ent)
    {
        
    set_entity_anim(ent4)
        
    set_task(15.0"move_entity"ent)
        
    entity_set_int(entEV_INT_solidSOLID_NOT)
        
    entity_set_float(entEV_FL_takedamage0.0)
    }

    public 
    move_entity(ent)
    {
        
    remove_entity(ent)
    }

    public 
    stop_all_skill(ent)
    {
        
    // Stop Fire
        
    remove_entity(g_virtual_ent1)
        
        
    remove_task(ent+TASK_FIRE)
        
    remove_task(ent+TASK_ROTATE)
        
    remove_task(ent+TASK_ROTATE_M1)
        
    remove_task(ent+TASK_ROTATE_M2)
        
    remove_task(ent+TASK_ROTATE_M3)    
        
        
    // Stop Missile
        
    remove_task(ent+TASK_DO_MISSILE)
        
        
    remove_entity(g_missile_vir_ent1)
        
    remove_entity(g_missile_vir_ent2)
        
        
    // Stop Shoot
        
    remove_entity(g_shoot_vir_ent1)
        
    remove_entity(g_shoot_vir_ent2)
        
    remove_entity(g_shoot_vir_ent3)
        
    remove_entity(g_shoot_vir_ent4)    
        
        
    remove_task(ent+TASK_SHOOT)
        
    remove_task(ent+TASK_S_ROTATE)
        
    remove_task(ent+TASK_S_ROTATE_M1)
        
    remove_task(ent+TASK_S_ROTATE_M2)
        
    remove_task(ent+TASK_S_ROTATE_M3)    
        
        
    // Reset Main
        
    set_pev(entpev_controller_0125)
        
    set_entity_anim(ent2)
        
    g_doing_skill 0    
        g_special_shoot 
    0
        g_doing_special 
    0
        
        entity_set_float
    (entEV_FL_nextthinkget_gametime() + 0.1)
    }

    public 
    event_newround()
    {
        
    stop_all_skill(g_ent)
        
        
    g_doing_skill 0
        g_doing_special 
    0
        g_special_shoot 
    0
        
        remove_entity_name
    (GOLIATH_CLASSNAME)
    }

    // Shoot Code
    public starting_shoot(entspecial)
    {
        if(
    g_doing_skill || g_doing_special)
            return 
    PLUGIN_HANDLED
        
        g_shoot_vir_ent1 
    create_entity("info_target")
        
    g_shoot_vir_ent2 create_entity("info_target")
        
    g_shoot_vir_ent3 create_entity("info_target")
        
    g_shoot_vir_ent4 create_entity("info_target")    

        
    set_pev(entpev_controller_0140)
        
        if(
    special)
        {
            
    g_doing_skill 0
            g_special_shoot 
    1
            set_entity_anim
    (ent14)
        }
        else 
        {
            
    g_doing_skill 1
            g_special_shoot 
    0
            set_entity_anim
    (ent8)
        }
        
        static 
    Float:Origin1[3], Float:Origin2[3], Float:Angles[3]

        
    get_position(ent225.0170.0250.0Origin1)
        
    get_position(ent225.0, -170.0250.0Origin2)
        
        
    pev(entpev_anglesAngles)

        
    set_pev(g_shoot_vir_ent1pev_originOrigin1)
        
    set_pev(g_shoot_vir_ent2pev_originOrigin2)    
        
        
    Angles[0] -= 15.0
        
        set_pev
    (g_shoot_vir_ent1pev_anglesAngles)
        
    set_pev(g_shoot_vir_ent2pev_anglesAngles)
        
        
    Angles[0] -= Angles[0] * 2
        set_pev
    (g_shoot_vir_ent1pev_v_angleAngles)
        
    set_pev(g_shoot_vir_ent2pev_v_angleAngles)    
        
        
    reset_vector(ent)
        
        
    set_task(1.0"do_shoot"ent+TASK_SHOOT)    
        
        if(!
    special)
            
    set_task(3.0"do_shoot_rotate_m1"ent+TASK_S_ROTATE)
        else
            
    set_task(11.0"stop_shoot"ent)
        
        return 
    PLUGIN_HANDLED    
    }

    public 
    stop_shoot(ent)
    {
        if(!
    pev_valid(ent))
            return 
    PLUGIN_HANDLED
        
        remove_entity
    (g_shoot_vir_ent1)
        
    remove_entity(g_shoot_vir_ent2)
        
    remove_entity(g_shoot_vir_ent3)
        
    remove_entity(g_shoot_vir_ent4)    
        
        
    set_pev(entpev_controller_0125)
        
        
    remove_task(ent+TASK_SHOOT)
        
    remove_task(ent+TASK_S_ROTATE)
        
    remove_task(ent+TASK_S_ROTATE_M1)
        
    remove_task(ent+TASK_S_ROTATE_M2)
        
    remove_task(ent+TASK_S_ROTATE_M3)    
        
        if(
    g_special_shoot)
        {
            
    g_special_shoot 0
            g_doing_special 
    0
            
            set_entity_anim
    (ent16)
            
    set_task(0.1"set_idle"ent+TASK_IDLE)
        } else {
            
    g_special_shoot 0
            g_doing_special 
    0
            
            set_entity_anim
    (ent7)
            
    set_task(1.0"set_idle"ent+TASK_IDLE)
        }
        
        return 
    PLUGIN_HANDLED
    }

    public 
    do_shoot_rotate_m1(ent)
    {
        
    ent -= TASK_S_ROTATE

        g_shoot_rotate_mode 
    1
        g_shoot_count 
    50
        
        set_entity_anim
    (ent9)
        
    set_task(0.1"shoot_rotate_m1"ent+TASK_S_ROTATE_M1)
    }

    public 
    shoot_rotate_m1(ent)
    {
        
    ent -= TASK_S_ROTATE_M1
        
        
    if(g_shoot_rotate_mode != 1)
            return 
    PLUGIN_HANDLED
        
        
    static Float:Angles[3]
        
    pev(entpev_anglesAngles)
        
        if(
    g_shoot_count 0)
        {
            
    Angles[1] -= 1.0
            g_shoot_count
    --
            
            
    set_pev(entpev_anglesAngles)
            
            
    Angles[0] -= Angles[0] * 2
            set_pev
    (entpev_v_angleAngles)
            
            
    set_task(0.075"shoot_rotate_m1"ent+TASK_S_ROTATE_M1)
        } else {
            
    g_shoot_rotate_mode 2
            g_shoot_count 
    100
            
            set_task
    (0.1"shoot_rotate_m2"ent+TASK_S_ROTATE_M2)
        }
        
        return 
    PLUGIN_HANDLED
    }

    public 
    shoot_rotate_m2(ent)
    {
        
    ent -= TASK_S_ROTATE_M2
        
        
    if(g_shoot_rotate_mode != 2)
            return 
    PLUGIN_HANDLED
        
        
    static Float:Angles[3]
        
    pev(entpev_anglesAngles)
        
        if(
    g_shoot_count 0)
        {
            
    Angles[1] += 1.0
            g_shoot_count
    --
            
            
    set_pev(entpev_anglesAngles)
            
            
    Angles[0] -= Angles[0] * 2
            set_pev
    (entpev_v_angleAngles)
            
            
    set_task(0.075"shoot_rotate_m2"ent+TASK_S_ROTATE_M2)
        } else {
            
    g_shoot_rotate_mode 3
            g_shoot_count 
    50
            
            set_task
    (0.1"shoot_rotate_m3"ent+TASK_S_ROTATE_M3)
        }
        
        return 
    PLUGIN_HANDLED
    }

    public 
    shoot_rotate_m3(ent)
    {
        
    ent -= TASK_S_ROTATE_M3
        
        
    if(g_shoot_rotate_mode != 3)
            return 
    PLUGIN_HANDLED
        
        
    static Float:Angles[3]
        
    pev(entpev_anglesAngles)
        
        if(
    g_shoot_count 0)
        {
            
    Angles[1] -= 1.0
            g_shoot_count
    --
            
            
    set_pev(entpev_anglesAngles)
            
            
    Angles[0] -= Angles[0] * 2
            set_pev
    (entpev_v_angleAngles)
            
            
    set_task(0.075"shoot_rotate_m3"ent+TASK_S_ROTATE_M3)
        } else {
            
    g_shoot_rotate_mode 0
            g_shoot_count 
    0
            
            stop_shoot
    (ent)
        }
        
        return 
    PLUGIN_HANDLED
    }

    public 
    do_shoot(ent)
    {
        
    ent -= TASK_SHOOT

        
    static Float:Origin1[5][3], Float:Origin2[5][3], Float:AimOrigin1[5][3], Float:AimOrigin2[5][3]
        
        
    reset_vector(ent)
        
        if(
    g_special_shoot)
        {
            if(
    pev(entpev_sequence) != 15)
                
    set_entity_anim(ent15)
        } else {
            if(
    pev(entpev_sequence) != 9)
                
    set_entity_anim(ent9)        
        }

        
    // 1st
        
    get_position(g_shoot_vir_ent10.030.00.0Origin1[0])
        
    get_position(g_shoot_vir_ent30.030.00.0AimOrigin1[0])
        
        
    get_position(g_shoot_vir_ent10.0, -30.00.0Origin1[1])
        
    get_position(g_shoot_vir_ent30.0, -30.00.0AimOrigin1[1])
        
        
    get_position(g_shoot_vir_ent10.00.00.0Origin1[2])
        
    get_position(g_shoot_vir_ent30.00.00.0AimOrigin1[2])
        
        
    get_position(g_shoot_vir_ent10.00.0, -30.0Origin1[3])
        
    get_position(g_shoot_vir_ent30.00.0, -30.0AimOrigin1[3])
        
        
    get_position(g_shoot_vir_ent10.00.030.0Origin1[4])
        
    get_position(g_shoot_vir_ent30.00.030.0AimOrigin1[4])
        
        
    // 2nd
        
    get_position(g_shoot_vir_ent20.030.00.0Origin2[0])
        
    get_position(g_shoot_vir_ent40.030.00.0AimOrigin2[0])
        
        
    get_position(g_shoot_vir_ent20.0, -30.00.0Origin2[1])
        
    get_position(g_shoot_vir_ent40.0, -30.00.0AimOrigin2[1])
        
        
    get_position(g_shoot_vir_ent20.00.00.0Origin2[2])
        
    get_position(g_shoot_vir_ent40.00.00.0AimOrigin2[2])
        
        
    get_position(g_shoot_vir_ent20.00.0, -30.0Origin2[3])
        
    get_position(g_shoot_vir_ent40.00.0, -30.0AimOrigin2[3])
        
        
    get_position(g_shoot_vir_ent20.00.030.0Origin2[4])
        
    get_position(g_shoot_vir_ent40.00.030.0AimOrigin2[4])

        for(new 
    0sizeof(Origin1); i++)
            
    create_tracer(g_shoot_vir_ent1Origin1[i], AimOrigin1[i])
        for(new 
    0sizeof(Origin1); i++)
            
    create_tracer(g_shoot_vir_ent2Origin2[i], AimOrigin2[i])
        
        
    set_task(0.1"do_shoot"ent+TASK_SHOOT)
    }

    public 
    reset_vector(ent)
    {
        static 
    Float:Origin1[3], Float:Origin2[3], Float:Angles[3], Float:Angles2[3]

        
    get_position(ent225.0170.0250.0Origin1)
        
    get_position(ent225.0, -170.0250.0Origin2)
        
        
    pev(entpev_anglesAngles)

        
    set_pev(g_shoot_vir_ent1pev_originOrigin1)
        
    set_pev(g_shoot_vir_ent2pev_originOrigin2)    
        
        
    Angles[0] -= 15.0
        
        set_pev
    (g_shoot_vir_ent1pev_anglesAngles)
        
    set_pev(g_shoot_vir_ent2pev_anglesAngles)
        
        
    Angles[0] -= Angles[0] * 2
        set_pev
    (g_shoot_vir_ent1pev_v_angleAngles)
        
    set_pev(g_shoot_vir_ent2pev_v_angleAngles)    
        
        static 
    Float:AimOrigin1[3], Float:AimOrigin2[3]
        
        
    fm_get_aim_origin(g_shoot_vir_ent1AimOrigin1)
        
    fm_get_aim_origin(g_shoot_vir_ent2AimOrigin2)
        
        
    pev(g_shoot_vir_ent1pev_anglesAngles)
        
    pev(g_shoot_vir_ent2pev_anglesAngles2)
        
        
    set_pev(g_shoot_vir_ent3pev_originAimOrigin1)
        
    set_pev(g_shoot_vir_ent4pev_originAimOrigin2)        
        
        
    set_pev(g_shoot_vir_ent3pev_anglesAngles)
        
    set_pev(g_shoot_vir_ent4pev_anglesAngles)
        
        
    Angles[0] -= Angles[0] * 2
        set_pev
    (g_shoot_vir_ent3pev_v_angleAngles)
        
    set_pev(g_shoot_vir_ent4pev_v_angleAngles)        
    }
    // End Of Shoot Code

    // Missile Code
    public starting_missile(ent)
    {
        if(
    g_doing_skill || g_doing_special)
            return 
    PLUGIN_HANDLED
        
        g_doing_skill 
    1
        set_entity_anim
    (ent11)
        
    g_missile_count MISSILE_TIME
        
        
    // Make Virtual Entity Function
        
    g_missile_vir_ent1 create_entity("info_target")
        
    g_missile_vir_ent2 create_entity("info_target")
        
        static 
    Float:Origin1[3], Float:Origin2[3], Float:Angles[3]
        
        
    get_position(ent100.0100.0450.0Origin1)
        
    get_position(ent100.0, -100.0450.0Origin2)
        
    pev(entpev_anglesAngles)

        
    set_pev(g_missile_vir_ent1pev_originOrigin1)
        
    set_pev(g_missile_vir_ent2pev_originOrigin2)
        
        
    Angles[0] -= 10.0
        
        
    //Angles[1] += 30.0
        
    set_pev(g_missile_vir_ent1pev_anglesAngles)
        
        
    //(Angles[1] += 30.0) + 30.0
        
    set_pev(g_missile_vir_ent2pev_anglesAngles)
        
        
    Angles[0] -= Angles[0] * 2
        set_pev
    (g_missile_vir_ent1pev_v_angleAngles)
        
    set_pev(g_missile_vir_ent2pev_v_angleAngles)    
        
    // End Of Make Virtual Ent Func
        
        
    set_task(1.0"do_rocket"ent+TASK_DO_MISSILE)
        
        return 
    PLUGIN_HANDLED
    }

    public 
    stop_missile(ent)
    {
        
    remove_task(ent+TASK_DO_MISSILE)
        
        
    remove_entity(g_missile_vir_ent1)
        
    remove_entity(g_missile_vir_ent2)
        
        
    set_entity_anim(ent13)
        
    set_task(1.0"set_idle"ent+TASK_IDLE)
    }

    public 
    do_rocket(ent)
    {
        
    ent -= TASK_DO_MISSILE
        
        
    if(g_missile_count >= 0)
        {
            
    g_missile_count--
            
    set_entity_anim(ent12)
        
            static 
    Float:Origin1[3], Float:Origin2[3]
        
            
    pev(g_missile_vir_ent1pev_originOrigin1)
            
    pev(g_missile_vir_ent2pev_originOrigin2)
        
            
    message_begin(MSG_BROADCASTSVC_TEMPENTITY)
            
    write_byte(TE_SPRITE)
            
    write_coord(floatround(Origin1[0]))
            
    write_coord(floatround(Origin1[1]))
            
    write_coord(floatround(Origin1[2]))
            
    write_short(g_smoke_spr_id
            
    write_byte(30
            
    write_byte(100)
            
    message_end()
        
            
    message_begin(MSG_BROADCASTSVC_TEMPENTITY)
            
    write_byte(TE_SPRITE)
            
    write_coord(floatround(Origin2[0]))
            
    write_coord(floatround(Origin2[1]))
            
    write_coord(floatround(Origin2[2]))
            
    write_short(g_smoke_spr_id)
            
    write_byte(30
            
    write_byte(100)
            
    message_end()        
        
            
    make_coord_rocket(ent)
                
            
    set_task(1.0"do_rocket"ent+TASK_DO_MISSILE)
        } else {
            
    stop_missile(ent)
            
    g_missile_count 0
        
    }
    }

    public 
    make_coord_rocket(ent)
    {
        static 
    Float:Origin1[5][3], Float:Origin2[5][3]
        
        
    // Get Coord
        
        // 1st Rocket
        
    get_position(g_missile_vir_ent10.080.00.0Origin1[0])
        
    get_position(g_missile_vir_ent10.080.00.0Origin1[0])
        
        
    get_position(g_missile_vir_ent150.040.00.0Origin1[1])
        
    get_position(g_missile_vir_ent150.040.00.0Origin1[1])
        
        
    get_position(g_missile_vir_ent10.00.00.0Origin1[2])
        
    get_position(g_missile_vir_ent10.00.00.0Origin1[2])
        
        
    get_position(g_missile_vir_ent150.0, -40.00.0Origin1[3])
        
    get_position(g_missile_vir_ent150.0, -40.00.0Origin1[3])    
        
        
    get_position(g_missile_vir_ent10.0, -80.00.0Origin1[4])
        
    get_position(g_missile_vir_ent10.0, -80.00.0Origin1[4])    
        
        
    // 2nd Rocket
        
    get_position(g_missile_vir_ent20.080.00.0Origin2[0])
        
    get_position(g_missile_vir_ent20.080.00.0Origin2[0])
        
        
    get_position(g_missile_vir_ent250.040.00.0Origin2[1])
        
    get_position(g_missile_vir_ent250.040.00.0Origin2[1])
        
        
    get_position(g_missile_vir_ent20.00.00.0Origin2[2])
        
    get_position(g_missile_vir_ent20.00.00.0Origin2[2])
        
        
    get_position(g_missile_vir_ent250.0, -40.00.0Origin2[3])
        
    get_position(g_missile_vir_ent250.0, -40.00.0Origin2[3])    
        
        
    get_position(g_missile_vir_ent20.0, -80.00.0Origin2[4])
        
    get_position(g_missile_vir_ent20.0, -80.00.0Origin2[4])    
        
        for(new 
    0sizeof(Origin1); i++)
            
    make_rocket(g_missile_vir_ent1Origin1[i])
        for(new 
    0sizeof(Origin2); i++)
            
    make_rocket(g_missile_vir_ent2Origin2[i])    
    }

    public 
    make_rocket(start_entFloat:Origin[3])
    {
        new 
    ent create_entity("info_target")

        static 
    Float:Angles[3]
        
    pev(start_entpev_anglesAngles)
        
        
    set_pev(entpev_anglesAngles)
        
    Angles[0] -= Angles[0] * 2
        set_pev
    (entpev_v_angleAngles)
        
    set_pev(entpev_fuser4Angles[0])

        
    entity_set_origin(entOrigin)
        
        
    entity_set_string(ent,EV_SZ_classnameMISSILE_CLASSNAME)
        
    entity_set_model(entmissile_model)
        
    entity_set_int(entEV_INT_solid2)
        
    entity_set_int(entEV_INT_movetypeMOVETYPE_FLY)
        
        new 
    Float:maxs[3] = {1.0,1.0,1.0}
        new 
    Float:mins[3] = {-1.0,-1.0,-1.0}
        
    entity_set_size(entminsmaxs)
        
        
    set_pev(entpev_ownerstart_ent)
        
    set_pev(entpev_fuser3random_float(1000.02000.0))
        
        
    set_entity_anim(ent0)
        
    entity_set_float(entEV_FL_nextthinkhalflife_time() + 0.01)
    }

    public 
    fw_missile_think(missile)
    {
        if(!
    pev_valid(missile))
            return
            
        static 
    owner
            
        
    if(pev_valid(pev(missilepev_owner)))
        {
            
    owner pev(missilepev_owner)
        } else {
            
    owner missile
        
    }
            
        if(
    entity_range(missileowner) > 50.0)
        {
            static 
    Float:Angles[3]
            
    pev(missilepev_anglesAngles)
            
            if(
    Angles[0] > pev(missilepev_fuser4) - 50.0)
            {
                
    Angles[0] -= 1.0
                set_pev
    (missilepev_anglesAngles)
                
                
    Angles[0] -= Angles[0] * 2
                set_pev
    (missilepev_v_angleAngles)
            }
        }
            
        static 
    Float:AimOrigin[3], Float:Origin[3]
        
    fm_get_aim_origin(missileAimOrigin)
        
        
    pev(missilepev_originOrigin)
        
        if(
    get_distance_f(OriginAimOrigin) < 100.0)
        {
            
    message_begin(MSG_BROADCASTSVC_TEMPENTITY)
            
    write_byte(TE_SPRITE)
            
    write_coord(floatround(Origin[0]))
            
    write_coord(floatround(Origin[1]))
            
    write_coord(floatround(Origin[2]))
            
    write_short(g_exp_spr_id
            
    write_byte(30
            
    write_byte(100)
            
    message_end()
            
            for(new 
    1get_maxplayers(); i++)
            {
                if(
    is_user_alive(i) && entity_range(imissile) <= 300.0)
                {
                    static 
    Float:Damage
                    Damage 
    ROCKET_DAMAGE
                    
                    ExecuteHam
    (Ham_TakeDamagei0iDamageDMG_BULLET)
                    
    hit_screen(i)
                }
            }        
            
            
    emit_sound(missileCHAN_BODYmissile_sound[0], 1.0ATTN_NORM0PITCH_NORM)
            
            
    remove_entity(missile)    
        } else {
            
    hook_ent2(missileAimOriginfloat(pev(missilepev_fuser3)))
            
    entity_set_float(missileEV_FL_nextthinkhalflife_time() + 0.01)
        }
    }
    // End of Missile Code

    // FlameThrower Code
    public starting_flame(ent)
    {
        if(
    g_doing_skill)
            return 
    PLUGIN_HANDLED
        
        g_doing_skill 
    1
        g_virtual_ent1 
    create_entity("info_target")
        
        
    set_pev(entpev_controller_0140)
        
    set_entity_anim(ent5)
        
        
    set_task(1.0"do_fire"ent+TASK_FIRE)    
        
    set_task(3.0"do_fire_rotate_m1"ent+TASK_ROTATE)
        
        return 
    PLUGIN_HANDLED
    }

    public 
    stop_flame(ent)
    {
        
    remove_entity(g_virtual_ent1)
        
        
    set_pev(entpev_controller_0125)
        
        
    remove_task(ent+TASK_FIRE)
        
    remove_task(ent+TASK_ROTATE)
        
    remove_task(ent+TASK_ROTATE_M1)
        
    remove_task(ent+TASK_ROTATE_M2)
        
    remove_task(ent+TASK_ROTATE_M3)    
        
        
    set_entity_anim(ent7)
        
    set_task(1.0"set_idle"ent+TASK_IDLE)
    }

    public 
    do_fire_rotate_m1(ent)
    {
        
    ent -= TASK_ROTATE

        g_fire_rotate_mode 
    1
        g_fire_count 
    50
        
        set_entity_anim
    (ent6)
        
    set_task(0.1"fire_rotate_m1"ent+TASK_ROTATE_M1)
    }

    public 
    fire_rotate_m1(ent)
    {
        
    ent -= TASK_ROTATE_M1
        
        
    if(g_fire_rotate_mode != 1)
            return 
    PLUGIN_HANDLED
        
        
    static Float:Angles[3]
        
    pev(entpev_anglesAngles)
        
        if(
    g_fire_count 0)
        {
            
    Angles[1] -= 1.0
            g_fire_count
    --
            
            
    set_pev(entpev_anglesAngles)
            
            
    Angles[0] -= Angles[0] * 2
            set_pev
    (entpev_v_angleAngles)
            
            
    set_task(0.1"fire_rotate_m1"ent+TASK_ROTATE_M1)
        } else {
            
    g_fire_rotate_mode 2
            g_fire_count 
    100
            
            set_task
    (0.1"fire_rotate_m2"ent+TASK_ROTATE_M2)
        }
        
        return 
    PLUGIN_HANDLED
    }

    public 
    fire_rotate_m2(ent)
    {
        
    ent -= TASK_ROTATE_M2
        
        
    if(g_fire_rotate_mode != 2)
            return 
    PLUGIN_HANDLED
        
        
    static Float:Angles[3]
        
    pev(entpev_anglesAngles)
        
        if(
    g_fire_count 0)
        {
            
    Angles[1] += 1.0
            g_fire_count
    --
            
            
    set_pev(entpev_anglesAngles)
            
            
    Angles[0] -= Angles[0] * 2
            set_pev
    (entpev_v_angleAngles)
            
            
    set_task(0.1"fire_rotate_m2"ent+TASK_ROTATE_M2)
        } else {
            
    g_fire_rotate_mode 3
            g_fire_count 
    50
            
            set_task
    (0.1"fire_rotate_m3"ent+TASK_ROTATE_M3)
        }
        
        return 
    PLUGIN_HANDLED
    }

    public 
    fire_rotate_m3(ent)
    {
        
    ent -= TASK_ROTATE_M3
        
        
    if(g_fire_rotate_mode != 3)
            return 
    PLUGIN_HANDLED
        
        
    static Float:Angles[3]
        
    pev(entpev_anglesAngles)
        
        if(
    g_fire_count 0)
        {
            
    Angles[1] -= 1.0
            g_fire_count
    --
            
            
    set_pev(entpev_anglesAngles)
            
            
    Angles[0] -= Angles[0] * 2
            set_pev
    (entpev_v_angleAngles)
            
            
    set_task(0.1"fire_rotate_m3"ent+TASK_ROTATE_M3)
        } else {
            
    g_fire_rotate_mode 0
            g_fire_count 
    0
            
            stop_flame
    (ent)
        }
        
        return 
    PLUGIN_HANDLED
    }

    public 
    do_fire(ent)
    {
        
    ent -= TASK_FIRE

        
    static Float:rotate_degree[3], Float:Origin[3]
        
        
    // 1st
        
    rotate_degree[0] = 125.0
        rotate_degree
    [1] = 170.0
        rotate_degree
    [2] = 225.0

        get_position
    (entrotate_degree[0], rotate_degree[1], rotate_degree[2], Origin)
        
    throw_fire(entOrigin)
        
        
    // 2nd
        
    rotate_degree[0] = 125.0
        rotate_degree
    [1] = -170.0
        rotate_degree
    [2] = 225.0
        
        get_position
    (entrotate_degree[0], rotate_degree[1], rotate_degree[2], Origin)
        
    throw_fire(entOrigin)
        
        
    set_task(0.1"do_fire"ent+TASK_FIRE)
    }

    public 
    throw_fire(entFloat:Origin[3])
    {
        static 
    iEnt
        iEnt 
    create_entity("env_sprite")
        static 
    Float:vfVelocity[3], Float:Angles[3]
        
    pev(entpev_anglesAngles)
        
        
    set_pev(g_virtual_ent1pev_originOrigin)
        
        
    Angles[0] += 25.0
        set_pev
    (g_virtual_ent1pev_anglesAngles)
        
    set_pev(g_virtual_ent1pev_v_angleAngles)
        
        
    velocity_by_aim(g_virtual_ent11000vfVelocity)
        
    xs_vec_mul_scalar(vfVelocity0.4vfVelocity)
        
        
    // add velocity of Owner for ent
        
    static Float:fOwnerVel[3], Float:vfAngle[3]
        
    pev(entpev_anglesvfAngle)
        
        
    //vfAttack[1] += 7.0
        
    fOwnerVel[2] = 0.0
        
        
    // set info for ent
        
    set_pev(iEntpev_movetypeMOVETYPE_FLY)
        
    set_pev(iEntpev_rendermodekRenderTransAdd)
        
    set_pev(iEntpev_renderamt150.0)
        
    set_pev(iEntpev_fuser1get_gametime() + 1.5)
        
    set_pev(iEntpev_scale0.2)
        
    set_pev(iEntpev_nextthinkhalflife_time() + 0.05)
        
        
    set_pev(iEntpev_classnameFIRE_CLASSNAME)
        
    engfunc(EngFunc_SetModeliEntfire_spr_name)
        
    set_pev(iEntpev_minsFloat:{-1.0, -1.0, -36.0})
        
    set_pev(iEntpev_maxsFloat:{1.01.036.0})
        
    set_pev(iEntpev_originOrigin)
        
    set_pev(iEntpev_gravity0.01)
        
    set_pev(iEntpev_velocityvfVelocity)
        
    vfAngle[1] += 30.0
        set_pev
    (iEntpev_anglesvfAngle)
        
    set_pev(iEntpev_solidSOLID_BBOX)
        
    set_pev(iEntpev_ownerent)
        
    set_pev(iEntpev_iuser21)
    }

    public 
    fw_fire_think(iEnt)
    {
        if ( !
    pev_valid(iEnt) ) return;

        new 
    Float:fFrameFloat:fScaleFloat:fNextThink
        pev
    (iEntpev_framefFrame)
        
    pev(iEntpev_scalefScale)

        
    // effect exp
        
    new iMoveType pev(iEntpev_movetype)
        if (
    iMoveType == MOVETYPE_NONE)
        {
            
    fNextThink 0.015
            fFrame 
    += 1.0
            fScale 
    floatmax(fScale1.0)
            
            if (
    fFrame 21.0)
            {
                
    engfunc(EngFunc_RemoveEntityiEnt)
                return
            }
        }
        
        
    // effect normal
        
    else
        {
            
    fNextThink 0.045
            fFrame 
    += 1.0
            fFrame 
    floatmin(21.0fFrame)
            
    fScale += 1.0
            fScale 
    floatmin(fScale3.0)
        }

        
    set_pev(iEntpev_framefFrame)
        
    set_pev(iEntpev_scalefScale)
        
    set_pev(iEntpev_nextthinkhalflife_time() + fNextThink)

        
    // time remove
        
    new Float:fTimeRemove
        pev
    (iEntpev_fuser1fTimeRemove)
        if (
    get_gametime() >= fTimeRemove)
        {
            
    engfunc(EngFunc_RemoveEntityiEnt)
            return;
        }    
    }
    // End Of FlameThrower Code

    // Main Forward
    public fw_touch(entid)
    {
        if(!
    pev_valid(ent))
            return 
    FMRES_IGNORED
        
        
    static classname[32], classname2[32]
        
        
    pev(entpev_classnameclassnamesizeof(classname))
        
        if(
    pev_valid(id))
            
    pev(idpev_classnameclassname2sizeof(classname2))
        
        if(
    equal(classnameFIRE_CLASSNAME))
        {
            
    set_pev(entpev_solidSOLID_NOT)
            
    set_pev(entpev_movetypeMOVETYPE_NONE)
            
    set_pev(entpev_frame0.0)
            
    set_pev(entpev_nextthinkhalflife_time() + 0.015)
            
            if(!
    is_valid_ent(id))
                return 
    FMRES_IGNORED
            
            
    if(!is_user_alive(id) || !is_user_connected(id))
                return 
    FMRES_IGNORED
                
            
    if(pev(entpev_iuser2) == 1)
            {
                
    hit_screen(id)
                
    set_pev(entpev_iuser20)
                
    ExecuteHam(Ham_TakeDamageid0idFIRE_DAMAGEDMG_BULLET)        
            }
        }
        
        return 
    FMRES_HANDLED
    }

    public 
    fw_think(ent)
    {
        if(!
    is_valid_ent(ent))
        {
            return 
    HAM_IGNORED
        
    }
            
        if(
    pev(entpev_iuser1) == 1// Goliath
            
    return HAM_IGNORED
            
        
    if(g_doing_skill)
            return 
    HAM_IGNORED
            
        
    if(pev(entpev_health) - 1000.0 <= 0.0)
        {
            
    set_pev(entpev_iuser11)
            
            
    stop_all_skill(ent)
            
    goliath_death(ent)
            
            return 
    HAM_IGNORED
        
    }

        static 
    victim
        
    static Float:Origin[3], Float:VicOrigin[3], Float:distance
        
        victim 
    FindClosesEnemy(ent)
        
    pev(entpev_originOrigin)
        
    pev(victimpev_originVicOrigin)
        
        
    distance get_distance_f(OriginVicOrigin)
        
        if(
    is_user_alive(victim))
        {
            if(
    distance <= 500.0)
            {
                if(!
    is_valid_ent(ent))
                    return 
    FMRES_IGNORED    
            
                
    new Float:Ent_Origin[3], Float:Vic_Origin[3]
                
                
    pev(entpev_originEnt_Origin)
                
    pev(victimpev_originVic_Origin)            
            
                
    npc_turntotarget(entEnt_OriginvictimVic_Origin)
                
                static 
    random_number
                random_number 
    random_num(02)
                
                if(!
    g_doing_skill && !g_doing_special)
                {
                    if(
    random_number == 0)
                    {
                        
    starting_flame(ent)
                    } else if(
    random_number == 1) {
                        
    starting_missile(ent)
                    } else if(
    random_number == 2) {
                        
    starting_shoot(ent0)
                    }
                }
            } else {
                if(
    g_doing_special)
                {
                    if(
    pev(entpev_sequence) != 15)
                    {
                        
    entity_set_float(entEV_FL_animtimeget_gametime())
                        
    entity_set_float(entEV_FL_framerate1.0)
                        
    entity_set_int(entEV_INT_sequence15)
                    } 
                } else {
                    if(
    pev(entpev_sequence) != 3)
                    {
                        
    entity_set_float(entEV_FL_animtimeget_gametime())
                        
    entity_set_float(entEV_FL_framerate1.0)
                        
    entity_set_int(entEV_INT_sequence3)
                    }                 
                }
                    
                new 
    Float:Ent_Origin[3], Float:Vic_Origin[3]
                
                
    pev(entpev_originEnt_Origin)
                
    pev(victimpev_originVic_Origin)
                
                
    npc_turntotarget(entEnt_OriginvictimVic_Origin)
                
    hook_ent(entvictim200.0)
                
                static 
    Float:CurTime
                CurTime 
    get_gametime()
                
                if(
    CurTime 1.0 g_last_check)
                {
                    if(!
    g_doing_special && !g_doing_skill)
                    {
                        if(
    g_special_count 10)
                        {
                            
    g_special_count++
                        } else {
                            
    starting_shoot(ent1)
                            
    g_doing_special 1
                            
                            client_print
    (0print_chat"Special Started")
                        }
                    } else {
                        
    g_special_count 0
                    
    }
                    
                    
    g_last_check CurTime
                
    }
                
                
    entity_set_float(entEV_FL_nextthinkget_gametime() + 0.1)
            }
        } else {
            if(
    pev(entpev_sequence) != 2)
            {
                
    set_entity_anim(ent2)
            }    
                
            
    entity_set_float(entEV_FL_nextthinkget_gametime() + 1.0)
        }    
            
        return 
    HAM_HANDLED
    }

    public 
    fw_takedmg(victiminflictorattackerFloat:damagedamagebits)
    {
        if(
    is_user_alive(attacker) && pev_valid(victim))
            
    client_print(attackerprint_center"Remain Health: %i"floatround(pev(victimpev_health) - 1000.0))
    }
    // Main Stock
    stock set_entity_anim(entanim)
    {
        
    entity_set_float(entEV_FL_animtimeget_gametime())
        
    entity_set_float(entEV_FL_framerate1.0)
        
    entity_set_int(entEV_INT_sequenceanim)    
    }

    stock get_position(id,Float:forwFloat:rightFloat:upFloat:vStart[])
    {
        new 
    Float:vOrigin[3], Float:vAngle[3], Float:vForward[3], Float:vRight[3], Float:vUp[3]
        
        
    pev(idpev_originvOrigin)
        
    pev(idpev_view_ofs,vUp//for player
        
    xs_vec_add(vOrigin,vUp,vOrigin)
        
    pev(idpev_v_anglevAngle// if normal entity ,use pev_angles
        
        
    angle_vector(vAngle,ANGLEVECTOR_FORWARD,vForward//or use EngFunc_AngleVectors
        
    angle_vector(vAngle,ANGLEVECTOR_RIGHT,vRight)
        
    angle_vector(vAngle,ANGLEVECTOR_UP,vUp)
        
        
    vStart[0] = vOrigin[0] + vForward[0] * forw vRight[0] * right vUp[0] * up
        vStart
    [1] = vOrigin[1] + vForward[1] * forw vRight[1] * right vUp[1] * up
        vStart
    [2] = vOrigin[2] + vForward[2] * forw vRight[2] * right vUp[2] * up
    }

    stock hook_ent2(entFloat:VicOrigin[3], Float:speed)
    {
        static 
    Float:fl_Velocity[3]
        static 
    Float:EntOrigin[3]

        
    pev(entpev_originEntOrigin)
        
        static 
    Float:distance_f
        distance_f 
    get_distance_f(EntOriginVicOrigin)

        if (
    distance_f 60.0)
        {
            new 
    Float:fl_Time distance_f speed

            fl_Velocity
    [0] = (VicOrigin[0] - EntOrigin[0]) / fl_Time
            fl_Velocity
    [1] = (VicOrigin[1] - EntOrigin[1]) / fl_Time
            fl_Velocity
    [2] = (VicOrigin[2] - EntOrigin[2]) / fl_Time
        
    } else
        {
            
    fl_Velocity[0] = 0.0
            fl_Velocity
    [1] = 0.0
            fl_Velocity
    [2] = 0.0
        
    }

        
    entity_set_vector(entEV_VEC_velocityfl_Velocity)
    }

    stock hit_screen(id)
    {
        
    message_begin(MSG_ONEget_user_msgid("ScreenShake"),{0,0,0}, id)
        
    write_short(1<<14)
        
    write_short(1<<13)
        
    write_short(1<<13)
        
    message_end()    
    }

    stock FindClosesEnemy(entid)
    {
        new 
    Float:Dist
        
    new Float:maxdistance=4000.0
        
    new indexid=0    
        
    for(new i=1;i<=get_maxplayers();i++){
            if(
    is_user_alive(i) && is_valid_ent(i) && can_see_fm(entidi))
            {
                
    Dist entity_range(entidi)
                if(
    Dist <= maxdistance)
                {
                    
    maxdistance=Dist
                    indexid
    =i
                    
                    
    return indexid
                
    }
            }    
        }    
        return 
    0
    }

    stock npc_turntotarget(entFloat:Ent_Origin[3], targetFloat:Vic_Origin[3]) 
    {
        if(
    target
        {
            new 
    Float:newAngle[3]
            
    entity_get_vector(entEV_VEC_anglesnewAngle)
            new 
    Float:Vic_Origin[0] - Ent_Origin[0]
            new 
    Float:Vic_Origin[1] - Ent_Origin[1]

            new 
    Float:radians floatatan(z/xradian)
            
    newAngle[1] = radians * (180 3.14)
            if (
    Vic_Origin[0] < Ent_Origin[0])
                
    newAngle[1] -= 180.0
            
            entity_set_vector
    (entEV_VEC_anglesnewAngle)
        }
    }

    stock bool:can_see_fm(entindex1entindex2)
    {
        if (!
    entindex1 || !entindex2)
            return 
    false

        
    if (pev_valid(entindex1) && pev_valid(entindex1))
        {
            new 
    flags pev(entindex1pev_flags)
            if (
    flags EF_NODRAW || flags FL_NOTARGET)
            {
                return 
    false
            
    }

            new 
    Float:lookerOrig[3]
            new 
    Float:targetBaseOrig[3]
            new 
    Float:targetOrig[3]
            new 
    Float:temp[3]

            
    pev(entindex1pev_originlookerOrig)
            
    pev(entindex1pev_view_ofstemp)
            
    lookerOrig[0] += temp[0]
            
    lookerOrig[1] += temp[1]
            
    lookerOrig[2] += temp[2]

            
    pev(entindex2pev_origintargetBaseOrig)
            
    pev(entindex2pev_view_ofstemp)
            
    targetOrig[0] = targetBaseOrig [0] + temp[0]
            
    targetOrig[1] = targetBaseOrig [1] + temp[1]
            
    targetOrig[2] = targetBaseOrig [2] + temp[2]

            
    engfunc(EngFunc_TraceLinelookerOrigtargetOrig0entindex10//  checks the had of seen player
            
    if (get_tr2(0TraceResult:TR_InOpen) && get_tr2(0TraceResult:TR_InWater))
            {
                return 
    false
            

            else 
            {
                new 
    Float:flFraction
                get_tr2
    (0TraceResult:TR_flFractionflFraction)
                if (
    flFraction == 1.0 || (get_tr2(0TraceResult:TR_pHit) == entindex2))
                {
                    return 
    true
                
    }
                else
                {
                    
    targetOrig[0] = targetBaseOrig [0]
                    
    targetOrig[1] = targetBaseOrig [1]
                    
    targetOrig[2] = targetBaseOrig [2]
                    
    engfunc(EngFunc_TraceLinelookerOrigtargetOrig0entindex10//  checks the body of seen player
                    
    get_tr2(0TraceResult:TR_flFractionflFraction)
                    if (
    flFraction == 1.0 || (get_tr2(0TraceResult:TR_pHit) == entindex2))
                    {
                        return 
    true
                    
    }
                    else
                    {
                        
    targetOrig[0] = targetBaseOrig [0]
                        
    targetOrig[1] = targetBaseOrig [1]
                        
    targetOrig[2] = targetBaseOrig [2] - 17.0
                        engfunc
    (EngFunc_TraceLinelookerOrigtargetOrig0entindex10//  checks the legs of seen player
                        
    get_tr2(0TraceResult:TR_flFractionflFraction)
                        if (
    flFraction == 1.0 || (get_tr2(0TraceResult:TR_pHit) == entindex2))
                        {
                            return 
    true
                        
    }
                    }
                }
            }
        }
        return 
    false
    }

    stock hook_ent(entvictimFloat:speed)
    {
        static 
    Float:fl_Velocity[3]
        static 
    Float:VicOrigin[3], Float:EntOrigin[3]

        
    pev(entpev_originEntOrigin)
        
    pev(victimpev_originVicOrigin)
        
        static 
    Float:distance_f
        distance_f 
    get_distance_f(EntOriginVicOrigin)

        if (
    distance_f 60.0)
        {
            new 
    Float:fl_Time distance_f speed

            fl_Velocity
    [0] = (VicOrigin[0] - EntOrigin[0]) / fl_Time
            fl_Velocity
    [1] = (VicOrigin[1] - EntOrigin[1]) / fl_Time
            fl_Velocity
    [2] = (VicOrigin[2] - EntOrigin[2]) / fl_Time
        
    } else
        {
            
    fl_Velocity[0] = 0.0
            fl_Velocity
    [1] = 0.0
            fl_Velocity
    [2] = 0.0
        
    }

        
    entity_set_vector(entEV_VEC_velocityfl_Velocity)
    }

    stock create_tracer(entFloat:start[3], Float:end[3]) 
    {
        new 
    start_[3], end_[3]
        
        
    FVecIVec(startstart_)
        
    FVecIVec(endend_)
        
        
    message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
    write_byte(TE_TRACER)
        
    write_coord(start_[0])
        
    write_coord(start_[1])
        
    write_coord(start_[2])
        
    write_coord(end_[0])
        
    write_coord(end_[1])
        
    write_coord(end_[2])
        
    message_end()
        
        static 
    trFloat:End_Origin[3], Target
        engfunc
    (EngFunc_TraceLinestartendDONT_IGNORE_MONSTERS, -1tr)    
        
        
    get_tr2(trTR_vecEndPosEnd_Origin)
        
    Target get_tr2(trTR_pHit)
        
        if(
    is_user_alive(Target))
        {
            static 
    Float:Origin[3]
            
    pev(Targetpev_originOrigin)
            
            
    // Show some blood :)
            
    message_begin(MSG_BROADCASTSVC_TEMPENTITY
            
    write_byte(TE_BLOODSPRITE)
            
    write_coord(floatround(Origin[0])) 
            
    write_coord(floatround(Origin[1])) 
            
    write_coord(floatround(Origin[2])) 
            
    write_short(g_bloodspray)
            
    write_short(g_blood)
            
    write_byte(70)
            
    write_byte(random_num(1,2))
            
    message_end()
            
            
    ExecuteHamB(Ham_TakeDamageTarget0TargetSHOOT_DAMAGEDMG_BULLET)
        }    

        
    make_bullet(entEnd_Origin)
    }

    stock make_bullet(entFloat:Origin[3])
    {
        
    // Show sparcles
        
    message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
    write_byte(TE_GUNSHOTDECAL)
        
    write_coord(floatround(Origin[0]))
        
    write_coord(floatround(Origin[1]))
        
    write_coord(floatround(Origin[2]))
        
    write_short(ent)
        
    write_byte(41)
        
    message_end()
    }
     
    Chỉnh sửa cuối: 26/7/12
  5. lucky131

    lucky131 Mr & Ms Pac-Man

    Tham gia ngày:
    22/8/11
    Bài viết:
    141
    Nơi ở:
    Paradise
    IMAGE:

    [SPOIL][​IMG]


    [​IMG]
    [/SPOIL]
    Coder của russia có thể thay đổi và điều chỉnh HUD của HP và có thể thay đổi sprite của bất kỳ client nào bằng cách chỉnh sửa mp.dll của máy chủ(Amazing....:4cool_oh::4cool_oh:). Bên russia bán với giá 4000 rup cả bộ patch HLDS đã chỉnh sửa này.
    [TABLE="class: grid, width: 1020, align: center"]
    [TR]
    [TD="align: center"]Thông tin:
    - Khi sử dụng bộ HLDS này, mọi thiết lập cho client đều tự động, không cần tải thêm gì như metahook
    - Hỗ trợ Linux, window.
    - Hiện tại rao bán với giá 4000 rúp.
    - Protol 48.
    - Vesion
    1.1.2.6/2.0.0.0 (cstrike)[/TD]
    [TD]
    Dự định update lên phiên bản 1.0:

    - Hỗ trợ ra text cũng như sprite ở bất kỳ vị trí nào.
    - Viết plugin hỗ trợ bản patch HLDS
    [/TD]
    [/TR]
    [/TABLE]

    - Chủ của patch HLDS kia còn tự tin rằng đã có mã nguồn của CS - Click link

    - Server thử nghiệm :
    212.154.241.235:25555

    Topic chào bán bên russia
     
    Chỉnh sửa cuối: 6/8/12
  6. hiroshi_dinh

    hiroshi_dinh The Warrior of Light

    Tham gia ngày:
    6/4/07
    Bài viết:
    2,043
    Tới 2tr6 à :4cool_oh: có dc trả giá ko bạn :-"
     
  7. lucky131

    lucky131 Mr & Ms Pac-Man

    Tham gia ngày:
    22/8/11
    Bài viết:
    141
    Nơi ở:
    Paradise
    Thấy bên ru giao bán kéo về đây mà, chứ có PR bán hộ đâu.:))

    P/s: Dias làm mấy xịch cái plugin xịn sang trao đôi với nó đi, có cái patch HLDS này làm sv thì bá đạo rồi.=))
     
  8. ngochai9a7

    ngochai9a7 Dragon Quest

    Tham gia ngày:
    5/1/12
    Bài viết:
    1,450
    Chuẩn, nhưng không biết nó có chịu đổi không đây :|
     
  9. lucky131

    lucky131 Mr & Ms Pac-Man

    Tham gia ngày:
    22/8/11
    Bài viết:
    141
    Nơi ở:
    Paradise
    Với danh vọng và địa vị của anh ấy bên zm.ru thì dự 60% là đc , 30% còn lại phụ thuộc vào plugins, 9% còn lại phụ thuộc vào trạng thái cảm xúc của seller, 1% còn lại là may mắn.=)) =))
     
  10. kungfulon

    kungfulon Fire in the hole! Lão Làng GVN Sorcerer

    Tham gia ngày:
    1/5/11
    Bài viết:
    2,535
    LOL, modify the client, just kind of hack, f*ck off:-j
     
  11. dias

    dias Mega Man

    Tham gia ngày:
    17/1/10
    Bài viết:
    3,226
    Nơi ở:
    SEOUL
    Thực tế thì mấy hlds làm tếh này mấy anh chơi Steam ko vào dc =))
     
  12. kungfulon

    kungfulon Fire in the hole! Lão Làng GVN Sorcerer

    Tham gia ngày:
    1/5/11
    Bài viết:
    2,535
    Lớ ngớ vào server này xong qua mấy server VAC chơi là ban cmnl:-j
     
  13. lucky131

    lucky131 Mr & Ms Pac-Man

    Tham gia ngày:
    22/8/11
    Bài viết:
    141
    Nơi ở:
    Paradise
    Ừ, chỉ hỗ trợ non steam thôi, dự là tương lai sẽ hỗ trợ, tùy thuộc vào có bán được nhiều hay không đã=))
     
  14. dias

    dias Mega Man

    Tham gia ngày:
    17/1/10
    Bài viết:
    3,226
    Nơi ở:
    SEOUL
    Ta làm dc rồi, ai care nào =))
    Sử dụng precache_generic để precache cái DLL đó ko phải dll nhá

    đó là phương pháp download dll còn bây giờ là inject vào game...
    giờ thì nó sài cái gì đó để sửa file liblist.gam của player, thay gamedll "mp/dlls.dll" thành file của nó...

    hoặc là đặt tên file là openlg32.dll rồi khi player load game với mode OpenLG file dll sẽ load :-"
     
    Chỉnh sửa cuối: 6/8/12
  15. Ztuananh

    Ztuananh Youtube Master Race

    Tham gia ngày:
    4/12/11
    Bài viết:
    17
    may anh oi sao em complete cai file nst_wpn..sma khong duoc máy anh, em chĩ sữa lại là nst thanh ck thôi mà khong được giúp em voi huhuhuhuhu


    [​IMG]


    lnik code : http://www.mediafire.com/?9v70zksne44qpvs

    Mã:
    #include <amxmodx>
    #include <amxmisc>
    #include <fakemeta>
    #include <cstrike>
    #include <engine>
    #include <hamsandwich>
    #include <xs>
    
    #include <ck_zombie>
    #include <ck_scenario>
    #include <ck_wpn>
    
    
    #define PLUGIN "CK Wpn Mod"
    new const TEST_WPN = 0
    
    // main value
    new auto_buy[33], g_weappickup[33], g_freezetime, g_mywpn_enable, g_canbuy[33], g_inbuyzone[33], g_command[33],
    g_fastrun[33], Float:g_idle[33], g_current_wpn[33], Float:cl_pushangle[33][3], g_modruning
    new cvar_bot_use_weapons, cvar_weapons_stay, cvar_buyzone, cvar_free, cvar_sound_attack, cvar_remove_shield,
    cvar_fastrun_speed, cvar_timebuy, cvar_sight_recoil, cvar_sight_speed_player, cvar_sight_speed_weapon, cvar_maxmoney, cvar_maxspeed
    
    // Task offsets
    enum(+= 100)
    {
    	TASK_WELLCOME = 2000,
    	TASK_CANBUY
    }
    #define ID_CANBUY (taskid - TASK_CANBUY)
    
    // id msg
    new g_msgTextMsg, g_msgWeapPickup
    new g_hamczbots, cvar_botquota, cvar_friendlyfire
    
    // cs offsets
    const m_pPlayer			= 41
    const m_flNextPrimaryAttack	= 46
    const m_flNextSecondaryAttack	= 47
    const m_flTimeWeaponIdle	= 48
    const m_flNextAttack		= 83
    
    // cs weapons default value
    new const WEAPONSNAME[][] = { "", "weapon_p228", "", "weapon_scout", "weapon_hegrenade", "weapon_xm1014", "weapon_c4", "weapon_mac10",
    			"weapon_aug", "weapon_smokegrenade", "weapon_elite", "weapon_fiveseven", "weapon_ump45", "weapon_sg550",
    			"weapon_galil", "weapon_famas", "weapon_usp", "weapon_glock18", "weapon_awp", "weapon_mp5navy", "weapon_m249",
    			"weapon_m3", "weapon_m4a1", "weapon_tmp", "weapon_g3sg1", "weapon_flashbang", "weapon_deagle", "weapon_sg552",
    			"weapon_ak47", "weapon_knife", "weapon_p90"
    }
    
    
    
    //##############################################################
    // REGISTER PLUGIN
    //##############################################################
    public plugin_natives()
    {	
    	new config_dir[64], url_csdm[64], url_zb3[64], url_zbu[64], url_zbs[64], url_hs[64], url_gh[64]
    	get_configsdir(config_dir, charsmax(config_dir))
    	format(url_csdm, charsmax(url_csdm), "%s/plugins-csdm.ini", config_dir)
    	format(url_zb3, charsmax(url_zb3), "%s/plugins-nstzb3.ini", config_dir)
    	format(url_zbu, charsmax(url_zbu), "%s/plugins-nstzbu.ini", config_dir)
    	format(url_zbs, charsmax(url_zbs), "%s/plugins-nstzbs.ini", config_dir)
    	format(url_hs, charsmax(url_hs), "%s/plugins-nsthms.ini", config_dir)
    	format(url_gh, charsmax(url_gh), "%s/plugins-ghost.ini", config_dir)
    	
    	// get modruning
    	if (file_exists(url_csdm))
    	{
    		new csdm_single[64]
    		format(csdm_single, charsmax(csdm_single), "%s/csdm-single.cfg", config_dir)
    		if (!file_exists(csdm_single)) g_modruning = CK_MOD_CSDM_SINGLE
    		else g_modruning = CK_MOD_CSDM_TEAM
    	}
    	else if (file_exists(url_zb3)) g_modruning = CK_MOD_ZB3
    	else if (file_exists(url_zbu)) g_modruning = CK_MOD_ZBU
    	else if (file_exists(url_zbs)) g_modruning = CK_MOD_ZBS
    	else if (file_exists(url_hs)) g_modruning = CK_MOD_HMS
    	else if (file_exists(url_gh)) g_modruning = CK_MOD_GHOST
    	else g_modruning = CK_MOD_DEFAULT
    
    	// reg native
    	if (g_modruning!=CK_MOD_ZB3 && g_modruning!=CK_MOD_ZBU && g_modruning!=CK_MOD_ZBS)
    	{
    		register_native("ck_zb_get_user_sex", "natives_novalue", 1)
    		register_native("ck_zb_get_user_zombie", "natives_novalue", 1)
    		register_native("ck_zb_get_user_hero", "natives_novalue", 1)
    		register_native("ck_zb_get_user_supplybox", "natives_novalue", 1)
    		register_native("ck_zb_remove_user_supplybox", "natives_novalue", 1)
    		register_native("ck_zb_remove_weapons_newround", "natives_novalue", 1)
    		register_native("ck_zb_get_weapons_ammo", "natives_novalue", 1)
    		register_native("ck_zb_get_user_level", "natives_novalue", 1)
    		register_native("ck_zb_get_user_damage_attack", "natives_novalue", 1)
    		register_native("ck_zb_set_user_damage_attack", "natives_novalue", 1)
    		register_native("ck_zb_get_take_damage", "natives_novalue", 1)
    		register_native("ck_zb_get_damage_nade", "natives_novalue", 1)
    		CreateMultiForward("ck_zb_user_infected", ET_IGNORE, FP_CELL, FP_CELL)
    
    	}
    	if (g_modruning!=CK_MOD_HMS)
    	{
    		register_native("ck_scn_get_damage_nade", "natives_novalue", 1)
    		register_native("ck_scn_get_human_takedmg", "natives_novalue", 1)
    		register_native("ck_scn_get_bot_health", "natives_novalue", 1)
    		register_native("ck_scn_is_bot", "natives_novalue", 1)
    		register_native("ck_scn_is_boss", "natives_novalue", 1)
    		register_native("ck_scn_human_kill_bot", "natives_novalue", 1)
    		register_native("ck_scn_get_weapons_ammo", "natives_novalue", 1)
    	}
    	
    	// reg native
    	register_native("ck_get_mod_runing", "natives_get_mod_runing", 1)
    	register_native("ck_get_weapon_type", "natives_get_weapon_type", 1)
    	register_native("ck_get_user_buyzone", "natives_get_user_buyzone", 1)
    	register_native("ck_bot_use_weapons", "natives_bot_use_weapons", 1)
    	register_native("ck_weapons_stay", "natives_weapons_stay", 1)
    	register_native("ck_color_saytext", "natives_color_saytext", 1)
    	register_native("ck_set_user_money", "natives_set_user_money", 1)
    	register_native("ck_is_user_admin", "natives_is_user_admin", 1)
    	
    	register_native("ck_wpn_free", "natives_wpn_free", 1)
    	register_native("ck_wpn_get_sound_attack", "natives_get_sound_attack", 1)
    	register_native("ck_wpn_show_weaponpickup", "natives_show_weaponpickup", 1)
    	register_native("ck_wpn_take_damage", "natives_take_damage", 1)
    	register_native("ck_wpn_get_canbuy_team_mod", "natives_get_canbuy_team_mod", 1)
    	register_native("ck_wpn_get_freezetime", "natives_get_freezetime", 1)
    	register_native("ck_wpn_get_mod_has_supplybox", "natives_get_mod_has_supplybox", 1)
    	register_native("ck_wpn_mywpn", "natives_mywpn", 1)
    	register_native("ck_wpn_set_cweapon_maxspeed", "natives_set_cweapon_maxspeed", 1)
    	register_native("ck_wpn_set_fullammo", "natives_set_fullammo", 1)
    	register_native("ck_wpn_get_user_sight", "natives_get_user_sight", 1)
    	register_native("ck_wpn_get_user_fastrun", "natives_get_user_fastrun", 1)
    	register_native("ck_wpn_get_fastrunanim_weapon", "natives_get_fastrunanim_weapon", 1)
    	register_native("ck_wpn_get_int", "natives_get_int", 1)
    	register_native("ck_wpn_get_float", "natives_get_float", 1)
    	register_native("ck_wpn_give_weapon", "natives_give_weapon", 1)
    }
    public plugin_precache()
    {
    	mywpn_load_config()
    }
    public plugin_init()
    {
    	register_plugin(PLUGIN, CK_WPN_VERSION, CK_WPN_AUTHOR)
    	
    	// Language files
    	register_dictionary("ck_wpn.txt")
    	
    	// idmsg
    	g_msgTextMsg = get_user_msgid("TextMsg")
    	g_msgWeapPickup = get_user_msgid("WeapPickup")
    	
    	// register public
    	register_event("StatusIcon", "event_check_in_buyzone", "be", "2=buyzone")
    	register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
    	register_event("CurWeapon","event_CurWeapon","be","1=1")
    	register_logevent("logevent_round_start",2, "1=Round_Start")
    	register_logevent("logevent_round_end", 2, "1=Round_End")
    	RegisterHam(Ham_Touch, "weapon_shield", "fw_TouchWeapon")
    	RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
    	RegisterHam(Ham_TraceAttack, "player", "fw_TraceAttack")
    	RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1)
    	register_forward(FM_SetModel, "fw_SetModel")
    	register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
    	register_message(g_msgWeapPickup, "message_WeapPickup")
    	register_message(g_msgTextMsg, "message_TextMsg")
    	register_message(get_user_msgid("Money"), "message_Money")
    	
    	// HAM Forwards
    	for(new i=1; i<=CSW_P90; i++)
    	{
    		if (strlen(WEAPONSNAME[i]))
    		{
    			RegisterHam(Ham_Weapon_PrimaryAttack, WEAPONSNAME[i], "fw_Weapon_PrimaryAttack")
    			RegisterHam(Ham_Weapon_PrimaryAttack, WEAPONSNAME[i], "fw_Weapon_PrimaryAttack_Post", 1)
    			RegisterHam(Ham_Weapon_WeaponIdle, WEAPONSNAME[i], "fw_Weapon_WeaponIdle")
    			RegisterHam(Ham_Weapon_Reload, WEAPONSNAME[i], "fw_Weapon_Reload")
    			RegisterHam(Ham_Weapon_Reload, WEAPONSNAME[i], "fw_Weapon_Reload_Post", 1)
    		}
    	}
    	
    	// Command
    	register_clcmd("shield", "block_clcmd")
    	register_clcmd("nst_wpn", "cmd_menu_main")
    	register_clcmd("+fastrun", "cmd_fastrun")
    	register_clcmd("-fastrun", "cmd_fastrun_end")
    	register_clcmd("ck_wpn_rebuy", "cmd_wpn_rebuy")
    
    	// Cvar
    	cvar_weapons_stay = register_cvar("ck_weapons_stay","5")
    	cvar_bot_use_weapons = register_cvar("ck_bot_use_weapons","5")
    	cvar_buyzone = register_cvar("ck_set_buyzone","0")
    	cvar_free = register_cvar("ck_wpn_free","0")
    	cvar_sound_attack = register_cvar("ck_wpn_sound","1")
    	cvar_remove_shield = register_cvar("ck_wpn_remove_shield", "1")
    	cvar_timebuy = register_cvar("ck_wpn_buy_time", "30")
    	cvar_fastrun_speed = register_cvar("ck_wpn_fastrun_speed", "1.2")
    	cvar_sight_recoil = register_cvar("ck_wpn_sight_recoil", "0.6")
    	cvar_sight_speed_player = register_cvar("ck_wpn_sight_speed_player", "0.5")
    	cvar_sight_speed_weapon = register_cvar("ck_wpn_sight_speed_weapon", "1.0")
    	cvar_maxmoney = register_cvar("ck_maxmoney", "16000")
    	cvar_maxspeed = register_cvar("ck_wpn_maxspeed","300")
    	
    	cvar_botquota = get_cvar_pointer("bot_quota")
    	cvar_friendlyfire = get_cvar_pointer("mp_friendlyfire")
    	
    	// other
    	//register_clcmd("ww", "ww")
    }
    public plugin_cfg()
    {
    	// Get configs dir
    	new cfgdir[32]
    	get_configsdir(cfgdir, charsmax(cfgdir))
    	
    	// Execute config file (ck.cfg)
    	server_cmd("exec %s/%s", cfgdir, "ck.cfg")
    	
    	// Cache CVARs after configs are loaded / call roundstart manually
    	set_task(0.5, "event_round_start")
    	set_task(0.5, "logevent_round_start")
    }
    public ww(id)
    {
    	client_print(id, print_chat, "[%i]", ck_scn_get_weapons_ammo(get_user_weapon(id)))
    	
    	/*
    	new str[32]
    	new num = ck_wpn_get_data(id, get_pcvar_num(cvar_sight_recoil))
    	num_to_str(num, str, 31)
    	client_print(id, print_chat, "[%s][%i]", str, num)*/
    }
    
    
    //##############################################################
    // MAIN PUBLIC
    //##############################################################
    public client_putinserver(id)
    {
    	g_command[id] = 1
    	
    	if (is_user_bot(id) && !g_hamczbots && cvar_botquota)
    	{
    		set_task(0.1, "register_ham_czbots", id)
    	}
    }
    public fw_ClientDisconnect(id)
    {
    	g_command[id] = 0
    }
    public register_ham_czbots(id)
    {
    	// Make sure it's a CZ bot and it's still connected
    	if (g_hamczbots || !is_user_connected(id) || !get_pcvar_num(cvar_botquota))
    		return;
    		
    	RegisterHamFromEntity(Ham_TakeDamage, id, "fw_TakeDamage")
    	RegisterHamFromEntity(Ham_TraceAttack, id, "fw_TraceAttack")
    	RegisterHamFromEntity(Ham_Spawn, id, "fw_PlayerSpawn_Post", 1)
    	
    	// Ham forwards for CZ bots succesfully registered
    	g_hamczbots = true
    	
    	// If the bot has already spawned, call the forward manually for him
    	if (is_user_alive(id)) fw_PlayerSpawn_Post(id)
    }
    public event_round_start()
    {
    	g_freezetime = 1
    	
    	for (new i = 1; i < 33; i++)
    	{
    		if (auto_buy[i] == 1) client_cmd(i, "ck_wpn_1_rebuy;ck_wpn_2_rebuy;ck_wpn_3_rebuy;ck_wpn_4_rebuy")
    	}
    	
    	// wellcome
    	remove_task(TASK_WELLCOME)
    	set_task(5.0, "task_wellcome", TASK_WELLCOME)
    }
    public logevent_round_start()
    {
    	g_freezetime = 0
    }
    public logevent_round_end()
    {
    }
    public task_wellcome()
    {
    	new message[64]
    	format(message, charsmax(message), "^x04[ Wpn ]^x01 %L", LANG_PLAYER, "NOTICE_HELP_BUY")
    	color_saytext(0, message)
    }
    public cmd_wpn_rebuy(id)
    {
    	client_cmd(id, "ck_rebuy_wpn1;ck_rebuy_wpn2;ck_rebuy_wpn3;ck_rebuy_wpn4")
    }
    public cmd_fastrun(id)
    {
    	if (g_fastrun[id] || !g_idle[id] || !natives_get_int(id, CK_WPN_DATA_FASTRUN)) return PLUGIN_HANDLED
    	
    	g_fastrun[id] = 1
    	ck_wpn_send_weapon_anim(id, ck_wpn_get_fastrunanim_weapon(id, CK_ANI_FASTRUN_BEGIN))
    	set_weapons_timeidle(id, 1.0)
    	
    	return PLUGIN_HANDLED
    }
    public cmd_fastrun_end(id)
    {
    	if (g_fastrun[id])
    	{
    		g_fastrun[id] = 0
    		
    		if (!g_idle[id] || !natives_get_int(id, CK_WPN_DATA_FASTRUN)) return PLUGIN_HANDLED
    	
    		ck_wpn_send_weapon_anim(id, ck_wpn_get_fastrunanim_weapon(id, CK_ANI_FASTRUN_END))
    		set_weapons_timeidle(id, 1.0)
    	}
    	
    	return PLUGIN_HANDLED
    }
    public block_clcmd(id)
    {
    	if (get_pcvar_num(cvar_remove_shield)) return PLUGIN_HANDLED
    	return PLUGIN_CONTINUE
    }
    public message_TextMsg()
    {
    	static textmsg[22]
    	get_msg_arg_string(2, textmsg, charsmax(textmsg))
    	
    	// Game restarting, reset scores and call round end to balance the teams
    	if (equal(textmsg, "#Game_will_restart_in"))
    	{
    		logevent_round_end()
    	}
    
    	return PLUGIN_CONTINUE;
    }
    public message_Money(msg_id, msg_dest, msg_entity)
    {
    	new money, maxmoney
    	money = get_msg_arg_int(1)
    	maxmoney = get_pcvar_num(cvar_maxmoney)
    	
    	if (money>maxmoney)
    	{
    		fm_cs_set_user_money(msg_entity, maxmoney)
    		return PLUGIN_HANDLED;
    	}
    	
    	return PLUGIN_CONTINUE;
    }
    public message_WeapPickup(msg_id, msg_dest, msg_entity)
    {
    	if (g_weappickup[msg_entity])
    	{
    		g_weappickup[msg_entity] = 0
    		return PLUGIN_HANDLED;
    	}
    	
    	return PLUGIN_CONTINUE;
    }
    public event_check_in_buyzone(id)
    {
    	g_inbuyzone[id] = read_data(1)
    	//client_print(id, print_chat, "[%i]", g_inbuyzone[id])
    }
    public fw_Weapon_PrimaryAttack(ent)
    {
    	new id = pev(ent,pev_owner)
    	g_idle[id] = 0.0
    	
    	// set punchangle of player
    	pev(id, pev_punchangle, cl_pushangle[id])
    }
    public fw_Weapon_PrimaryAttack_Post(ent)
    {
    	new id = pev(ent,pev_owner)
    
    	// set speed of weapon
    	new Float:speed = natives_get_float(id, CK_WPN_DATA_SPEED)
    	if (TEST_WPN) speed = get_pcvar_float(cvar_free)
    	if (natives_get_user_sight(id)) speed *= get_pcvar_float(cvar_sight_speed_weapon)
    	new Float:delay = get_pdata_float(ent, m_flNextPrimaryAttack, 4)*speed
    	if (delay>0.0) set_pdata_float(ent, m_flNextPrimaryAttack, delay, 4)
    	
    	// set recoil of weapon
    	new Float:recoil = natives_get_float(id, CK_WPN_DATA_RECOIL)
    	if (recoil>0.0)
    	{
    		// recoil when sight
    		if (natives_get_user_sight(id)) recoil *= get_pcvar_float(cvar_sight_recoil)
    		new Float:push[3]
    		pev(id, pev_punchangle, push)
    		xs_vec_sub(push, cl_pushangle[id], push)
    		xs_vec_mul_scalar(push, recoil, push)
    		xs_vec_add(push, cl_pushangle[id], push)
    		set_pev(id, pev_punchangle, push)
    	}
    }
    public fw_Weapon_WeaponIdle(iEnt)
    {
    	static id ; id = get_pdata_cbase(iEnt, m_pPlayer, 4)
    	if (!g_idle[id]) g_idle[id] = get_gametime()
    }
    public fw_Weapon_Reload(ent)
    {
    	new id = pev(ent,pev_owner)
    	g_idle[id] = 0.0
    }
    public fw_Weapon_Reload_Post(ent)
    {
    	new id = pev(ent,pev_owner)
    	
    	// set time reload
    	new Float:time_reload = natives_get_float(id, CK_WPN_DATA_RELOAD)
    	if (TEST_WPN) time_reload = get_pcvar_float(cvar_free)
    	if (time_reload) set_player_nextattack(id, time_reload)
    }
    public fw_PlayerSpawn_Post(id)
    {
    	// Not alive or didn't join a team yet
    	if (!is_user_alive(id))
    		return;
    		
    	// remove time buy
    	g_canbuy[id] = 1
    	if (task_exists(id+TASK_CANBUY)) remove_task(id+TASK_CANBUY)
    	set_task(get_pcvar_float(cvar_timebuy), "task_remove_canbuy", id+TASK_CANBUY)
    	
    	// Get configs dir
    	if (g_command[id])
    	{
    		new cfgdir[32]
    		get_configsdir(cfgdir, charsmax(cfgdir))
    		server_cmd("exec %s/%s", cfgdir, "ck_cmd.cfg")
    		g_command[id] = 0
    	}
    	
    	// remove value
    	g_fastrun[id] = 0
    }
    public task_remove_canbuy(taskid)
    {
    	new id = ID_CANBUY
    	g_canbuy[id] = 0
    }
    public fw_TraceAttack(victim, attacker, Float:damage, Float:direction[3], tracehandle, damage_type)
    {
    	// Non-player damage or self damage
    	if (victim == attacker || !is_user_connected(attacker) || !is_user_connected(victim))
    		return HAM_IGNORED;
    	
    	// New round starting or round ended
    	if (g_freezetime) return HAM_SUPERCEDE;
    	new mod_runing = natives_get_mod_runing()
    	if ((mod_runing == CK_MOD_ZB3 || mod_runing == CK_MOD_ZBU || mod_runing == CK_MOD_ZBS) && !ck_zb_get_take_damage())
    		return HAM_SUPERCEDE;
    		
    	// Prevent friendly fire
    	if (get_user_team(attacker)==get_user_team(victim) && !get_pcvar_num(cvar_friendlyfire))
    		return HAM_SUPERCEDE;
    	
    	// Victim isn't a zombie or not bullet damage, nothing else to do here
    	if (!(damage_type & DMG_BULLET))
    		return HAM_IGNORED;
    
    	// Get distance between players
    	static origin1[3], origin2[3]
    	get_user_origin(victim, origin1)
    	get_user_origin(attacker, origin2)
    	
    	// Get victim's velocity
    	static Float:velocity[3]
    	pev(victim, pev_velocity, velocity)
    
    	xs_vec_mul_scalar(direction, damage, direction)
    	
    	// Use weapon power on knockback calculation
    	new knockback = natives_get_int(attacker, CK_WPN_DATA_KNOCKBACK)
    	if (TEST_WPN) knockback = get_pcvar_num(cvar_free)
    	if (knockback) xs_vec_mul_scalar(direction, float(knockback), direction)
    	else return HAM_IGNORED;
    
    	// Add up the new vector
    	xs_vec_add(velocity, direction, direction)
    
    	// Set the knockback'd victim's velocity
    	set_pev(victim, pev_velocity, direction)
    	
    	//client_print(attacker, print_chat, "[%i]", knockback)
    	return HAM_IGNORED;
    }
    public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
    {
    	// Non-player damage or self damage
    	if (victim == attacker)
    		return HAM_IGNORED;
    
    	// Fix bug player not connect
    	if (!pev_valid(victim) || !is_user_connected(attacker))
    		return HAM_IGNORED;
    	
    	// Take damage
    	new Float:xdamage = natives_get_float(attacker, CK_WPN_DATA_DAMAGE)
    	if (TEST_WPN) xdamage = get_pcvar_float(cvar_free)
    	if (xdamage>0.0)
    	{
    		damage *= xdamage
    		SetHamParamFloat(4, damage)
    	}
    	
    	return HAM_IGNORED
    }
    public event_CurWeapon(id)
    {
    	if (!is_user_alive(id)) return;
    	
    	new wpnid, wpnclip, wpnammo
    	wpnid = get_user_weapon(id, wpnclip , wpnammo)
    
    	// drop shield
    	if (get_pcvar_num(cvar_remove_shield) && !pev(id, pev_gamestate))
    	{
    		if (strlen(WEAPONSNAME[wpnid]))
    		{
    			engclient_cmd(id, "drop", WEAPONSNAME[wpnid])
    		}
    	}
    	
    	// update current wpn
    	if (g_current_wpn[id] != wpnid)
    	{
    		g_idle[id] = 0.0
    		g_current_wpn[id] = wpnid
    		g_fastrun[id] = 0
    		
    		// set deploy time
    		new Float:tdeploy = natives_get_float(id, CK_WPN_DATA_DEPLOY)
    		if (TEST_WPN) tdeploy = get_pcvar_float(cvar_free)
    		if (wpnclip && tdeploy) set_player_nextattack(id, tdeploy)
    	}
    }
    public fw_TouchWeapon(weapon, id)
    {
    	// Not a player
    	if (!is_user_connected(id))
    		return HAM_IGNORED;
    	
    	// Dont pickup weapons
    	if (get_pcvar_num(cvar_remove_shield))
    		return HAM_SUPERCEDE;
    	
    	return HAM_IGNORED;
    }
    public fw_PlayerPreThink(id)
    {
    	if (!is_user_alive(id) || ck_wpn_get_freezetime() || ck_zb_get_user_zombie(id)) return;
    	
    	new maxspeed = natives_get_int(id, CK_WPN_DATA_GRAVITY)
    	if (TEST_WPN) maxspeed = get_pcvar_num(cvar_free)
    	if (!maxspeed) maxspeed = get_weapon_speed(get_user_weapon(id))
    	
    	new Float:maxspeed_set
    	maxspeed_set = float(maxspeed)
    	
    	if (g_fastrun[id])
    	{
    		maxspeed_set *= get_pcvar_float(cvar_fastrun_speed)
    		set_player_nextattack(id, 0.5)
    	}
    	else if (natives_get_user_sight(id))
    	{
    		maxspeed_set *= get_pcvar_float(cvar_sight_speed_player)
    	}
    	
    	maxspeed_set = float(min(floatround(maxspeed_set), get_pcvar_num(cvar_maxspeed)))
    	set_pev(id, pev_maxspeed, maxspeed_set)
    }
    public fw_SetModel(entity, const model[])
    {
    	// check mod
    	new mod_runing = natives_get_mod_runing()
    	if (mod_runing != CK_MOD_CSDM_SINGLE && mod_runing != CK_MOD_CSDM_TEAM) return FMRES_IGNORED
    
    	// check valid ent
    	if (!is_valid_ent(entity)) return FMRES_IGNORED
    
    	// We don't care
    	if (strlen(model) < 8) return FMRES_IGNORED
    	
    	// get ent classname
    	new ent_classname[32]
    	pev(entity, pev_classname, ent_classname, charsmax(ent_classname))
    
    	// set weapon stay
    	if (equal(ent_classname, "weaponbox"))
    	{
    		set_pev(entity, pev_nextthink, get_gametime() + get_pcvar_float(cvar_weapons_stay))
    	}
    	
    	return FMRES_IGNORED
    }
    
    // MENU MAIN
    public cmd_menu_main(id)
    {
    	if (!is_user_alive(id)) return PLUGIN_HANDLED
    
    	new type, type_str[32]
    	read_argv(1, type_str, charsmax(type_str))
    	type = str_to_num(type_str)
    	
    	menu_wpn(id, type)
    	
    	return PLUGIN_HANDLED
    }
    menu_wpn(id, type)
    {
    	// member only use main menu wpn
    	if (g_mywpn_enable && !natives_is_user_admin(id) && type!=CK_MENUWPN_MAIN) return;
    	
    	new title[64], item_name[32][32], item_cmd[32][32]
    	
    	if (type==CK_MENUWPN_MAIN) format(title, charsmax(title), "[ Wpn ] %L:", LANG_PLAYER, "MENU_TITLE")
    	else if (type==CK_MENUWPN_SHOP) format(title, charsmax(title), "[ Wpn ] %L:", LANG_PLAYER, "MENU_TITLE_SHOP")
    	else if (type==CK_MENUWPN_MYWPN) format(title, charsmax(title), "[ Wpn ] %L:", LANG_PLAYER, "MENU_TITLE_MYWPN_EDIT")
    	
    	format(item_name[1], 31, "%L", LANG_PLAYER, "MENU_ITEM_RIFLES")
    	format(item_name[2], 31, "%L", LANG_PLAYER, "MENU_ITEM_PISTOLS")
    	format(item_name[3], 31, "%L", LANG_PLAYER, "MENU_ITEM_KNIFE")
    	format(item_name[4], 31, "%L", LANG_PLAYER, "MENU_ITEM_HE")
    	format(item_name[5], 31, "%L", LANG_PLAYER, "MENU_ITEM_SHOP")
    	format(item_name[6], 31, "%L", LANG_PLAYER, "MENU_ITEM_MYWPN_EDIT")
    	format(item_name[7], 31, "%L", LANG_PLAYER, "MENU_ITEM_REBUY")
    	format(item_name[8], 31, "%L", LANG_PLAYER, "MENU_ITEM_AUTOBUY")
    
    	new mHandleID = menu_create(title, "menu_wpn_handler")
    	
    	// item menu wpn
    	for (new i=1; i<=4; i++)
    	{
    		format(item_cmd[i], 31, "ck_menu_wpn%i %i", i, type)
    	}
    	format(item_cmd[5], 31, "ck_wpn %i", CK_MENUWPN_SHOP)
    	format(item_cmd[6], 31, "ck_wpn %i", CK_MENUWPN_MYWPN)
    	format(item_cmd[7], 31, "rebuy")
    	format(item_cmd[8], 31, "auto_rebuy")
    	
    	
    	// menu main wpn
    	menu_additem(mHandleID, item_name[1], item_cmd[1], 0)
    	menu_additem(mHandleID, item_name[2], item_cmd[2], 0)
    	menu_additem(mHandleID, item_name[3], item_cmd[3], 0)
    	menu_additem(mHandleID, item_name[4], item_cmd[4], 0)
    
    	// item of mywpn
    	if (g_mywpn_enable)
    	{
    		if (type==CK_MENUWPN_MAIN)
    		{
    			if (natives_is_user_admin(id))
    			{
    				menu_additem(mHandleID, item_name[5], item_cmd[5], 0)
    				menu_additem(mHandleID, item_name[6], item_cmd[6], 0)
    			}
    			menu_additem(mHandleID, item_name[7], item_cmd[7], 0)
    			menu_additem(mHandleID, item_name[8], item_cmd[8], 0)
    		}
    	}
    	else
    	{
    		menu_additem(mHandleID, item_name[7], item_cmd[7], 0)
    		menu_additem(mHandleID, item_name[8], item_cmd[8], 0)
    	}
    	
    	
    	menu_display(id, mHandleID, 0)
    }
    public menu_wpn_handler(id, menu, item)
    {
    	if (item == MENU_EXIT)
    	{
    		menu_destroy(menu)
    		return PLUGIN_HANDLED
    	}
    	
    	new cmdbuy[32], name[32], access
    	menu_item_getinfo(menu, item, access, cmdbuy, 31, name, 31, access)
    
    	if (equal(cmdbuy, "rebuy")) client_cmd(id, "ck_wpn_rebuy")
    	else if (equal(cmdbuy, "auto_rebuy"))
    	{
    		auto_buy[id] = 1
    		
    		new rebuy_cmd[32]
    		for (new i=1; i<=4; i++)
    		{
    			format(rebuy_cmd, charsmax(rebuy_cmd), "ck_rebuy_wpn%i", i)
    			client_cmd(id, rebuy_cmd)
    		}
    	}
    	else client_cmd(id, cmdbuy)
    	
    	
    	menu_destroy(menu)
    	return PLUGIN_HANDLED
    }
    
    
    //##############################################################
    // FUNCTION - STOCK
    //##############################################################
    get_weapon_speed(idwpn)
    {
    	new speed
    	switch (idwpn)
    	{
    		case CSW_P228: speed = 250
    		case CSW_SCOUT: speed = 260
    		case CSW_HEGRENADE: speed = 250
    		case CSW_XM1014: speed = 240
    		case CSW_C4: speed = 250
    		case CSW_MAC10: speed = 250
    		case CSW_AUG: speed = 240
    		case CSW_SMOKEGRENADE: speed = 250
    		case CSW_ELITE: speed = 250
    		case CSW_FIVESEVEN: speed = 250
    		case CSW_UMP45: speed = 250
    		case CSW_SG550: speed = 210
    		case CSW_GALIL: speed = 240
    		case CSW_FAMAS: speed = 240
    		case CSW_USP: speed = 250
    		case CSW_GLOCK18: speed = 250
    		case CSW_AWP: speed = 210
    		case CSW_MP5NAVY: speed = 250
    		case CSW_M249: speed = 220
    		case CSW_M3: speed = 230
    		case CSW_M4A1: speed = 230
    		case CSW_TMP: speed = 250
    		case CSW_G3SG1: speed = 210
    		case CSW_FLASHBANG: speed = 250
    		case CSW_DEAGLE: speed = 250
    		case CSW_SG552: speed = 235
    		case CSW_AK47: speed = 221
    		case CSW_KNIFE: speed = 250
    		case CSW_P90: speed = 245
    		default: speed = 250
    	}
    	
    	return speed;
    }
    color_saytext(player, const message[], any:...)
    {
    	new text[301]
    	format(text, 300, "%s", message)
    
    	new dest
    	if (player) dest = MSG_ONE
    	else dest = MSG_ALL
    	
    	message_begin(dest, get_user_msgid("SayText"), {0,0,0}, player)
    	write_byte(1)
    	write_string(check_text(text))
    	return message_end()
    }
    check_text(text1[])
    {
    	new text[301]
    	format(text, 300, "%s", text1)
    	replace_all(text, 300, ">x04", "^x04")
    	replace_all(text, 300, ">x03", "^x03")
    	replace_all(text, 300, ">x01", "^x01")
    	return text
    }
    get_weapon_ent(id, weaponid)
    {
    	static wname[32], weapon_ent
    	if (weaponid) get_weaponname(weaponid, wname, charsmax(wname))
    	weapon_ent = fm_find_ent_by_owner(-1, wname, id)
    	return weapon_ent
    }
    sendmsg_ItemPickup(id, item[])
    {
    	message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ItemPickup"), _, id)
    	write_string(item)
    	message_end()
    }
    mywpn_load_config()
    {
    	// Build customization file file_url
    	new file_url[64]
    	get_configsdir(file_url, charsmax(file_url))
    	format(file_url, charsmax(file_url), "%s/%s", file_url, CK_MYWPN_SETTING_FILE)
    	
    	// File not present
    	if (!file_exists(file_url))
    	{
    		write_file(file_url, "", -1)
    		return;
    	}
    	
    	// Set up some vars to hold parsing info
    	new linedata[1024], key[64], value[960]
    	
    	// Open customization file for reading
    	new file = fopen(file_url, "rt")
    	
    	while (file && !feof(file))
    	{
    		// Read one line at a time
    		fgets(file, linedata, charsmax(linedata))
    		
    		// Replace newlines with a null character to prevent headaches
    		replace(linedata, charsmax(linedata), "^n", "")
    		
    		// Blank line or comment
    		if (!linedata[0] || linedata[0] == ';')
    		{
    			continue;
    		}
    		
    		// Get key and value(s)
    		strtok(linedata, key, charsmax(key), value, charsmax(value), '=')
    		
    		// Trim spaces
    		trim(key)
    		trim(value)
    		
    		if (equali(key, "ENABLE")) g_mywpn_enable = str_to_num(value)
    	}
    }
    stock set_weapons_timeidle(id, Float:timeidle)
    {
    	new entwpn = get_weapon_ent(id, get_user_weapon(id))
    	if (pev_valid(entwpn)) set_pdata_float(entwpn, m_flTimeWeaponIdle, timeidle+3.0, 4)
    }
    stock set_player_nextattack(id, Float:nexttime)
    {
    	set_pdata_float(id, m_flNextAttack, nexttime, 4)
    }
    stock set_player_nexprimaryattack(id, Float:nexttime)
    {
    	new entwpn = get_weapon_ent(id, get_user_weapon(id))
    	//set_pdata_float(id, m_flNextAttack, nexttime, 4)
    	set_pdata_float(entwpn, m_flNextPrimaryAttack, nexttime, 4)
    	set_pdata_float(entwpn, m_flNextSecondaryAttack, nexttime, 4)
    }
    stock fm_find_ent_by_owner(index, const classname[], owner, jghgtype = 0) {
    	new strtype[11] = "classname", ent = index;
    	switch (jghgtype) {
    		case 1: strtype = "target";
    		case 2: strtype = "targetname";
    	}
    
    	while ((ent = engfunc(EngFunc_FindEntityByString, ent, strtype, classname)) && pev(ent, pev_owner) != owner) {}
    
    	return ent;
    }
    stock fm_cs_set_user_money(id, money)
    {
    	cs_set_user_money(id, min(money, get_pcvar_num(cvar_maxmoney)), 1)
    }
    
    
    //##############################################################
    // NATIVES
    //##############################################################
    public natives_get_user_buyzone(id)
    {
    	new buyzone = g_inbuyzone[id]
    	
    	if (get_pcvar_num(cvar_buyzone)) return 1;
    	
    	new mod_runing = natives_get_mod_runing()
    	if (mod_runing == CK_MOD_CSDM_SINGLE || mod_runing == CK_MOD_ZB3) buyzone = 1
    	else if (mod_runing == CK_MOD_ZBS && g_canbuy[id]) buyzone = 1
    	
    	if (is_user_bot(id)) buyzone = 1
    	
    	return buyzone
    }
    public natives_get_mod_runing()
    {
    	return g_modruning
    }
    public natives_get_weapon_type(weapon_id)
    {
    	new type_wpn
    
    	if (weapon_id == CSW_P228 || weapon_id == CSW_ELITE || weapon_id == CSW_FIVESEVEN || weapon_id == CSW_USP || weapon_id == CSW_GLOCK18 || weapon_id == CSW_DEAGLE)
    	{
    		type_wpn = CK_WPN_PISTOLS
    	}
    	else if (weapon_id == CSW_KNIFE)
    	{
    		type_wpn = CK_WPN_KNIFE
    	}
    	else if (weapon_id == CSW_HEGRENADE)
    	{
    		type_wpn = CK_WPN_HE
    	}
    	else if (weapon_id == CSW_FLASHBANG)
    	{
    		type_wpn = 41
    	}
    	else if (weapon_id == CSW_SMOKEGRENADE)
    	{
    		type_wpn = 42
    	}
    	else if (weapon_id == CSW_C4)
    	{
    		type_wpn = 5
    	}
    	else if (weapon_id == CSW_VEST || weapon_id == CSW_VESTHELM)
    	{
    		type_wpn = 8
    	}
    	else
    	{
    		type_wpn = CK_WPN_RIFLES
    	}
    	return type_wpn
    }
    public natives_set_cweapon_maxspeed(id)
    {
    	new Float:maxspeed = float(get_weapon_speed(get_user_weapon(id)))
    	set_pev(id, pev_maxspeed, maxspeed)
    	
    	return;
    }
    public natives_bot_use_weapons()
    {
    	return get_pcvar_num(cvar_bot_use_weapons)
    }
    public natives_weapons_stay()
    {
    	return get_pcvar_num(cvar_weapons_stay)
    }
    public natives_novalue(id)
    {
    	return 0
    }
    public natives_color_saytext(player, const message[], any:...)
    {
    	param_convert(2)
    	color_saytext(player, message)
    }
    public natives_wpn_free()
    {
    	return get_pcvar_num(cvar_free)
    }
    public natives_get_sound_attack()
    {
    	return get_pcvar_num(cvar_sound_attack)
    }
    public natives_show_weaponpickup(id, const weapon[])
    {
    	param_convert(2)
    	new hudweapon[32]
    	format(hudweapon, charsmax(hudweapon), "p_%s", weapon)
    	g_weappickup[id] = 1
    	sendmsg_ItemPickup(id, hudweapon)
    }
    public natives_take_damage(attacker, victim, Float:damage, damage_type)
    {
    	if (!pev_valid(attacker) || !damage) return;
    	
    	if (pev(victim, pev_health))
    	{
    		new mod_runing = natives_get_mod_runing()
    		if (mod_runing == CK_MOD_ZB3 || mod_runing == CK_MOD_ZBU || mod_runing == CK_MOD_ZBS)
    		{
    			if (!ck_zb_get_take_damage()) return;
    			
    			// x damage for nade type
    			if (damage_type==CK_WPN_TYPEDAMAGE_NADE) damage += float(ck_zb_get_damage_nade())
    			
    			// x damage for zombie mod
    			if (mod_runing==CK_MOD_ZB3 || mod_runing==CK_MOD_ZBS)
    			{
    				// x damage
    				new level_at = ck_zb_get_user_level(attacker)
    				damage = damage * (float(level_at)*0.1+1.0)
    			
    				// update damage attack for zb3
    				if (mod_runing==CK_MOD_ZB3)
    				{
    					new dmg_attack_set = ck_zb_get_user_damage_attack(attacker) + min(get_user_health(victim), floatround(damage))
    					ck_zb_set_user_damage_attack(attacker, dmg_attack_set)
    					//client_print(attacker, print_chat, "D[%i]", fnFloatToNum(damage))
    				}
    			}	
    		}
    		else if (mod_runing==CK_MOD_HMS)
    		{
    			// victim is bot
    			if (ck_scn_is_bot(victim))
    			{
    				// get damage level
    				damage = float(ck_scn_get_human_takedmg(attacker, damage))
    				
    				// x damage for nade type
    				if (damage_type==CK_WPN_TYPEDAMAGE_NADE) damage += float(ck_scn_get_damage_nade())
    
    				// update total kills of human
    				if (0<ck_scn_get_bot_health(victim)<=floatround(damage)) ck_scn_human_kill_bot(attacker, victim)
    			}
    		}
    	
    		// take dmaage
    		if (damage>0.0) ExecuteHam(Ham_TakeDamage, victim, attacker, attacker, damage, DMG_BULLET)
    	}
    }
    public natives_get_canbuy_team_mod()
    {
    	new canbuy
    	new mod_runing = natives_get_mod_runing()
    	if (mod_runing==CK_MOD_CSDM_SINGLE || mod_runing==CK_MOD_ZB3 || mod_runing==CK_MOD_ZBS || mod_runing==CK_MOD_HMS) canbuy = 1
    
    	return canbuy
    }
    public natives_get_freezetime()
    {
    	return g_freezetime
    }
    public natives_get_mod_has_supplybox()
    {
    	new has_box, mod_runing
    	mod_runing = natives_get_mod_runing()
    	if (mod_runing==CK_MOD_ZB3 || mod_runing==CK_MOD_ZBU || mod_runing==CK_MOD_ZBS) has_box = 1
    
    	return has_box
    }
    public natives_mywpn()
    {
    	return g_mywpn_enable
    }
    public natives_is_user_admin(id)
    {
    	new isadmin
    	if (get_user_flags(id) & ADMIN_KICK) isadmin = 1
    	
    	return isadmin
    }
    public natives_get_user_fastrun(id)
    {
    	return g_fastrun[id]
    }
    public natives_set_user_money(id, money)
    {
    	fm_cs_set_user_money(id, money)
    }
    
    
    public natives_set_fullammo(id)
    {
    	ck_wpn_set_fullammo1(id)
    	ck_wpn_set_fullammo2(id)
    }
    public natives_give_weapon(id, const weapon[])
    {
    	param_convert(2)
    	
    	ck_wpn_give_weapon1(id, weapon)
    	ck_wpn_give_weapon2(id, weapon)
    	ck_wpn_give_weapon3(id, weapon)
    	ck_wpn_give_weapon4(id, weapon)
    }
    public natives_get_fastrunanim_weapon(id, type)
    {
    	new type_wpn, anim
    	type_wpn = ck_get_weapon_type(get_user_weapon(id))
    	switch (type_wpn)
    	{
    		case CK_WPN_RIFLES: anim = ck_wpn_get_fastrunanim_weapon1(id, type)
    		case CK_WPN_PISTOLS: anim = ck_wpn_get_fastrunanim_weapon2(id, type)
    	}
    	
    	return anim;
    }
    public natives_get_user_sight(id)
    {
    	new type_wpn, result
    	type_wpn = ck_get_weapon_type(get_user_weapon(id))
    	switch (type_wpn)
    	{
    		case CK_WPN_RIFLES: result = ck_wpn_get_user_sight1(id)
    		case CK_WPN_PISTOLS: result = ck_wpn_get_user_sight2(id)
    	}
    	
    	return result;
    }
    public natives_get_int(id, data)
    {
    	new type_wpn, result
    	type_wpn = natives_get_weapon_type(get_user_weapon(id))
    	switch (type_wpn)
    	{
    		case CK_WPN_RIFLES: result = ck_wpn_get_int1(id, data)
    		case CK_WPN_PISTOLS: result = ck_wpn_get_int2(id, data)
    		case CK_WPN_KNIFE: result = ck_wpn_get_int3(id, data)
    		case CK_WPN_HE: result = ck_wpn_get_int4(id, data)
    	}
    	
    	return result;
    }
    public Float:natives_get_float(id, data)
    {
    	new type_wpn, Float:result
    	type_wpn = natives_get_weapon_type(get_user_weapon(id))
    	switch (type_wpn)
    	{
    		case CK_WPN_RIFLES: result = ck_wpn_get_float1(id, data)
    		case CK_WPN_PISTOLS: result = ck_wpn_get_float2(id, data)
    		case CK_WPN_KNIFE: result = ck_wpn_get_float3(id, data)
    		case CK_WPN_HE: result = ck_wpn_get_float4(id, data)
    	}
    	
    	return result;
    }
    /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
    *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1034\\ f0\\ fs16 \n\\ par }
    */
    


    include ck_wpn.txt
    Mã:
    // ------------------------------------
    // NST Wpn Include File
    // ------------------------------------
    
    //##############################################################
    // INFO PLUGIN
    //##############################################################
    #define CK_WPN_VERSION "3.0"
    #define CK_WPN_AUTHOR "NST"
    #define CK_WPN_NAME_RIFLES "CK Wpn Rifles"
    #define CK_WPN_NAME_PISTOLS "CK Wpn Pistols"
    #define CK_WPN_NAME_KNIFE "CK Wpn Knife"
    #define CK_WPN_NAME_HE "CK Wpn HeGrenade"
    #define CK_WPN_SETTING_FILE "ck_wpn.ini"
    #define CK_WPN_LANG_FILE "ck_wpn.txt"
    #define CK_MYWPN_SETTING_FILE "ck_mywpn.ini"
    
    
    //##############################################################
    // ENUM MAIN VALUE
    //##############################################################
    // weapon type
    enum
    {
    	CK_WPN_RIFLES = 1,
    	CK_WPN_PISTOLS,
    	CK_WPN_KNIFE,
    	CK_WPN_HE
    }
    // menu type
    enum
    {
    	CK_MENUWPN_MAIN = 0,
    	CK_MENUWPN_SHOP,
    	CK_MENUWPN_MYWPN
    }
    // ini file
    enum
    {
    	CK_WPN_INI_READ = 0,
    	CK_WPN_INI_SAVE
    }
    // mod run
    enum
    {
    	CK_MOD_DEFAULT = 1,
    	CK_MOD_CSDM_SINGLE,
    	CK_MOD_CSDM_TEAM,
    	CK_MOD_ZB3,
    	CK_MOD_ZBU,
    	CK_MOD_ZBS,
    	CK_MOD_HMS,
    	CK_MOD_GHOST
    }
    // weapon anim
    enum
    {
    	CK_ANI_KNIFE_ATTACK,
    	CK_ANI_LIGHT_ATTACK,
    	CK_ANI_SHOTGUN_RELOAD,
    	CK_ANI_LAUNCHER_CHANGE,
    	CK_ANI_LAUNCHER_SHOOT,
    	CK_ANI_LAUNCHER_SHOOT_LAST,
    	CK_ANI_M134_FIRE_READY,
    	CK_ANI_M134_FIRE_AFTER,
    	CK_ANI_M134_IDLE_CHANGE,
    	CK_ANI_M134_FIRE_CHANGE,
    	CK_ANI_FASTRUN_BEGIN,
    	CK_ANI_FASTRUN_IDLE,
    	CK_ANI_FASTRUN_END,
    	CK_ANI_SIGHT_BEGIN,
    	CK_ANI_SIGHT_END	
    }
    // data value
    enum
    {
    	CK_WPN_DATA_HASWEAPON = 1,
    	CK_WPN_DATA_KNOCKBACK,
    	CK_WPN_DATA_GRAVITY,
    	CK_WPN_DATA_FASTRUN,
    	CK_WPN_DATA_RELOAD,
    	CK_WPN_DATA_DEPLOY,
    	CK_WPN_DATA_DAMAGE,
    	CK_WPN_DATA_SPEED,
    	CK_WPN_DATA_RECOIL
    }
    // damage type
    enum
    {
    	CK_WPN_TYPEDAMAGE_NONE = 0,
    	CK_WPN_TYPEDAMAGE_NADE
    }
    
    
    //##############################################################
    // MAIN NATIVES
    //##############################################################
    // Tra ve ID nhom cua vu khi
    native ck_get_weapon_type(weapon_id)
    
    // Bot co quyen su dung vu khi moi hay khong (1:co - 0:khong)
    native ck_bot_use_weapons()
    
    // vu khi ton tai tren mat dat bao lau
    native ck_weapons_stay()
    
    // Tra ve ID cua che do dang choi
    native ck_get_mod_runing()
    
    // Kiem tra xem co phai vi tri Mua vu khi hay khong (1 la dung - 0 la khong)
    native ck_get_user_buyzone(id)
    
    // show chat text
    native ck_color_saytext(player, const message[], any:...)
    
    // set money for user
    native ck_set_user_money(id, money)
    
    // is user admin ?
    native ck_is_user_admin(id)
    
    
    //##############################################################
    // WEAPON NATIVES
    //##############################################################
    // get free wpn
    native ck_wpn_free()
    
    // send anim weapons
    native ck_wpn_send_weapon_anim(player, anim)
    
    // dang cua sound attack
    native ck_wpn_get_sound_attack()
    
    // hien hud weapon pickup
    native ck_wpn_show_weaponpickup(id, const weapon[])
    
    // fake take damage
    native ck_wpn_take_damage(attacker, victim, Float:damage, damage_type)
    
    // kiem tra xem co the mua vu khi khong phai cua doi minh theo cac che do choi hay ko
    native ck_wpn_get_canbuy_team_mod()
    
    // kiem tra freezetime
    native ck_wpn_get_freezetime()
    
    // kiem tra mod dang choi co dung HTT ko
    native ck_wpn_get_mod_has_supplybox()
    
    // kiem tra xem co su dung chuc nang Kho Do khong?
    native ck_wpn_mywpn()
    
    // set full ammo
    native ck_wpn_set_fullammo(id)
    native ck_wpn_set_fullammo1(id)
    native ck_wpn_set_fullammo2(id)
    
    // give weapon
    native ck_wpn_give_weapon(id, const weapon[])
    native ck_wpn_give_weapon1(id, const weapon[])
    native ck_wpn_give_weapon2(id, const weapon[])
    native ck_wpn_give_weapon3(id, const weapon[])
    native ck_wpn_give_weapon4(id, const weapon[])
    
    // get user fastrun
    native ck_wpn_get_user_fastrun(id)
    
    // get anim of weapon when fastrun
    native ck_wpn_get_fastrunanim_weapon(id, type)
    native ck_wpn_get_fastrunanim_weapon1(id, type)
    native ck_wpn_get_fastrunanim_weapon2(id, type)
    
    // get config of nst wpn
    native ck_wpn_get_int(id, data)
    native ck_wpn_get_int1(id, data)
    native ck_wpn_get_int2(id, data)
    native ck_wpn_get_int3(id, data)
    native ck_wpn_get_int4(id, data)
    native Float:ck_wpn_get_float(id, data)
    native Float:ck_wpn_get_float1(id, data)
    native Float:ck_wpn_get_float2(id, data)
    native Float:ck_wpn_get_float3(id, data)
    native Float:ck_wpn_get_float4(id, data)
    
    // get user fastrun
    native ck_wpn_get_user_sight(id)
    native ck_wpn_get_user_sight1(id)
    native ck_wpn_get_user_sight2(id)
    
    
    /**
     * Called when player buy Pistols and current weapon is fifles
     *
     * @param id	Player index
     */
    forward ck_wpn_weapon_draw(id)
    
    
    //##############################################################
    // MY WEAPONS
    //##############################################################
    #define ck_mywpn_res_url "resource/ui/CKWpn_MyWeapons.res"
    #define ck_mywpn_res_url_ct "resource/ui/CKWpn_MyWeapons_CT.res"
    #define ck_mywpn_res_url_ter "resource/ui/CKWpn_MyWeapons_TER.res"
    #define ck_mywpn_res_img_search "//%i-weapon%i-img"
    #define ck_mywpn_res_img_set "		^"image^"				^"gfx/vgui/%s^""
    #define ck_mywpn_res_img_none "		^"image^"				^"gfx/vgui/noimg^""
    #define ck_mywpn_res_team_search "//%i-weapon%i-team"
    #define ck_mywpn_res_team_set "		^"image^"				^"resource/control/team%i^""
    #define ck_mywpn_res_team_none "		^"image^"				^"resource/control/noimg^""
    #define ck_mywpn_res_name_search "//%i-weapon%i-name"
    #define ck_mywpn_res_name_set "		^"labelText^"			^"%s - %i$^""
    #define ck_mywpn_res_name_none "		^"labelText^"			^"^""
    #define ck_mywpn_res_bottom_search "//%i-weapon%i-bottom"
    #define ck_mywpn_res_bottom_set "		^"command^"				^"ck_buy_mywpn %s^""
    #define ck_mywpn_res_bottom_none "	^"command^"				^"^""
    /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
    *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1034\\ f0\\ fs16 \n\\ par }
    */
    
     
  16. buiducduy111

    buiducduy111 Dragon Quest

    Tham gia ngày:
    3/5/11
    Bài viết:
    1,257
    ^ : Úi zoi, lại có 1 em định thay đổi bản quyền đây. Để NST thì cứ NST đi, sửa thành CK là đứa nào :4cool_oh:
     
  17. hiroshi_dinh

    hiroshi_dinh The Warrior of Light

    Tham gia ngày:
    6/4/07
    Bài viết:
    2,043
    ^ là bản compete king chứ ai :5cool_beat_plaster: h mới thấy ck cũng lấy nst à :5cool_beat_plaster:
     
  18. MrKaii

    MrKaii The Warrior of Light

    Tham gia ngày:
    14/6/11
    Bài viết:
    2,208
    Nơi ở:
    Hà Nội
    định ăn cắp bản quyền nst à, nhục nhã vậy, những người biết amx xin đừng chỉ
     
  19. Giazzrian

    Giazzrian C O N T R A

    Tham gia ngày:
    6/1/11
    Bài viết:
    1,880
    Nơi ở:
    BMT/HCM
    =))..... hết đỡ với bạn trẻ, đã ăn cắp còn la làng =))
     
  20. MrKaii

    MrKaii The Warrior of Light

    Tham gia ngày:
    14/6/11
    Bài viết:
    2,208
    Nơi ở:
    Hà Nội
    đời mình rất ghét những đứa ăn cắp thành quả của người ta chi trong vài phút vài giây, đổi tên author rồi để cho mọi người biết là mình vừa hoàn thành xong hệ thống plugins mới, author bỏ time ra cả tháng trời nhưng khi pub thì lại bị mất trong vài s
     

Chia sẻ trang này