- 1/5/11
- 2,535
- 14,359
Bỏ cái đúng đi chỉ vì nghĩ nó là sai...
if (!g_m_canclick[id] && !g_m_ready[id] && !g_m_shoot[id] && szClip)
{
buttons &= ~IN_ATTACK...
set_uc(uc_handle, UC_Buttons, buttons)
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.
Bỏ cái đúng đi chỉ vì nghĩ nó là sai...
if (!g_m_canclick[id] && !g_m_ready[id] && !g_m_shoot[id] && szClip)
{
buttons &= ~IN_ATTACK...
set_uc(uc_handle, UC_Buttons, buttons)
new bagID[980],len=100 , LINE = 1
read_file("addons/amxmodx/configs/BDD_GamePlay/GameBag.ini", LINE, bagID,charsmax(bagID),len)
client_print(id,print_chat,"Lenh la: %s",bagID)
Các bác xem dùm em đoạn code này,,.. rõ ràng đúng mà ko đọc được
PHP:new bagID[980],len=100 , LINE = 1 read_file("addons/amxmodx/configs/BDD_GamePlay/GameBag.ini", LINE, bagID,charsmax(bagID),len) client_print(id,print_chat,"Lenh la: %s",bagID)
Trong cái native này thì số dòng bắt đầu từ 0, vậy nên muốn đọc dòng 1 phải sửa như thế này:Các bác xem dùm em đoạn code này,,.. rõ ràng đúng mà ko đọc được
PHP:new bagID[980],len=100 , LINE = 1 read_file("addons/amxmodx/configs/BDD_GamePlay/GameBag.ini", LINE, bagID,charsmax(bagID),len) client_print(id,print_chat,"Lenh la: %s",bagID)
new bagID[980],len=100 , LINE = 0
read_file("addons/amxmodx/configs/BDD_GamePlay/GameBag.ini", LINE, bagID,charsmax(bagID),len)
client_print(id,print_chat,"Lenh la: %s",bagID)

public event_DeathMsg()
{
for (new w = 1;w<33;w++)
{
if (cs_get_user_team(w) == CS_TEAM_T) frags_T += get_user_frags(w)
else frags_CT += get_user_frags(w)
set_hudmessage(255,255,255,-1.0,0.01, 0, 6.0, 2.0, 0.0, 0.0, -1)
ShowSyncHudMsg(w, g_FRAGS, "[TER]%d | [CT]%d", frags_T,frags_CT )
}
}
@Kungfulon:
- Ko giúp ta à
@buiducduy:
- Để bị giết nhiều là âm điểm đấy![]()

#include <amxmodx>
#include <cstrike>
#define PLUGIN "Dias"
#define VERSION "1.0"
#define AUTHOR "author"
new g_t, g_ct
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("HTLV", "event_newround", "a", "1=0", "2=0")
register_event("DeathMsg", "event_death", "a")
}
public client_putinserver(id)
{
set_task(0.1, "show_hud", id, _, _, "b")
}
public event_newround()
{
g_t = g_ct = 0
}
public show_hud(id)
{
if(is_user_connected(id))
{
set_hudmessage(255, 255, 255, -1.0, 0.0, 0, 2.0, 2.0)
show_hudmessage(id, "[T] ---- [CT]^n%i ---- %i", g_t, g_ct)
} else {
remove_task(id)
}
}
public event_death()
{
new attacker = read_data(1)
if(cs_get_user_team(attacker) == CS_TEAM_T)
{
g_t++
} else if(cs_get_user_team(attacker) == CS_TEAM_CT) {
g_ct++
}
}
@buiduchuy:
- Dễ lắm, vì cái này là nó cộng 1 lần rồi, khi tiếp nó sẽ cộng lần nữa nên suy ra nó bị gấp đôi hiểu ko ?
VD: thằng A nó kill 5, B nó ko kill. Thì nó sẽ cộng 5 vào. Sau khi thằng B kill dc 3 nữa thì nó sẽ cộng 3 vào. Nhưng lúc này không có điều kiện gì cả nó lại cộng tiếp thằng A mặc dù thằng A ko kill ai hết mà là thằng B
đây là code hoàn chỉnh đếm số kill
PHP:#include <amxmodx> #include <cstrike> #define PLUGIN "Dias" #define VERSION "1.0" #define AUTHOR "author" new g_t, g_ct public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_event("HTLV", "event_newround", "a", "1=0", "2=0") register_event("DeathMsg", "event_death", "a") } public client_putinserver(id) { set_task(0.1, "show_hud", id, _, _, "b") } public event_newround() { g_t = g_ct = 0 } public show_hud(id) { if(is_user_connected(id)) { set_hudmessage(255, 255, 255, -1.0, 0.0, 0, 2.0, 2.0) show_hudmessage(id, "[T] ---- [CT]^n%i ---- %i", g_t, g_ct) } else { remove_task(id) } } public event_death() { new attacker = read_data(1) if(cs_get_user_team(attacker) == CS_TEAM_T) { g_t++ } else if(cs_get_user_team(attacker) == CS_TEAM_CT) { g_ct++ } }
public event_newround()
{
g_t = g_ct = 0 ; cứ ván mới là mất hết kill à?
}
public event_death()
{
new attacker = read_data(1) ; data 1 là gì anh?
if(cs_get_user_team(attacker) == CS_TEAM_T)
{
g_t++
} else if(cs_get_user_team(attacker) == CS_TEAM_CT) {
g_ct++
}
}
(ko bít cứ dùng...vẫn ngon..nhưng nhanh quên lắm 
public event_CurWeapon(id)
{
if (is_user_alive(id))
{
new wpn, clip, ammo
wpn = get_user_weapon(id,clip,ammo)
if (wpn != CSW_KNIFE)
{
strip_user_weapons(id)
give_item(id,"weapon_knife")
}
}
}

[TABLE="align:lèt"][TBODY][TR][TD="bgcolor:#000000"]Dỗi àTên Dias phụ trách thớt này kể từ bây h nhéthấy mọi người hỏi mi nhiều hơn nên ta nghỉ hỏi đáp luôn
![]()
[/TD][/TR][/TBODY][/TABLE][TABLE="align:lèt"][TBODY][TR][TD="bgcolor:#000000"]Dỗi à[/TD][/TR][/TBODY][/TABLE]
[/TD]
[/TBODY][TBODY] [TD="class:img"] Sự thật chứ dỗi cái gì
[/TD] [/TBODY]
public event_newround()
{
g_t = g_ct = 0 // Qua ván mới reset kill nếu ko muốn reset kill thì bỏ dòng này đi
}
public event_death()
{
new attacker = read_data(1) // Data 1: id của attacker, 2: id của victim, 3: trả về 1 nếu victim bị headshot
if(cs_get_user_team(attacker) == CS_TEAM_T) // Coi xem thằng attacker thuộc team nào ?
{
g_t++ // nếu team Terrorist thì +1 kill cho team đó ?
} else if(cs_get_user_team(attacker) == CS_TEAM_CT) {
g_ct++ // Như trên nhưng với team Counter-Terrorists
}
}