teobrvt1995
T.E.T.Я.I.S
- 19/9/10
- 691
- 2
ko sao hết 
viết dc vậy là good rùi

viết dc vậy là good rùi

Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.


Sao code từng khẩu 1 thế, thử rút ngắn lại xem nào .Em viết plugin này để dùng cho mod của em. Té ra cũng hoạt động khá tốt. Em chỉ upload plugin thôi. Còn model mọi người phải tự lo
Nguyên lý hoạt động là thế này: chuyển qua lại giữa model thường và model sight. Nghe khá đơn giản. Và vì mọi người đều biết ỉon sight là cái gì nên chỉ post 1 hình gọi là demo.
![]()
Tiện đây cũng hỏi luôn mọi người, nhất là ai rành AMX coding về một số giới hạn em gặp phải khi viết plugin này.
Thứ nhất, có cách nào để xác định khi player đổi weapon không, để em toggle cái crosshair cho đúng?
Thứ hai, em chưa biết làm sao để làm iron sight cho các weapon có attack2 mặc định, và chuyển attack2 mặc định sang một key khác, chẳng hạn M4A1, right click là iron sight, T là silencer. Ai có cao kiến gì xin chỉ giáo.
Trừ hai giới hạn trên ra, những thứ còn lại đã tạm ổn.
Cảm ơn mọi người nhiều.
Đây là toàn bộ code cho ai muốn giúp thì tham khảo:
PHP:#include <amxmodx> #include <fakemeta> #include <hamsandwich> #include <engine> new g_cvarEnabled; new g_msgCrosshair; new g_insight; new g_HideWeapon; new crosshair[33]; public plugin_init() { RegisterHam ( Ham_Weapon_SecondaryAttack, "weapon_mp5navy", "iron_sight_mp5", 1 ) RegisterHam ( Ham_Weapon_SecondaryAttack, "weapon_ak47", "iron_sight_ak47", 1 ) RegisterHam ( Ham_Weapon_SecondaryAttack, "weapon_deagle", "iron_sight_deagle", 1 ) RegisterHam ( Ham_Weapon_SecondaryAttack, "weapon_galil", "iron_sight_deagle", 1 ) RegisterHam ( Ham_Weapon_SecondaryAttack, "weapon_m249", "iron_sight_m249", 1 ) RegisterHam ( Ham_Weapon_SecondaryAttack, "weapon_p90", "iron_sight_m249", 1 ) RegisterHam ( Ham_Weapon_SecondaryAttack, "weapon_mac10", "iron_sight_mac10", 1 ) RegisterHam ( Ham_Weapon_SecondaryAttack, "weapon_p228", "iron_sight_p228", 1 ) RegisterHam ( Ham_Weapon_SecondaryAttack, "weapon_fiveseven", "iron_sight_fiveseven", 1 ) RegisterHam ( Ham_Weapon_SecondaryAttack, "weapon_m3", "iron_sight_m3", 1 ) RegisterHam ( Ham_Weapon_SecondaryAttack, "weapon_xm1014", "iron_sight_m4", 1 ) RegisterHam ( Ham_Weapon_SecondaryAttack, "weapon_tmp", "iron_sight_tmp", 1 ) register_plugin("EIS","1.3","TSA"); g_HideWeapon = get_user_msgid("HideWeapon") register_event("ResetHUD","event_resethud","b"); register_event("CurWeapon","event_curweapon","b","1=1"); register_event("DeathMsg","event_deathmsg","a"); g_cvarEnabled = register_cvar("sc_enabled","1",FCVAR_SERVER); } //precache the models public plugin_precache() { precache_model("models/v_mp5_sight.mdl") precache_model("models/v_ak47_sight.mdl") precache_model("models/v_deagle_sight.mdl") precache_model("models/v_galil_sight.mdl") precache_model("models/v_m249_sight.mdl") precache_model("models/v_p90_sight.mdl") precache_model("models/v_p228_sight.mdl") precache_model("models/v_mac10_sight.mdl") precache_model("models/v_fiveseven_sight.mdl") precache_model("models/v_m3_sight.mdl") precache_model("models/v_xm1014_sight.mdl") precache_model("models/v_tmp_sight.mdl") } //events public event_resethud(id) { // spawn with crosshair if(is_user_alive(id)) draw_crosshair(id); } // the best part of the code public client_PreThink(id) { //using a mp5 new clip, ammo, weapon = get_user_weapon(id, clip, ammo); new button = entity_get_int(id,EV_INT_button); if(weapon == CSW_MP5NAVY) { // is user pressing right click? if(button & IN_ATTACK2) { // did he just press it? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_ATTACK2)) { if(g_insight == false) { iron_sight_mp5(id,0); } else { unsight_mp5(id,1); } } // disable regular zoom entity_set_int(id,EV_INT_button,button & ~IN_ATTACK2); } if(button & IN_RELOAD) { // did he just press reload? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_RELOAD)) unsight_mp5(id, 1) } } //using an ak47 if(weapon == CSW_AK47) { // is user pressing right click? if(button & IN_ATTACK2) { // did he just press it? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_ATTACK2)) { if(g_insight == false) { iron_sight_ak47(id,0); } else { unsight_ak47(id,1); } } // disable regular zoom entity_set_int(id,EV_INT_button,button & ~IN_ATTACK2); } if(button & IN_RELOAD) { // did he just press reload? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_RELOAD)) unsight_ak47(id, 1) } } //using a deagle if(weapon == CSW_DEAGLE) { // is user pressing right click? if(button & IN_ATTACK2) { // did he just press it? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_ATTACK2)) { if(g_insight == false) { iron_sight_deagle(id,0); } else { unsight_deagle(id,1); } } // disable regular zoom entity_set_int(id,EV_INT_button,button & ~IN_ATTACK2); } if(button & IN_RELOAD) { // did he just press reload? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_RELOAD)) unsight_deagle(id, 1) } } //using a galil if(weapon == CSW_GALIL) { // is user pressing right click? if(button & IN_ATTACK2) { // did he just press it? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_ATTACK2)) { if(g_insight == false) { iron_sight_galil(id,0); } else { unsight_galil(id,1); } } // disable regular zoom entity_set_int(id,EV_INT_button,button & ~IN_ATTACK2); } if(button & IN_RELOAD) { // did he just press reload? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_RELOAD)) unsight_galil(id, 1) } } //using a m249 if(weapon == CSW_M249) { // is user pressing right click? if(button & IN_ATTACK2) { // did he just press it? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_ATTACK2)) { if(g_insight == false) { iron_sight_m249(id,0); } else { unsight_m249(id,1); } } // disable regular zoom entity_set_int(id,EV_INT_button,button & ~IN_ATTACK2); } if(button & IN_RELOAD) { // did he just press reload? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_RELOAD)) unsight_m249(id, 1) } } //using a p90 if(weapon == CSW_P90) { // is user pressing right click? if(button & IN_ATTACK2) { // did he just press it? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_ATTACK2)) { if(g_insight == false) { iron_sight_p90(id,0); } else { unsight_p90(id,1); } } } if(button & IN_RELOAD) { // did he just press reload? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_RELOAD)) unsight_p90(id, 1) } } //using a mac10 if(weapon == CSW_MAC10) { // is user pressing right click? if(button & IN_ATTACK2) { // did he just press it? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_ATTACK2)) { if(g_insight == false) { iron_sight_mac10(id,0); } else { unsight_mac10(id,1); } } } if(button & IN_RELOAD) { // did he just press reload? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_RELOAD)) unsight_mac10(id, 1) } } //using a p228 if(weapon == CSW_P228) { // is user pressing right click? if(button & IN_ATTACK2) { // did he just press it? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_ATTACK2)) { if(g_insight == false) { iron_sight_p228(id,0); } else { unsight_p228(id,1); } } } if(button & IN_RELOAD) { // did he just press reload? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_RELOAD)) unsight_p228(id, 1) } } //using a fiveseven if(weapon == CSW_FIVESEVEN) { // is user pressing right click? if(button & IN_ATTACK2) { // did he just press it? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_ATTACK2)) { if(g_insight == false) { iron_sight_fiveseven(id,0); } else { unsight_fiveseven(id,1); } } } if(button & IN_RELOAD) { // did he just press reload? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_RELOAD)) unsight_fiveseven(id, 1) } } //using a m3 if(weapon == CSW_M3) { // is user pressing right click? if(button & IN_ATTACK2) { // did he just press it? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_ATTACK2)) { if(g_insight == false) { iron_sight_m3(id,0); } else { unsight_m3(id,1); } } } if(button & IN_RELOAD) { // did he just press reload? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_RELOAD)) unsight_m3(id, 1) } } //using a m4 if(weapon == CSW_XM1014) { // is user pressing right click? if(button & IN_ATTACK2) { // did he just press it? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_ATTACK2)) { if(g_insight == false) { iron_sight_m4(id,0); } else { unsight_m4(id,1); } } } if(button & IN_RELOAD) { // did he just press reload? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_RELOAD)) unsight_m4(id, 1) } } //using a tmp if(weapon == CSW_TMP) { // is user pressing right click? if(button & IN_ATTACK2) { // did he just press it? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_ATTACK2)) { if(g_insight == false) { iron_sight_tmp(id,0); } else { unsight_tmp(id,1); } } } if(button & IN_RELOAD) { // did he just press reload? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_RELOAD)) unsight_tmp(id, 1) } } } // ironsight and crosshair related public iron_sight_mp5(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_mp5_sight.mdl"); g_insight = true hide_crosshair(id) client_cmd(id,"amx_recoil_mp5navy 0.5") } public unsight_mp5(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_mp5.mdl"); g_insight = false draw_crosshair(id) client_cmd(id,"amx_recoil_mp5navy 0.8") } public iron_sight_ak47(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_ak47_sight.mdl"); g_insight = true hide_crosshair(id) client_cmd(id,"amx_recoil_ak47 0.4") } public unsight_ak47(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_ak47.mdl"); g_insight = false draw_crosshair(id) client_cmd(id,"amx_recoil_ak47 1.0") } public iron_sight_deagle(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_deagle_sight.mdl"); g_insight = true hide_crosshair(id) client_cmd(id,"amx_recoil_deagle 0.72") } public unsight_deagle(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_deagle.mdl"); g_insight = false draw_crosshair(id) client_cmd(id,"amx_recoil_deagle 0.96") } public iron_sight_galil(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_galil_sight.mdl"); g_insight = true hide_crosshair(id) client_cmd(id,"amx_recoil_galil 0.5") } public unsight_galil(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_galil.mdl"); g_insight = false draw_crosshair(id) client_cmd(id,"amx_recoil_galil 0.96") } public iron_sight_m249(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_m249_sight.mdl"); g_insight = true hide_crosshair(id) client_cmd(id,"amx_recoil_m249 0.4") } public unsight_m249(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_m249.mdl"); g_insight = false draw_crosshair(id) client_cmd(id,"amx_recoil_m249 0.96") } public iron_sight_p90(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_p90_sight.mdl"); g_insight = true hide_crosshair(id) client_cmd(id,"amx_recoil_p90 0.4") } public unsight_p90(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_p90.mdl"); g_insight = false draw_crosshair(id) client_cmd(id,"amx_recoil_p90 0.96") } public iron_sight_mac10(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_mac10_sight.mdl"); g_insight = true hide_crosshair(id) client_cmd(id,"amx_recoil_mac10 0.4") } public unsight_mac10(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_mac10.mdl"); g_insight = false draw_crosshair(id) client_cmd(id,"amx_recoil_mac10 0.96") } public iron_sight_p228(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_p228_sight.mdl"); g_insight = true hide_crosshair(id) client_cmd(id,"amx_recoil_p228 0.4") } public unsight_p228(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_p228.mdl"); g_insight = false draw_crosshair(id) client_cmd(id,"amx_recoil_p228 0.96") } public iron_sight_fiveseven(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_fiveseven_sight.mdl"); g_insight = true hide_crosshair(id) client_cmd(id,"amx_recoil_fiveseven 0.4") } public unsight_fiveseven(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_fiveseven.mdl"); g_insight = false draw_crosshair(id) client_cmd(id,"amx_recoil_fiveseven 0.96") } public iron_sight_m3(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_m3_sight.mdl"); g_insight = true hide_crosshair(id) client_cmd(id,"amx_recoil_m3 0.8") } public unsight_m3(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_m3.mdl"); g_insight = false draw_crosshair(id) client_cmd(id,"amx_recoil_m3 0.96") } public iron_sight_m4(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_xm1014_sight.mdl"); g_insight = true hide_crosshair(id) client_cmd(id,"amx_recoil_xm1014 0.7") } public unsight_m4(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_xm1014.mdl"); g_insight = false draw_crosshair(id) client_cmd(id,"amx_recoil_xm1014 0.96") } public iron_sight_tmp(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_tmp_sight.mdl"); g_insight = true hide_crosshair(id) client_cmd(id,"amx_recoil_tmp 0.7") } public unsight_tmp(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_tmp.mdl"); g_insight = false draw_crosshair(id) client_cmd(id,"amx_recoil_tmp 0.96") } public iron_sight_m4a1(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_m4a1_sight.mdl"); g_insight = true hide_crosshair(id) client_cmd(id,"amx_recoil_tmp 0.7") } public unsight_m4a1(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_m4a1.mdl"); g_insight = false draw_crosshair(id) client_cmd(id,"amx_recoil_tmp 0.96") } public draw_crosshair(id) { message_begin(MSG_ONE_UNRELIABLE, g_HideWeapon, _,id) write_byte(0) message_end() } public hide_crosshair(id) { message_begin(MSG_ONE_UNRELIABLE, g_HideWeapon, _,id) write_byte(1<<6) message_end() }

Tớ cũng đang xài cái plugin tương tự như vậy, nhưng lúc chơi hay bị văng ra menu lắm, các pro có biết tại sao ko? console báo lỗi not client gì gì đó ko hiểu...Em viết plugin này để dùng cho mod của em. Té ra cũng hoạt động khá tốt. Em chỉ upload plugin thôi. Còn model mọi người phải tự lo
Nguyên lý hoạt động là thế này: chuyển qua lại giữa model thường và model sight. Nghe khá đơn giản. Và vì mọi người đều biết ỉon sight là cái gì nên chỉ post 1 hình gọi là demo.
![]()
Tiện đây cũng hỏi luôn mọi người, nhất là ai rành AMX coding về một số giới hạn em gặp phải khi viết plugin này.
Thứ nhất, có cách nào để xác định khi player đổi weapon không, để em toggle cái crosshair cho đúng?
Thứ hai, em chưa biết làm sao để làm iron sight cho các weapon có attack2 mặc định, và chuyển attack2 mặc định sang một key khác, chẳng hạn M4A1, right click là iron sight, T là silencer. Ai có cao kiến gì xin chỉ giáo.
Trừ hai giới hạn trên ra, những thứ còn lại đã tạm ổn.
Cảm ơn mọi người nhiều.
Đây là toàn bộ code cho ai muốn giúp thì tham khảo:
PHP:#include <amxmodx> #include <fakemeta> #include <hamsandwich> #include <engine> new g_cvarEnabled; new g_msgCrosshair; new g_insight; new g_HideWeapon; new crosshair[33]; public plugin_init() { RegisterHam ( Ham_Weapon_SecondaryAttack, "weapon_mp5navy", "iron_sight_mp5", 1 ) RegisterHam ( Ham_Weapon_SecondaryAttack, "weapon_ak47", "iron_sight_ak47", 1 ) RegisterHam ( Ham_Weapon_SecondaryAttack, "weapon_deagle", "iron_sight_deagle", 1 ) RegisterHam ( Ham_Weapon_SecondaryAttack, "weapon_galil", "iron_sight_deagle", 1 ) RegisterHam ( Ham_Weapon_SecondaryAttack, "weapon_m249", "iron_sight_m249", 1 ) RegisterHam ( Ham_Weapon_SecondaryAttack, "weapon_p90", "iron_sight_m249", 1 ) RegisterHam ( Ham_Weapon_SecondaryAttack, "weapon_mac10", "iron_sight_mac10", 1 ) RegisterHam ( Ham_Weapon_SecondaryAttack, "weapon_p228", "iron_sight_p228", 1 ) RegisterHam ( Ham_Weapon_SecondaryAttack, "weapon_fiveseven", "iron_sight_fiveseven", 1 ) RegisterHam ( Ham_Weapon_SecondaryAttack, "weapon_m3", "iron_sight_m3", 1 ) RegisterHam ( Ham_Weapon_SecondaryAttack, "weapon_xm1014", "iron_sight_m4", 1 ) RegisterHam ( Ham_Weapon_SecondaryAttack, "weapon_tmp", "iron_sight_tmp", 1 ) register_plugin("EIS","1.3","TSA"); g_HideWeapon = get_user_msgid("HideWeapon") register_event("ResetHUD","event_resethud","b"); register_event("CurWeapon","event_curweapon","b","1=1"); register_event("DeathMsg","event_deathmsg","a"); g_cvarEnabled = register_cvar("sc_enabled","1",FCVAR_SERVER); } //precache the models public plugin_precache() { precache_model("models/v_mp5_sight.mdl") precache_model("models/v_ak47_sight.mdl") precache_model("models/v_deagle_sight.mdl") precache_model("models/v_galil_sight.mdl") precache_model("models/v_m249_sight.mdl") precache_model("models/v_p90_sight.mdl") precache_model("models/v_p228_sight.mdl") precache_model("models/v_mac10_sight.mdl") precache_model("models/v_fiveseven_sight.mdl") precache_model("models/v_m3_sight.mdl") precache_model("models/v_xm1014_sight.mdl") precache_model("models/v_tmp_sight.mdl") } //events public event_resethud(id) { // spawn with crosshair if(is_user_alive(id)) draw_crosshair(id); } // the best part of the code public client_PreThink(id) { //using a mp5 new clip, ammo, weapon = get_user_weapon(id, clip, ammo); new button = entity_get_int(id,EV_INT_button); if(weapon == CSW_MP5NAVY) { // is user pressing right click? if(button & IN_ATTACK2) { // did he just press it? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_ATTACK2)) { if(g_insight == false) { iron_sight_mp5(id,0); } else { unsight_mp5(id,1); } } // disable regular zoom entity_set_int(id,EV_INT_button,button & ~IN_ATTACK2); } if(button & IN_RELOAD) { // did he just press reload? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_RELOAD)) unsight_mp5(id, 1) } } //using an ak47 if(weapon == CSW_AK47) { // is user pressing right click? if(button & IN_ATTACK2) { // did he just press it? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_ATTACK2)) { if(g_insight == false) { iron_sight_ak47(id,0); } else { unsight_ak47(id,1); } } // disable regular zoom entity_set_int(id,EV_INT_button,button & ~IN_ATTACK2); } if(button & IN_RELOAD) { // did he just press reload? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_RELOAD)) unsight_ak47(id, 1) } } //using a deagle if(weapon == CSW_DEAGLE) { // is user pressing right click? if(button & IN_ATTACK2) { // did he just press it? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_ATTACK2)) { if(g_insight == false) { iron_sight_deagle(id,0); } else { unsight_deagle(id,1); } } // disable regular zoom entity_set_int(id,EV_INT_button,button & ~IN_ATTACK2); } if(button & IN_RELOAD) { // did he just press reload? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_RELOAD)) unsight_deagle(id, 1) } } //using a galil if(weapon == CSW_GALIL) { // is user pressing right click? if(button & IN_ATTACK2) { // did he just press it? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_ATTACK2)) { if(g_insight == false) { iron_sight_galil(id,0); } else { unsight_galil(id,1); } } // disable regular zoom entity_set_int(id,EV_INT_button,button & ~IN_ATTACK2); } if(button & IN_RELOAD) { // did he just press reload? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_RELOAD)) unsight_galil(id, 1) } } //using a m249 if(weapon == CSW_M249) { // is user pressing right click? if(button & IN_ATTACK2) { // did he just press it? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_ATTACK2)) { if(g_insight == false) { iron_sight_m249(id,0); } else { unsight_m249(id,1); } } // disable regular zoom entity_set_int(id,EV_INT_button,button & ~IN_ATTACK2); } if(button & IN_RELOAD) { // did he just press reload? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_RELOAD)) unsight_m249(id, 1) } } //using a p90 if(weapon == CSW_P90) { // is user pressing right click? if(button & IN_ATTACK2) { // did he just press it? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_ATTACK2)) { if(g_insight == false) { iron_sight_p90(id,0); } else { unsight_p90(id,1); } } } if(button & IN_RELOAD) { // did he just press reload? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_RELOAD)) unsight_p90(id, 1) } } //using a mac10 if(weapon == CSW_MAC10) { // is user pressing right click? if(button & IN_ATTACK2) { // did he just press it? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_ATTACK2)) { if(g_insight == false) { iron_sight_mac10(id,0); } else { unsight_mac10(id,1); } } } if(button & IN_RELOAD) { // did he just press reload? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_RELOAD)) unsight_mac10(id, 1) } } //using a p228 if(weapon == CSW_P228) { // is user pressing right click? if(button & IN_ATTACK2) { // did he just press it? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_ATTACK2)) { if(g_insight == false) { iron_sight_p228(id,0); } else { unsight_p228(id,1); } } } if(button & IN_RELOAD) { // did he just press reload? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_RELOAD)) unsight_p228(id, 1) } } //using a fiveseven if(weapon == CSW_FIVESEVEN) { // is user pressing right click? if(button & IN_ATTACK2) { // did he just press it? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_ATTACK2)) { if(g_insight == false) { iron_sight_fiveseven(id,0); } else { unsight_fiveseven(id,1); } } } if(button & IN_RELOAD) { // did he just press reload? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_RELOAD)) unsight_fiveseven(id, 1) } } //using a m3 if(weapon == CSW_M3) { // is user pressing right click? if(button & IN_ATTACK2) { // did he just press it? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_ATTACK2)) { if(g_insight == false) { iron_sight_m3(id,0); } else { unsight_m3(id,1); } } } if(button & IN_RELOAD) { // did he just press reload? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_RELOAD)) unsight_m3(id, 1) } } //using a m4 if(weapon == CSW_XM1014) { // is user pressing right click? if(button & IN_ATTACK2) { // did he just press it? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_ATTACK2)) { if(g_insight == false) { iron_sight_m4(id,0); } else { unsight_m4(id,1); } } } if(button & IN_RELOAD) { // did he just press reload? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_RELOAD)) unsight_m4(id, 1) } } //using a tmp if(weapon == CSW_TMP) { // is user pressing right click? if(button & IN_ATTACK2) { // did he just press it? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_ATTACK2)) { if(g_insight == false) { iron_sight_tmp(id,0); } else { unsight_tmp(id,1); } } } if(button & IN_RELOAD) { // did he just press reload? if(!(entity_get_int(id,EV_INT_oldbuttons) & IN_RELOAD)) unsight_tmp(id, 1) } } } // ironsight and crosshair related public iron_sight_mp5(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_mp5_sight.mdl"); g_insight = true hide_crosshair(id) client_cmd(id,"amx_recoil_mp5navy 0.5") } public unsight_mp5(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_mp5.mdl"); g_insight = false draw_crosshair(id) client_cmd(id,"amx_recoil_mp5navy 0.8") } public iron_sight_ak47(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_ak47_sight.mdl"); g_insight = true hide_crosshair(id) client_cmd(id,"amx_recoil_ak47 0.4") } public unsight_ak47(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_ak47.mdl"); g_insight = false draw_crosshair(id) client_cmd(id,"amx_recoil_ak47 1.0") } public iron_sight_deagle(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_deagle_sight.mdl"); g_insight = true hide_crosshair(id) client_cmd(id,"amx_recoil_deagle 0.72") } public unsight_deagle(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_deagle.mdl"); g_insight = false draw_crosshair(id) client_cmd(id,"amx_recoil_deagle 0.96") } public iron_sight_galil(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_galil_sight.mdl"); g_insight = true hide_crosshair(id) client_cmd(id,"amx_recoil_galil 0.5") } public unsight_galil(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_galil.mdl"); g_insight = false draw_crosshair(id) client_cmd(id,"amx_recoil_galil 0.96") } public iron_sight_m249(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_m249_sight.mdl"); g_insight = true hide_crosshair(id) client_cmd(id,"amx_recoil_m249 0.4") } public unsight_m249(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_m249.mdl"); g_insight = false draw_crosshair(id) client_cmd(id,"amx_recoil_m249 0.96") } public iron_sight_p90(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_p90_sight.mdl"); g_insight = true hide_crosshair(id) client_cmd(id,"amx_recoil_p90 0.4") } public unsight_p90(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_p90.mdl"); g_insight = false draw_crosshair(id) client_cmd(id,"amx_recoil_p90 0.96") } public iron_sight_mac10(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_mac10_sight.mdl"); g_insight = true hide_crosshair(id) client_cmd(id,"amx_recoil_mac10 0.4") } public unsight_mac10(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_mac10.mdl"); g_insight = false draw_crosshair(id) client_cmd(id,"amx_recoil_mac10 0.96") } public iron_sight_p228(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_p228_sight.mdl"); g_insight = true hide_crosshair(id) client_cmd(id,"amx_recoil_p228 0.4") } public unsight_p228(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_p228.mdl"); g_insight = false draw_crosshair(id) client_cmd(id,"amx_recoil_p228 0.96") } public iron_sight_fiveseven(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_fiveseven_sight.mdl"); g_insight = true hide_crosshair(id) client_cmd(id,"amx_recoil_fiveseven 0.4") } public unsight_fiveseven(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_fiveseven.mdl"); g_insight = false draw_crosshair(id) client_cmd(id,"amx_recoil_fiveseven 0.96") } public iron_sight_m3(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_m3_sight.mdl"); g_insight = true hide_crosshair(id) client_cmd(id,"amx_recoil_m3 0.8") } public unsight_m3(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_m3.mdl"); g_insight = false draw_crosshair(id) client_cmd(id,"amx_recoil_m3 0.96") } public iron_sight_m4(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_xm1014_sight.mdl"); g_insight = true hide_crosshair(id) client_cmd(id,"amx_recoil_xm1014 0.7") } public unsight_m4(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_xm1014.mdl"); g_insight = false draw_crosshair(id) client_cmd(id,"amx_recoil_xm1014 0.96") } public iron_sight_tmp(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_tmp_sight.mdl"); g_insight = true hide_crosshair(id) client_cmd(id,"amx_recoil_tmp 0.7") } public unsight_tmp(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_tmp.mdl"); g_insight = false draw_crosshair(id) client_cmd(id,"amx_recoil_tmp 0.96") } public iron_sight_m4a1(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_m4a1_sight.mdl"); g_insight = true hide_crosshair(id) client_cmd(id,"amx_recoil_tmp 0.7") } public unsight_m4a1(id,enabled) { entity_set_string(id,EV_SZ_viewmodel, "models/v_m4a1.mdl"); g_insight = false draw_crosshair(id) client_cmd(id,"amx_recoil_tmp 0.96") } public draw_crosshair(id) { message_begin(MSG_ONE_UNRELIABLE, g_HideWeapon, _,id) write_byte(0) message_end() } public hide_crosshair(id) { message_begin(MSG_ONE_UNRELIABLE, g_HideWeapon, _,id) write_byte(1<<6) message_end() }
Hèn gì bên VNZ nghe loáng thoáng "quay clip plugin của VN-Zombie" gì đóplugin của TSA đc chỉnh sửa 1 chút và dùng cho CW2 đó
@All : AI có plugin cấm chuyển sag dao ko

), trong team của em đã có lập trình viên C++ và modeller chuyên nghiệp, bản thân em cũng đang học lập trình C++ và HL2 modding nên plugin này không còn cần thiết nữa. Ai thích modify hay re-distribute thì cứ tự nhiên 




Kệ Gmod@TSA : source engine hình như có gmod rồi, iron sight xog run đủ hết![]()


thấy dc 41% rồiKệ Gmod
Em sẽ mod với Source Engine 2009, chính xác là mod CS:Source, có iron sight, sprint đủ cả, với cảm giác bắn của CSS, và quan trọng nhất là sẽ chia class ra chứ không phải chọn class nào cũng được![]()


LIKE!!!!!!!!!!!(I JUST WANT TO DEVOTE SOMETHING FOR THE CS COMMUNITY, NOT EARNING MONEY, AND I DON'T HAVE MONEY TO PAY FOR YOUR HELP. SORRY TO SAY THAT)
Striker_All phải ko? Mong cậu sẽ sớm hoàn thành xong bản mod đó! Nhưng tớ thấy Gmod cũng nhiều plugin hay lắm đó, còn bản của cậu khác như thế nào?Kệ Gmod
Em sẽ mod với Source Engine 2009, chính xác là mod CS:Source, có iron sight, sprint đủ cả, với cảm giác bắn của CSS, và quan trọng nhất là sẽ chia class ra chứ không phải chọn class nào cũng được![]()
Mod kiểu này mới thíchHèn gì bên VNZ nghe loáng thoáng "quay clip plugin của VN-Zombie" gì đó
Mà thôi, giờ em đã chuyển Advanced Assault qua Source Engine 2009 ( muốn biết Advanced Assault là cái gì cứ click vào chữ kí), trong team của em đã có lập trình viên C++ và modeller chuyên nghiệp, bản thân em cũng đang học lập trình C++ và HL2 modding nên plugin này không còn cần thiết nữa. Ai thích modify hay re-distribute thì cứ tự nhiên
![]()

Chắc ko đó, trên thế giới nhiều người giỏi lập trình nhưng chưa chắc đã mod đc css đâu, huống chi cậu mới chỉ là beginerKệ Gmod
Em sẽ mod với Source Engine 2009, chính xác là mod CS:Source, có iron sight, sprint đủ cả, với cảm giác bắn của CSS, và quan trọng nhất là sẽ chia class ra chứ không phải chọn class nào cũng được![]()
nhóc đấy bên dân modeller màChắc ko đó, trên thế giới nhiều người giỏi lập trình nhưng chưa chắc đã mod đc css đâu, huống chi cậu mới chỉ là beginer
coder chính là người khácThế còn spr vs UInhóc đấy bên dân modeller màcoder chính là người khác



spr và ui đơn giảnThế còn spr vs UI
NẾu nói về mod chỉ riêng skin cho CSS thì cũng hơi bị nhọc đó, khai thác đủ thứ, chứ chưa nói đến mod gameplay and mode <= Cái này chắc chả có hy vọng gì
P/s: Ước gì có ai đó đứng dậy mod game css nhỉ, đem zombie3 từ CSONST về CSS nhỉ. Ai mod đc cho cái thẻ đt 20k![]()
chỉ là file vtf thôi, chủ yếu vẫn là coder
nếu thế thì convert qua HLSDK --> làm lại CS thôi
Đúng vậy, cho nên em mới chuyển mod qua làm bằng Source SDK.LOL.... Lại có người muốn modify CSS như kiểu hay làm với CS1.6 á... Đến bây giờ cái nguồn Source Engine còn khó khai thác, plugin của nó cũng ít. Nếu mà tính như thế thì học luôn SDK Source rồi make 1 mod mới luôn cho còn gì nữa...


