[AMX][Codes] Hỏi đáp về các code của AMX ...

Thảo luận trong 'Counter Strike' bắt đầu bởi sontung0, 6/8/09.

Trạng thái chủ đề:
Không mở trả lời sau này.
  1. TaskForce411

    TaskForce411 Legend of Zelda

    Tham gia ngày:
    10/11/10
    Bài viết:
    948
    Nơi ở:
    S.V.E.N I.O.A.F
    Uno nè.
    Mình nói ngoài lề chút là có cái plug-in Helicopter ( forum mình có đăng 1 lần ), không biết thêm vào CSMW2 thì thành Chopper Gunner dc không nhỉ ^^. Nếu thay dc skin cái đó thành Predator thì tốt !:)

    Hỏi bà con tí:
    Mình add cái Helicopter vô AMX Mod, mà sao vô gõi trong console amx_apache ( đ1ung như chỉ dẫn ) thì nó lại báo Unknown Command ?
    Help, please
     
  2. My Own Way

    My Own Way S.V.E.N Commander Lão Làng GVN

    Tham gia ngày:
    30/7/09
    Bài viết:
    12,230
    Nơi ở:
    Hải Phòng
    Vứt cái plugin( file .sma) lên đây, nếu đợi reply được thì chiều 5h ta về check..
    @uno: Sang thread mdl đi, vì nó liên quan mdl rồi.
     
  3. TaskForce411

    TaskForce411 Legend of Zelda

    Tham gia ngày:
    10/11/10
    Bài viết:
    948
    Nơi ở:
    S.V.E.N I.O.A.F
  4. My Own Way

    My Own Way S.V.E.N Commander Lão Làng GVN

    Tham gia ngày:
    30/7/09
    Bài viết:
    12,230
    Nơi ở:
    Hải Phòng
    Sặc.. Bây giờ copy hết tất cả code trong file sma đó rồi ông đặt vào thẻ
    PHP:
    post lên 4rum để tôi xem luôn..[/color]
     
  5. Killer.Uno

    Killer.Uno Dragon Quest

    Tham gia ngày:
    12/2/10
    Bài viết:
    1,496
    @chief : cái này còn là plugin mà ... cần ng giúp NST weapons.amxx dùng đc cho default weapons ...
    @TF4 : cái chopper tui k biết , cái này mấy coder giỏi làm mới đc :) .. + mdl apache đó nhỏ wa' , ...chopper bay cao mờ sky cs thì ... ! predator ? predator lien wan ji chời =.=" ...

    Mod thì xong hết HUD rùi , đang fix vài lổi
     
  6. TaskForce411

    TaskForce411 Legend of Zelda

    Tham gia ngày:
    10/11/10
    Bài viết:
    948
    Nơi ở:
    S.V.E.N I.O.A.F
    Predator Missile ý mà, cái Helicopter đó thì nó cũng bắn Misile dc.

    PHP:
    #include <amxmodx>
    #include <amxmisc>
    #include <cstrike>
    #include <fun>
    #include <engine>
    #include <fakemeta>

    #define APACHE_ADMIN ADMIN_LEVEL_A

    #define TASK_ROCKET 6740100
    #define TASK_BOMB 6760200

    new apaches[33], camera[33], apache_speed[33], grabbed[33]
    new 
    smokeboomlaserbeam
    new maxplayersmaxentities
    new bool:wait_rocket[33], bool:wait_bomb[33], bool:wait_stealth[33], stealth[33]
    new 
    gmsgNVGToggle
    new g_apacheactive 0

    new active,health,maxspeed2,stealthamt,stealthspeed,stealthregen,bulletdmg,bulletspeed;
    new 
    rocketspeed,distance,height,beams,cost,admins,ff;

    public 
    plugin_init()
    {
        
    register_plugin("AMX Apache""0.2.0""KRoTaL, Fox-NL")
        
        
    register_concmd("amx_apache""create_apache"0"creates a helicopter you can control")
        
    register_concmd("amx_destroyapache""destroy_apache"0"destroys the helicopter you are controlling")
        
        
    register_clcmd("drop""stop_apache")
        
    register_clcmd("nightvision""stealth_mode")
        
        
    active =           register_cvar("apache_active""1")
        
    health =           register_cvar("apache_health""1000")
        
    maxspeed2 =         register_cvar("apache_maxspeed""400")
        
    stealthamt =       register_cvar("apache_stealth_amount""40")
        
    stealthspeed =    register_cvar("apache_stealth_maxspeed""60")
        
    stealthregen =    register_cvar("apache_stealth_regen""10")
        
    bulletdmg =        register_cvar("apache_bulletdmg""10")
        
    bulletspeed =     register_cvar("apache_bulletspeed""2000")
        
    rocketspeed =     register_cvar("apache_rocketspeed""1000")
        
    distance =         register_cvar("apache_dist""70")
        
    height =           register_cvar("apache_height""20")
        
    beams =            register_cvar("apache_beams""0")
        
    cost =             register_cvar("apache_cost""5000")
        
    admins =           register_cvar("apache_admins""0")
        
    ff =               register_cvar("apache_ff""0")
        
        
    register_event("DeathMsg""death_event""a")
        
    register_event("ResetHUD""resethud_event""be")
        
    register_event("CurWeapon""check_weapon""be""1=1")
        
    register_logevent("new_round"2"0=World triggered""1=Round_Start")
        
    register_event("TextMsg""game_restart""a""1=4""2&#Game_C""2&#Game_w")
        
    register_event("SendAudio""round_end""a""2=%!MRAD_terwin""2=%!MRAD_ctwin""2=%!MRAD_rounddraw")
        
    register_forward(FM_EmitSound,"emitsound",0)
        
        
    maxplayers get_maxplayers() + 1
        maxentities 
    get_global_int(GL_maxEntities)
        
        
    gmsgNVGToggle get_user_msgid("NVGToggle")
    }

    public 
    client_connect(id)
    {
        if(
    task_exists(54545454+id))
        {
            
    remove_task(54545454+id)
        }
        
    apaches[id] = 0
        camera
    [id] = 0
        grabbed
    [id] = 0
        wait_rocket
    [id] = false
        wait_bomb
    [id] = false
        wait_stealth
    [id] = false
        stealth
    [id] = false
    }

    public 
    client_disconnect(id)
    {
        if(
    task_exists(54545454+id))
        {
            
    remove_task(54545454+id)
        }
        if(
    apaches[id] > 0)
        {
            
    emit_sound(apaches[id], CHAN_VOICE"vox/_period.wav"0.8ATTN_NORM0PITCH_NORM)
            
    remove_entity(apaches[id])
            
    apaches[id] = 0
        
    }
        if(
    camera[id] > 0)
        {
            
    remove_entity(camera[id])
            
    camera[id] = 0
        
    }
        
    grabbed[id] = 0
        wait_rocket
    [id] = false
        wait_bomb
    [id] = false
        wait_stealth
    [id] = false
        stealth
    [id] = false
    }

    public 
    new_round()
    {
        new 
    ent
        
    while((ent find_ent_by_class(ent,"apache_bullet")) != 0)
            
    remove_entity(ent)
        
        
    ent find_ent_by_class(-1"apache_rocket")
        new 
    tempent
        
    while(ent 0)
        {
            
    tempent find_ent_by_class(ent"apache_rocket")
            
    emit_sound(entCHAN_WEAPON"vox/_period.wav"0.8ATTN_NORM0PITCH_NORM)
            
    //emit_sound(ent, CHAN_VOICE, "vox/_period.wav", 0.8, ATTN_NORM, 0, PITCH_NORM)
            
    remove_entity(ent)
            
    ent tempent
        
    }
        
    set_task(0.1"set_speed"875457545)
    }

    public 
    round_end()
    {
        
    set_task(4.0"disable_sound"212454212)
    }

    public 
    game_restart()
    {
        
    set_task(0.5"disable_sound"787454241)
    }

    public 
    disable_sound()
    {
        new 
    players[32], inumplayer
        get_players
    (playersinum"a")
        for(new 
    inum i++)
        {
            
    player players[i]
            if(
    apaches[player] > 0)
            {
                
    emit_sound(apaches[player], CHAN_VOICE"vox/_period.wav"0.8ATTN_NORM0PITCH_NORM)
            }
        }
    }

    public 
    death_event()
    {
        
    g_apacheactive get_pcvar_num(active)
        new 
    id read_data(2)
        
        if(
    task_exists(54545454+id))
        {
            
    remove_task(54545454+id)
        }
        if(
    apaches[id] > 0)
        {
            
    emit_sound(apaches[id], CHAN_VOICE"vox/_period.wav"0.8ATTN_NORM0PITCH_NORM)
            
    remove_entity(apaches[id])
            
    apaches[id] = 0
        
    }
        if(
    camera[id] > 0)
        {
            
    attach_view(idid)
            
    remove_entity(camera[id])
            
    camera[id] = 0
        
    }
        for(new 
    maxplayers i++)
        {
            if(
    grabbed[i] == id)
            {
                
    grabbed[i] = 0
            
    }
        }
        
    grabbed[id] = 0
        wait_rocket
    [id] = false
        wait_bomb
    [id] = false
        wait_stealth
    [id] = false
        stealth
    [id] = false
        client_cmd
    (id"-left")
        
    client_cmd(id"-right")
        
    message_begin(MSG_ONEgmsgNVGToggle, {0,0,0}, id)
        
    write_byte(0)
        
    message_end()
    }

    public 
    resethud_event(id)
    {
        
    g_apacheactive get_pcvar_num(active)
        if(
    task_exists(54545454+id))
        {
            
    remove_task(54545454+id)
        }
        if(
    apaches[id] > 0)
        {
            new 
    Float:apachecost get_pcvar_float(cost)
            new 
    Float:apachehealth get_pcvar_float(health)
            new 
    Float:apachecurhealth entity_get_float(apaches[id], EV_FL_health) - 5000
            
    new payback floatround((apachecost apachecurhealth) / apachehealth)
            
    cs_set_user_money(idcs_get_user_money(id) + payback1)
            
    emit_sound(apaches[id], CHAN_VOICE"vox/_period.wav"0.8ATTN_NORM0PITCH_NORM)
            
    remove_entity(apaches[id])
            
    apaches[id] = 0
        
    }
        if(
    camera[id] > 0)
        {
            
    attach_view(idid)
            
    remove_entity(camera[id])
            
    camera[id] = 0
        
    }
        
    grabbed[id] = 0
        wait_rocket
    [id] = false
        wait_bomb
    [id] = false
        wait_stealth
    [id] = false
        stealth
    [id] = false
        client_cmd
    (id"-left")
        
    client_cmd(id"-right")
        
    message_begin(MSG_ONEgmsgNVGToggle, {0,0,0}, id)
        
    write_byte(0)
        
    message_end()
    }

    public 
    check_weapon(id)
    {
        if(
    apaches[id] > 0)
        {
            
    client_cmd(id"weapon_knife")
            
    set_user_maxspeed(id, -1.0)
        }
    }

    public 
    set_speed(id)
    {
        new 
    players[32], inumplayer
        get_players
    (playersinum"a")
        for(new 
    inum i++)
        {
            
    player players[i]
            if(
    apaches[player] > 0)
            {
                
    set_user_maxspeed(player, -1.0)
            }
        }
    }

    public 
    create_apache(id,level,cid)
    {
        if(
    get_pcvar_num(active) == 0)
        {
            
    console_print(id"AMX Apache is not enabled.")
            return 
    PLUGIN_HANDLED
        
    }
        
        if(
    get_pcvar_num(admins) == 1)
        {
            if(!(
    get_user_flags(id) & APACHE_ADMIN))
            {
                
    console_print(id"You have no access to that command.")
                return 
    PLUGIN_HANDLED
            
    }
        }
        
        if(
    apaches[id] > 0)
        {
            
    console_print(id"You already control a helicopter.")
            
    client_print(idprint_center"You already control a helicopter.")
            return 
    PLUGIN_HANDLED
        
    }
        
        if(!
    is_user_alive(id))
        {
            
    console_print(id"You cannot control a helicopter when you are dead.")
            
    client_print(idprint_center"You cannot control a helicopter when you are dead.")
            return 
    PLUGIN_HANDLED
        
    }
        
        if(!(
    get_user_flags(id) & APACHE_ADMIN))
        {
            new 
    apachecost get_pcvar_num(cost)
            new 
    usermoney cs_get_user_money(id)
            if(
    usermoney apachecost)
            {
                
    console_print(id"You don't have enough money ($%i needed)"apachecost)
                
    client_print(idprint_center"You don't have enough money ($%i needed)"apachecost)
                return 
    PLUGIN_HANDLED
            
    }
            
    cs_set_user_money(idusermoney apachecost1)
        }
        
        new 
    Float:origin[3]
        new 
    Float:angles[3]
        
    entity_get_vector(idEV_VEC_originorigin)
        
    entity_get_vector(idEV_VEC_v_angleangles)
        
        
    apaches[id] = create_entity("info_target")
        if(
    apaches[id] > 0)
        {
            
    entity_set_string(apaches[id], EV_SZ_classname"amx_apache")
            
    entity_set_model(apaches[id], "models/rc_apache_final.mdl")
            
            
    entity_set_size(apaches[id], Float:{-12.0,-12.0,-6.0}, Float:{12.0,12.0,6.0})
            
            
    entity_set_origin(apaches[id], origin)
            
    entity_set_vector(apaches[id], EV_VEC_anglesangles)
            
            
    entity_set_int(apaches[id], EV_INT_solid2)
            
    entity_set_int(apaches[id], EV_INT_movetype5)
            
    entity_set_edict(apaches[id], EV_ENT_ownerid)
            
    entity_set_int(apaches[id], EV_INT_sequence1)
            
    entity_set_float(apaches[id], EV_FL_takedamageDAMAGE_AIM)
            
    entity_set_float(apaches[id], EV_FL_healthget_pcvar_float(health) + 5000.0)
            
            
    apache_speed[id] = 50
            
            
    new Float:velocity[3]
            
    VelocityByAim(idapache_speed[id], velocity)
            
    entity_set_vector(apaches[id], EV_VEC_velocityvelocity)
            
            
    emit_sound(apaches[id], CHAN_VOICE"apache/ap_rotor2.wav"0.8ATTN_NORM0PITCH_NORM)
        }
        
        
    camera[id] = create_entity("info_target")
        if(
    camera[id] > 0)
        {
            
    entity_set_string(camera[id], EV_SZ_classname"camera")
            
    entity_set_int(camera[id], EV_INT_solidSOLID_NOT)
            
    entity_set_int(camera[id], EV_INT_movetypeMOVETYPE_NOCLIP)
            
    entity_set_size(camera[id], Float:{0,0,0}, Float:{0,0,0})
            
    entity_set_model(camera[id], "models/rpgrocket.mdl")
            
    set_rendering(camera[id], kRenderFxGlowShell000kRenderTransAlpha0)
            
            
    entity_set_origin(camera[id], origin)
            
    entity_set_vector(camera[id], EV_VEC_anglesangles)
            
            
    attach_view(idcamera[id])
        }
        
        
    engclient_cmd(id"weapon_knife")
        
    set_user_maxspeed(id, -1.0)
        
        if(
    task_exists(54545454+id))
        {
            
    remove_task(54545454+id)
        }
        
        
    grabbed[id] = 0
        wait_rocket
    [id] = false
        wait_bomb
    [id] = false
        wait_stealth
    [id] = false
        stealth
    [id] = false
        
        
    return PLUGIN_HANDLED
    }

    public 
    destroy_apache(id,level,cid)
    {
        if (!
    cmd_access(id,level,cid,1))
        {
            return 
    PLUGIN_HANDLED
        
    }
        
        if(
    apaches[id] > 0)
        {
            
    attach_view(idid)
            
    emit_sound(apaches[id], CHAN_VOICE"vox/_period.wav"0.8ATTN_NORM0PITCH_NORM)
            
    remove_entity(apaches[id])
            
    apaches[id] = 0
            set_user_maxspeed
    (id250.0)
        }
        if(
    camera[id] > 0)
        {
            
    attach_view(idid)
            
    remove_entity(camera[id])
            
    camera[id] = 0
        
    }
        
        if(
    task_exists(54545454+id))
        {
            
    remove_task(54545454+id)
        }
        
        
    grabbed[id] = 0
        wait_rocket
    [id] = false
        wait_bomb
    [id] = false
        wait_stealth
    [id] = false
        stealth
    [id] = false
        client_cmd
    (id"-left")
        
    client_cmd(id"-right")
        
        
    message_begin(MSG_ONEgmsgNVGToggle, {0,0,0}, id)
        
    write_byte(0)
        
    message_end()
        
        return 
    PLUGIN_HANDLED
    }

    public 
    stop_apache(id)
    {
        if(
    apaches[id] > 0)
        {
            if(
    apache_speed[id] <= 30 && apache_speed[id] >= -30)
            {
                
    apache_speed[id] = 0
            
    }
            return 
    PLUGIN_HANDLED
        
    }
        
        return 
    PLUGIN_CONTINUE
    }

    public 
    stealth_mode(id)
    {
        if(
    apaches[id] > 0)
        {
            if(!
    wait_stealth[id])
            {
                if(!
    stealth[id])
                {
                    
    stealth[id] = true
                    emit_sound
    (apaches[id], CHAN_VOICE"apache/ap_rotor2.wav"0.1ATTN_NORM0PITCH_NORM)
                    
    set_rendering(apaches[id], kRenderFxGlowShell000kRenderTransAlphaget_pcvar_num(stealthamt))
                    
    message_begin(MSG_ONEgmsgNVGToggle, {0,0,0}, id)
                    
    write_byte(1)
                    
    message_end()
                }
                else
                {
                    
    stealth[id] = false
                    emit_sound
    (apaches[id], CHAN_VOICE"apache/ap_rotor2.wav"0.8ATTN_NORM0PITCH_NORM)
                    
    set_rendering(apaches[id])
                    
    message_begin(MSG_ONEgmsgNVGToggle, {0,0,0}, id)
                    
    write_byte(0)
                    
    message_end()
                    
    wait_stealth[id] = true
                    
    new ids[1]
                    
    ids[0] = id
                    set_task
    (get_pcvar_float(stealthregen), "reset_stealth"54545454+idids1)
                }
            }
            return 
    PLUGIN_HANDLED
        
    }
        
        return 
    PLUGIN_CONTINUE
    }

    public 
    client_PreThink(id)
    {
        if(
    g_apacheactive == 0)
        {
            return 
    PLUGIN_CONTINUE
        
    }
        
        if(
    is_user_alive(id) && apaches[id] > && camera[id] > 0)
        {
            new 
    Float:forigin[3], Float:dist_origin[3], Float:camera_origin[3]
            new 
    buttonoldbutton
            
    new apacheId apaches[id]
            new 
    maxspeed
            
    new Float:frame
            
    new apache_maxspeed get_pcvar_num(maxspeed2)
            new 
    apache_stealth_maxspeed get_pcvar_num(stealthspeed)
            new 
    Float:angles[3], Float:velocity[3]
            new 
    Float:apache_height get_pcvar_float(height)
            new 
    apache_bulletspeed get_pcvar_num(bulletspeed)
            new 
    apache_rocketspeed get_pcvar_num(rocketspeed)
            new 
    classname[32]
            new 
    Float:aim_origin[3], Float:end_origin[3]
            new 
    apache_beams get_pcvar_num(beams)
            if(
    entity_get_float(apacheIdEV_FL_health) < 5000)
            {
                new 
    Float:explosion[3]
                
    entity_get_vector(apacheIdEV_VEC_originexplosion)
                
    message_begin(MSG_BROADCASTSVC_TEMPENTITY)
                
    write_byte(3)
                
    write_coord(floatround(explosion[0]))
                
    write_coord(floatround(explosion[1]))
                
    write_coord(floatround(explosion[2]))
                
    write_short(boom)
                
    write_byte(50)
                
    write_byte(15)
                
    write_byte(0)
                
    message_end()
                
                
    HL_RadiusDamage(explosion,0,50.0,300.0)
                
    /*radius_damage(explosion,50,300)*/
                
                
    attach_view(idid)
                if(
    camera[id] > 0)
                {
                    
    remove_entity(camera[id])
                    
    camera[id] = 0
                
    }
                
    emit_sound(apacheIdCHAN_VOICE"vox/_period.wav"0.8ATTN_NORM0PITCH_NORM)
                
    remove_entity(apacheId)
                
    apaches[id] = 0
                set_user_maxspeed
    (id250.0)
                if(
    task_exists(54545454+id))
                {
                    
    remove_task(54545454+id)
                }
                
    wait_rocket[id] = false
                wait_stealth
    [id] = false
                stealth
    [id] = false
                client_cmd
    (id"-left")
                
    client_cmd(id"-right")
                
    message_begin(MSG_ONEgmsgNVGToggle, {0,0,0}, id)
                
    write_byte(0)
                
    message_end()
                return 
    PLUGIN_CONTINUE
            
    }
            
            
    frame entity_get_float(apacheIdEV_FL_frame)
            if(
    frame 0.0 || frame 254.0)
            {
                
    entity_set_float(apacheIdEV_FL_frame0.0)
            }
            else
            {
                
    entity_set_float(apacheIdEV_FL_frameframe 1.0)
            }
            
            
    entity_get_vector(apacheIdEV_VEC_originforigin)
            
    button get_user_button(id)
            if(
    button IN_FORWARD)
            {
                
    apache_speed[id] += 5
            
    }
            if(
    button IN_BACK)
            {
                
    apache_speed[id] -= 5
            
    }
            if(!
    stealth[id])
            {
                
    maxspeed apache_maxspeed
            
    }
            else
            {
                
    maxspeed apache_stealth_maxspeed
            
    }
            if(
    apache_speed[id] > maxspeed)
            {
                
    apache_speed[id] = maxspeed
            
    }
            if(
    apache_speed[id] < - 80)
            {
                
    apache_speed[id] = - 80
            
    }
            
            
    entity_get_vector(apacheIdEV_VEC_originforigin)
            
    entity_get_vector(idEV_VEC_v_angleangles)
            
    angles[0] = - angles[0]
            
    VelocityByAim(idapache_speed[id], velocity)
            
    entity_set_vector(apacheIdEV_VEC_anglesangles)
            
    entity_set_vector(apacheIdEV_VEC_velocityvelocity)
            
            
    oldbutton get_user_oldbutton(id)
            if(
    button IN_JUMP)
            {
                
    forigin[2] += 2.0
                
    if(PointContents(forigin) != CONTENTS_SOLID)
                {
                    
    entity_set_origin(apacheIdforigin)
                }
            }
            if(
    button IN_DUCK)
            {
                
    forigin[2] -= 2.0
                
    if(PointContents(forigin) != CONTENTS_SOLID)
                {
                    
    entity_set_origin(apacheIdforigin)
                }
            }
            
            if(
    PointContents(forigin) == CONTENTS_SOLID)
            {
                
    forigin[2] += 10.0
                
    if(PointContents(forigin) == CONTENTS_SOLID)
                {
                    
    forigin[2] -= 60.0
                
    }
                
    entity_set_origin(apacheIdforigin)
            }
            
            
    VelocityByAim(idget_pcvar_num(distance), dist_origin)
            
    camera_origin[0] = forigin[0] - dist_origin[0]
            
    camera_origin[1] = forigin[1] - dist_origin[1]
            
    camera_origin[2] = forigin[2] + apache_height
            entity_set_origin
    (camera[id], camera_origin)
            
    angles[0] = - angles[0]
            
    entity_set_vector(camera[id], EV_VEC_anglesangles)
            
            if(
    button IN_ATTACK && !(oldbutton IN_ATTACK) && get_num_ents() < (maxentities 50))
            {
                
    emit_sound(apacheIdCHAN_WEAPON"weapons/m249-1.wav"0.8ATTN_NORM0PITCH_NORM)
                
                new 
    ent create_entity("info_target")
                if(
    ent 0)
                {
                    
    entity_set_string(entEV_SZ_classname"apache_bullet")
                    
    entity_set_model(ent"models/shell.mdl")
                    
                    
    entity_set_size(entFloat:{-1.0,-1.0,-1.0}, Float:{1.0,1.0,1.0})
                    
                    
    entity_set_origin(entforigin)
                    
    entity_set_vector(entEV_VEC_anglesangles)
                    
                    
    entity_set_int(entEV_INT_solid1)
                    
    entity_set_int(entEV_INT_movetype5)
                    
    entity_set_edict(entEV_ENT_ownerid)
                    
                    
    VelocityByAim(idapache_bulletspeedvelocity)
                    
    entity_set_vector(entEV_VEC_velocityvelocity)
                    
                    
    message_begin(MSG_BROADCASTSVC_TEMPENTITY)
                    
    write_byte(22)
                    
    write_short(ent)
                    
    write_short(smoke)
                    
    write_byte(25)
                    
    write_byte(1)
                    
    write_byte(255)
                    
    write_byte(255)
                    
    write_byte(255)
                    
    write_byte(128)
                    
    message_end()
                }
            }
            if(
    button IN_ATTACK2 && !wait_rocket[id] && get_num_ents() < (maxentities 50))
            {
                new 
    ent create_entity("info_target")
                if(
    ent 0)
                {
                    
    entity_set_string(entEV_SZ_classname"apache_rocket")
                    
    entity_set_model(ent"models/rpgrocket.mdl")
                    
                    
    entity_set_size(entFloat:{-1.0,-1.0,-1.0}, Float:{1.0,1.0,1.0})
                    
                    
    entity_set_origin(entforigin)
                    
    entity_set_vector(entEV_VEC_anglesangles)
                    
                    
    entity_set_int(entEV_INT_effects64)
                    
    entity_set_int(entEV_INT_solid1)
                    
    entity_set_int(entEV_INT_movetype5)
                    
    entity_set_edict(entEV_ENT_ownerid)
                    
                    
    VelocityByAim(idapache_rocketspeedvelocity)
                    
    entity_set_vector(entEV_VEC_velocityvelocity)
                    
                    
    message_begin(MSG_BROADCASTSVC_TEMPENTITY)
                    
    write_byte(22)
                    
    write_short(ent)
                    
    write_short(smoke)
                    
    write_byte(40)
                    
    write_byte(4)
                    
    write_byte(255)
                    
    write_byte(0)
                    
    write_byte(0)
                    
    write_byte(128)
                    
    message_end()
                    
                    
    emit_sound(entCHAN_WEAPON"weapons/rocketfire1.wav"0.8ATTN_NORM0PITCH_NORM)
                    
    //emit_sound(ent, CHAN_VOICE, "weapons/rocket1.wav", 0.8, ATTN_NORM, 0, PITCH_NORM)
                
    }
                
    wait_rocket[id] = true
                set_task
    (2.0"reset_rocket"id+TASK_ROCKET)
            }
            if(
    button IN_RELOAD && !wait_bomb[id] && grabbed[id] == && get_num_ents() < (maxentities 50))
            {
                new 
    ent create_entity("info_target")
                if(
    ent 0)
                {
                    
    entity_set_string(entEV_SZ_classname"apache_bomb")
                    
    entity_set_model(ent"models/rpgrocket.mdl")
                    
                    
    entity_set_size(entFloat:{-1.0,-1.0,-1.0}, Float:{1.0,1.0,1.0})
                    
                    
    entity_set_origin(entforigin)
                    
    entity_set_vector(entEV_VEC_anglesangles)
                    
                    
    entity_set_int(entEV_INT_solid1)
                    
    entity_set_int(entEV_INT_movetype6)
                    
    entity_set_edict(entEV_ENT_ownerid)
                }
                
    wait_bomb[id] = true
                set_task
    (4.0"reset_bomb"id+TASK_BOMB)
            }
            if(
    button IN_USE && !(oldbutton IN_USE))
            {
                if(
    grabbed[id] == 0)
                {
                    new 
    Float:ent_origin[3]
                    new 
    ent find_ent_in_sphere(-1forigin60.0)
                    while(
    ent && grabbed[id] == 0)
                    {
                        
    classname[0] = '^0'
                        
    entity_get_string(entEV_SZ_classnameclassname31)
                        if(
    equal(classname"player") || equal(classname"grenade") || equal(classname"weaponbox") || equal(classname"armoury_entity") || equal(classname"hostage_entity"))
                        {
                            
    entity_get_vector(entEV_VEC_originent_origin)
                            if(
    ent_origin[2] < forigin[2])
                            {
                                
    grabbed[id] = ent
                                
    if(equal(classname"hostage_entity"))
                                {
                                    
    entity_set_int(apacheIdEV_INT_solid3)
                                }
                            }
                        }
                        
    ent find_ent_in_sphere(entforigin60.0)
                    }
                }
                else
                {
                    
    classname[0] = '^0'
                    
    if(is_valid_ent(grabbed[id])) {
                        
    entity_get_string(grabbed[id], EV_SZ_classnameclassname31)
                        if(!
    equal(classname"player"))
                        {
                            
    entity_set_vector(grabbed[id], EV_VEC_velocityFloat:{0,0,-20})
                        }
                    }
                    
    grabbed[id] = 0
                    entity_set_int
    (apacheIdEV_INT_solid2)
                }
            }
            if(
    button IN_MOVELEFT)
            {
                
    client_cmd(id"+left")
            }
            else if(
    oldbutton IN_MOVELEFT)
            {
                
    client_cmd(id"-left")
            }
            if(
    button IN_MOVERIGHT)
            {
                
    client_cmd(id"+right")
            }
            else if(
    oldbutton IN_MOVERIGHT)
            {
                
    client_cmd(id"-right")
            }
            if(
    apache_beams == 1)
            {
                
    VelocityByAim(id9999velocity)
                
    end_origin[0] = forigin[0] + velocity[0]
                
    end_origin[1] = forigin[1] + velocity[1]
                
    end_origin[2] = forigin[2] + velocity[2]
                
    trace_line(0foriginend_originaim_origin)
                
    message_begin(MSG_ONE_UNRELIABLESVC_TEMPENTITY, {0,0,0}, id)
                
    write_byte(1)
                
    write_short(apacheId)
                
    write_coord(floatround(aim_origin[0]))
                
    write_coord(floatround(aim_origin[1]))
                
    write_coord(floatround(aim_origin[2]))
                
    write_short(laserbeam)
                
    write_byte(1)
                
    write_byte(1)
                
    write_byte(1)
                
    write_byte(8)
                
    write_byte(0)
                
    write_byte(255)
                
    write_byte(0)
                
    write_byte(0)
                
    write_byte(128)
                
    write_byte(0)
                
    message_end()
            }
            if(
    grabbed[id] > && is_valid_ent(grabbed[id]))
            {
                new 
    Float:direction[3], Float:moveto[3], Float:grabbedorigin[3], Float:length
                VelocityByAim
    (id9999velocity)
                
    end_origin[0] = forigin[0] + velocity[0]
                
    end_origin[1] = forigin[1] + velocity[1]
                
    end_origin[2] = forigin[2] + velocity[2]
                
    trace_line(0foriginend_originaim_origin)
                
                
    entity_get_vector(grabbed[id], EV_VEC_origingrabbedorigin)
                
                
    direction[0] = aim_origin[0] - forigin[0]
                
    direction[1] = aim_origin[1] - forigin[1]
                
    direction[2] = aim_origin[2] - forigin[2]
                
                
    length vector_distance(aim_origin,forigin)
                if (!
    lengthlength 1.0
                
                moveto
    [0] = forigin[0] + direction[0] / length
                moveto
    [1] = forigin[1] + direction[1] / length
                classname
    [0] = '^0'
                
    entity_get_string(grabbed[id], EV_SZ_classnameclassname31)
                if(
    equal(classname"player"))
                {
                    
    moveto[2] = (forigin[2] + direction[2] / length) - 45.0
                    velocity
    [0] = (moveto[0] - grabbedorigin[0]) * 5
                    velocity
    [1] = (moveto[1] - grabbedorigin[1]) * 5
                    velocity
    [2] = (moveto[2] - grabbedorigin[2]) * 5
                
    }
                else
                {
                    
    moveto[2] = (forigin[2] + direction[2] / length) - 15.0
                    velocity
    [0] = (moveto[0] - grabbedorigin[0]) * 10
                    velocity
    [1] = (moveto[1] - grabbedorigin[1]) * 10
                    velocity
    [2] = (moveto[2] - grabbedorigin[2]) * 10
                
    }
                
                
    entity_set_vector(grabbed[id], EV_VEC_velocityvelocity)
            }
            
    set_hudmessage(255255255, -2.00.7601.00.010.10.24)
            
    show_hudmessage(id" [APACHE] Speed: %i, Health: %i"apache_speed[id], floatround(entity_get_float(apaches[id], EV_FL_health) - 5000))
        }
        
        return 
    PLUGIN_CONTINUE
    }

    public 
    reset_rocket(id)
    {
        
    wait_rocket[id-TASK_ROCKET] = false
    }

    public 
    reset_bomb(id)
    {
        
    wait_bomb[id-TASK_BOMB] = false
    }

    public 
    reset_stealth(ids[])
    {
        
    wait_stealth[ids[0]] = false
    }

    public 
    pfn_touch(entity1entity2)
    {
        if(
    g_apacheactive == 0)
        {
            return 
    PLUGIN_CONTINUE
        
    }
        
        if(
    entity1 && is_valid_ent(entity1))
        {
            new 
    classname[32]
            
    entity_get_string(entity1EV_SZ_classnameclassname31)
            new 
    classname2[32]
            if(
    entity2 && is_valid_ent(entity2))
            {
                
    entity_get_string(entity2EV_SZ_classnameclassname231)
            }
            
            new 
    attacker entity_get_edict(entity1EV_ENT_owner)
            if((
    equal(classname"apache_rocket") || equal(classname"apache_bomb")) && (entity2 == || equal(classname2"player") || equal(classname2"amx_apache") || equal(classname2"apache_rocket") || equal(classname2"func_breakable") || equal(classname2"func_pushable")))
            {
                if(
    entity2 0)
                {
                    if(
    attacker == entity_get_edict(entity2EV_ENT_owner))
                    {
                        return 
    PLUGIN_CONTINUE
                    
    }
                }
                
                new 
    Float:explosion[3]
                
    entity_get_vector(entity1EV_VEC_originexplosion)
                
                if(!
    stealth[attacker])
                {
                    
    /*radius_damage(explosion,200,300)*/
                    
    HL_RadiusDamage(explosion,0,200.0,300.0)
                }
                else
                {
                    
    /*radius_damage(explosion,120,300)*/
                    
    HL_RadiusDamage(explosion,0,120.0,300.0)
                }
                
                
    message_begin(MSG_BROADCASTSVC_TEMPENTITY)
                
    write_byte(3)
                
    write_coord(floatround(explosion[0]))
                
    write_coord(floatround(explosion[1]))
                
    write_coord(floatround(explosion[2]))
                
    write_short(boom)
                
    write_byte(50)
                
    write_byte(15)
                
    write_byte(0)
                
    message_end()
                
                
    emit_sound(entity1CHAN_WEAPON"vox/_period.wav"0.8ATTN_NORM0PITCH_NORM)
                
    //emit_sound(entity1, CHAN_VOICE, "vox/_period.wav", 0.8, ATTN_NORM, 0, PITCH_NORM)
                
                
    remove_entity(entity1)
            }
            if(
    equal(classname"apache_bullet"))
            {
                if(
    equal(classname2"player") || equal(classname2"amx_apache") || equal(classname2"func_breakable") || equal(classname2"func_pushable"))
                {
                    if(
    entity2 0)
                    {
                        if(
    attacker == entity_get_edict(entity2EV_ENT_owner))
                        {
                            return 
    PLUGIN_CONTINUE
                        
    }
                        if(
    equal(classname2"func_breakable") || equal(classname2"func_pushable"))
                        {
                            
    force_use(entity2attacker)
                        }
                        else
                        {
                            new 
    Float:origin[3]
                            
    entity_get_vector(entity2EV_VEC_originorigin)
                            
    fakedamage(entity2"apache_gun"get_pcvar_float(bulletdmg), DMG_BULLET)
                        }
                    }
                }
                
                
    remove_entity(entity1)
            }
            if(
    equal(classname"amx_apache"))
            {
                if(
    equal(classname2"player") || equal(classname2"amx_apache") || equal(classname2"func_breakable") || equal(classname2"func_pushable"))
                {
                    
                    if(
    equal(classname2"player") || equal(classname2"amx_apache"))
                    {
                        new 
    friendlyfire get_pcvar_num(ff);
                        if((
    friendlyfire == || friendlyfire == && get_user_team(attacker) != get_user_team(entity2)))
                        {
                            new 
    Float:origin[3]
                            
    entity_get_vector(entity2EV_VEC_originorigin)
                            if(
    equal(classname2"player") && get_user_health(entity2) == 1)
                            {
                                
    client_print(entity2print_center"NEVER STAND IN THE ROTORS AGAIN!")
                            }
                            
    fakedamage(entity2"apache"1.0DMG_SLASH)
                        }
                    }
                    else if(
    equal(classname2"func_breakable") || equal(classname2"func_pushable"))
                    {
                        
    force_use(entity2attacker)
                    }
                }
            }
        }
        
        return 
    PLUGIN_CONTINUE
    }

    public 
    emitsound(entity, const sample[])
    {
        if(
    equal(sample"common/wpn_denyselect.wav"))
        {
            return 
    FMRES_SUPERCEDE
        
    }
        return 
    FMRES_IGNORED
    }

    public 
    plugin_precache()
    {
        
    laserbeam precache_model("sprites/laserbeam.spr")
        
    smoke precache_model("sprites/smoke.spr")
        
    boom precache_model("sprites/zerogxplode.spr")
        
        
    precache_model("models/rc_apache_final.mdl")
        
    precache_model("models/rpgrocket.mdl")
        
    precache_model("models/shell.mdl")
        
        
    precache_sound("vox/_period.wav")
        
    precache_sound("weapons/rocketfire1.wav")
        
    precache_sound("weapons/rocket1.wav")
        
    precache_sound("weapons/m249-1.wav")
        
    precache_sound("apache/ap_rotor2.wav")
    }

    public 
    get_num_ents()
    {
        new 
    icount;
        for(
    i=1;i<maxentities;i++)
        {
            if(
    is_valid_ent(i))
                
    count++
        }
        return 
    count;
    }

    ///////////////// THANKS AVALANCHE!! ///////////////////

    public HL_RadiusDamageFloat:vecSrc[3], /*pevAttacker,*/ pevInflictorFloat:flDamageFloat:flRadius/*, iClassIgnore, bitsDamageType*/ )
    {
        new 
    pEntity;
        new 
    tr;
        new 
    Float:flAdjustedDamageFloat:falloff;
        new 
    Float:vecSpot[3];
        
        
    // NEW
        
    new Float:vecAbsMin[3], Float:vecAbsMax[3], Float:vecAdjust[3],
        
    Float:vecEndPos[3], Float:flFractioniWaterLeveli;
        
        if( 
    flRadius )
            
    falloff flDamage flRadius;
        else
            
    falloff 1.0;
        
        new 
    bInWater = (engfuncEngFunc_PointContentsvecSrc ) == CONTENTS_WATER);
        
        
    vecSrc[2] += 1;// in case grenade is lying on the ground
        
        // iterate on all entities in the vicinity.
        
    while ((pEntity engfuncEngFunc_FindEntityInSpherepEntityvecSrcflRadius )) != 0)
        {
            if ( 
    pevpEntitypev_takedamage ) != DAMAGE_NO )
            {
                
    iWaterLevel pevpEntitypev_waterlevel ); // NEW
                
                // blasts don't travel into or out of water
                
    if (bInWater && iWaterLevel == 0)
                    continue;
                if (!
    bInWater && iWaterLevel == 3)
                    continue;
                
                
    // OLD: vecSpot = pEntity->BodyTarget( vecSrc ); -- NEW:
                
    pevpEntitypev_absminvecAbsMin );
                
    pevpEntitypev_absmaxvecAbsMax );
                for( 
    03i++ ) vecSpot[i] = ( vecAbsMin[i] + vecAbsMax[i] ) * 0.5;
                
                
    engfuncEngFunc_TraceLinevecSrcvecSpotDONT_IGNORE_MONSTERSpevInflictortr );
                
                
    get_tr2trTR_flFractionflFraction ); // NEW
                
    get_tr2trTR_vecEndPosvecEndPos ); // NEW
                
                
    if ( flFraction == 1.0 || get_tr2trTR_pHit ) == pEntity )
                    {
    // the explosion can 'see' this entity, so hurt them!
                
    if ( get_tr2trTraceResult:TR_StartSolid ) )
                {
                    
    // if we're stuck inside them, fixup the position and distance
                    
    vecEndPos =  vecSrc;
                    
    flFraction 0.0;
                }
                
                
    // decrease damage for an ent that's farther from the bomb.
                
                // OLD: flAdjustedDamage = ( vecSrc - tr.vecEndPos ).Length() * falloff; -- NEW:
                
    for( 03i++ ) vecAdjust[i] = vecSrc[i] - vecEndPos[i];
                
    flAdjustedDamage floatsqroot(vecAdjust[0]*vecAdjust[0] + vecAdjust[1]*vecAdjust[1] + vecAdjust[2]*vecAdjust[2]) * falloff;
                
                
    flAdjustedDamage flDamage flAdjustedDamage;
                
                if ( 
    flAdjustedDamage 0.0 )
                {
                    
    flAdjustedDamage 0.0;
                }
                
                
    // ALERT( at_console, "hit %s\n", STRING( pEntity->pev->classname ) );
                
    take_damagepEntitypevInflictorflAdjustedDamage ); // NEW
            
    }
        }
    }
    }

    public 
    take_damagevictimattackerFloat:damage )
    {
        
    // "victim" should take "damage" damage from "attacker"
        
    fakedamage(victim,"apache",damage,0);
    }
     
  7. My Own Way

    My Own Way S.V.E.N Commander Lão Làng GVN

    Tham gia ngày:
    30/7/09
    Bài viết:
    12,230
    Nơi ở:
    Hải Phòng
    Hmm.. Cvar thấy không vấn đề gì.. Dùng bản cs patch bao nhiêu thế?
     
  8. So_No_Mi

    So_No_Mi Follow_Your_Heart

    Tham gia ngày:
    24/2/04
    Bài viết:
    12,888
    Nơi ở:
    NaGaSaKi citY
    Ạnh dùng class Ghost, Predator tàng hình mà còn bị tụi podbot nó headshot, không thể đỡ nổi :|
     
  9. TaskForce411

    TaskForce411 Legend of Zelda

    Tham gia ngày:
    10/11/10
    Bài viết:
    948
    Nơi ở:
    S.V.E.N I.O.A.F
    Rất hài hước, mình dùng CSO NST =))
    Giúp đỡ tôi với nhé :D
     
  10. Orpheus

    Orpheus ♥ ♡ ToMaTo TasTe Kiss ♡ ♥ Moderator

    Tham gia ngày:
    30/3/09
    Bài viết:
    4,066
    Nơi ở:
    Kingdom Hearts
    :bz cho vài cái screenshot với clip đề mô đề Uno :))
     
  11. My Own Way

    My Own Way S.V.E.N Commander Lão Làng GVN

    Tham gia ngày:
    30/7/09
    Bài viết:
    12,230
    Nơi ở:
    Hải Phòng
    @sonomi: Khi mà anh đứng yên tàng hình thì nó sẽ không tự nhiên bắn đâu, trừ khi mình không invisible hoàn toàn hoặc là chạy...
    @task: Khuyến cáo là có vài plugin tốt nhất nên dùng với CS thường.. Nhưng chiều tôi sẽ xem..
     
  12. TaskForce411

    TaskForce411 Legend of Zelda

    Tham gia ngày:
    10/11/10
    Bài viết:
    948
    Nơi ở:
    S.V.E.N I.O.A.F
    @Chief: Cảm ơn cậu! :*
    30 chả giò chiên!
     
  13. So_No_Mi

    So_No_Mi Follow_Your_Heart

    Tham gia ngày:
    24/2/04
    Bài viết:
    12,888
    Nơi ở:
    NaGaSaKi citY
    Sao cái Pipe Bom add vào rồi, lúc quăng thì nó không nổ nhỉ, cả trái Smoke + HE nữa, ai biết tại sao không :-?
     
  14. kakaan96

    kakaan96 Dragon Quest

    Tham gia ngày:
    29/1/10
    Bài viết:
    1,422
    Pipe Bomb server Dias có đấy
    bác hỏi dias xem :D
     
  15. xichhoang

    xichhoang Mario & Luigi

    Tham gia ngày:
    2/8/07
    Bài viết:
    885
    đã làm mọi cách convert mọi kiểu mà ko add blood vào file decal.wad bó tay bắn ra vẫn còn cái nền màu trắng bạn nào bik hay đã thử wa HD cho mình đi ngồi mò hết nữa ngày rồi
     
  16. My Own Way

    My Own Way S.V.E.N Commander Lão Làng GVN

    Tham gia ngày:
    30/7/09
    Bài viết:
    12,230
    Nơi ở:
    Hải Phòng
    Không thuộc lĩnh vực trong thread này, sang thread spr...
     
  17. dias

    dias Mega Man

    Tham gia ngày:
    17/1/10
    Bài viết:
    3,226
    Nơi ở:
    SEOUL
    Ai có cách nào khóa nút Drop ko nhể ?.
    Chưa khóa nó bao giờ. Chỉ khóa dc nút có IN_ thoai..

    @SO_NO_MI:
    - Xem mấy cái mà nó Required trong Theard. Tui cài bình thường,... nó vẫn nổ. sợ ném với bot nên nó ko nổ :))
     
  18. My Own Way

    My Own Way S.V.E.N Commander Lão Làng GVN

    Tham gia ngày:
    30/7/09
    Bài viết:
    12,230
    Nơi ở:
    Hải Phòng
    Chơi ZP hay 1 số plugin rất ghét dùng Zbot.. Vì nó quá illegal với 1 số plugin ( do nó là bot của CSCZ và CSS --> hack về cho CS1.6 :-L ).. Tốt nhất cứ podbot mà dùng,
     
  19. So_No_Mi

    So_No_Mi Follow_Your_Heart

    Tham gia ngày:
    24/2/04
    Bài viết:
    12,888
    Nơi ở:
    NaGaSaKi citY
    Thì đang test với podbot mà :|
    Lúc chưa cài Pipe Bom thì HE ném nổ được, cài xong thì cả HE lẫn Pipe Bom đều không nổ? Xung đột gì đây vì cài đúng hết rồi :|
     
  20. dias

    dias Mega Man

    Tham gia ngày:
    17/1/10
    Bài viết:
    3,226
    Nơi ở:
    SEOUL
    Tui sắp làm lại sv Ks. nên để tui cài lại.... Rồi chỉ cho...
     
Trạng thái chủ đề:
Không mở trả lời sau này.

Chia sẻ trang này