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

  • Thread starter Thread starter Orpheus
  • Ngày gửi Ngày gửi
@KungFuLon:
- Có time rảnh mi hd ta từng chi tiết forward AddToFullPack đi :( nghe bảo nó khá hay nhưng ko biết vọc, cũng nghe bảo nó dùng để làm Confuse bomb
thử set ES_ModelIndex trong FM_AddToFullPack xem
 
@sontung0:
- AddToFullPack còn chưa biết sài ra sao :)). nói gì set index mà set index cũng ko biết
- Cái này chỉ ai "bị dính bomb" thì mới nhìn thấy zombie ra human thôi, thằng kia đứng từ xa ko bị dính bomb thì nó vẫn thấy zombie bt`
- Confuse bomb thì kungfulon nó làm rồi, nhưng ko share đâu =="
 
Chỉnh sửa cuối:
Dark_one có viết rồi. sang 2pic F5 mà tìm :|
 
Chief cầm rồi chả thấy nói gì nữa đấy chứ :-??
 
Vì cái review đó về NST WPN cũ nên chưa dám đưa, đợi khi nào ra 1002 thì ta viết thêm mấy type vào.. Do trong CSO-NST F5 sau này sẽ bỏ sight model và fast run cùng 1 số type không liên quan đi :|
 
cứ thoải mái ;))
vẫn còn giữ source trên Word để tiện chỉnh sửa mà ;))
 
Vì cái review đó về NST WPN cũ nên chưa dám đưa, đợi khi nào ra 1002 thì ta viết thêm mấy type vào.. Do trong CSO-NST F5 sau này sẽ bỏ sight model và fast run cùng 1 số type không liên quan đi :|
Phải bỏ đi cho nó giống cso, nhưng mà vẫn phải để nó trong TUT vì đấy là plugin nguyên bản của sontung mà (TUT có nói là cách thêm súng cho CSO-NST F5 đâu)
 
mới vọc xong cái source code của cái weapon CS 1.6 :D
 
Lỗi nhìu quá mà ko biết đâu mà sửa... Các bác PRO giúp em phát.. :((

Cái thứ 1:
PHP:
#include <amxmodx>


#define PLUGIN "BAG WPN"
#define VERSION "1.0"
#define AUTHOR "Bui Duc Duy"

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
}

public event_round_start()
{
    for(new i = 1,i<= get_maxplayers(),i++)
	{
		if(!is_user_bot(i)||!is_user_connected(i)) continue
		new wpn1_1[1024],wpn1_2[1024],len
		read_file("addons/amxmodx/configs/BDD_bag.cfg", 1, wpn1_1, charsmax(wpn1_1), len)
		read_file("addons/amxmodx/configs/BDD_bag.cfg", 2, wpn1_2, charsmax(wpn1_2), len)
		client_cmd(i,wpn1_1)
		client_cmd(i,wpn1_2)
		client_print(i,print_chat,"Ban da chon Ba lo 1")
	}
}

Cái thứ 2
PHP:
#include <amxmodx>

#define PLUGIN "Health and ammo"
#define VERSION "1.0"
#define AUTHOR "Bui Duc Duy"

new g_iMsgStatusIcon

public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR);
    register_event("Health", "event_health", "be") ;
    register_event("CurWeapon", "event_CurWeapon", "ab") 
    
    g_iMsgStatusIcon = get_user_msgid("StatusIcon");
}

public event_health(id)
{
if (!is_user_connected(id)||!is_user_alive(id))
{
    new iHealth = get_user_health(id);
	new name_spr[10], run
    
    set_hudmessage(255, 255, 255, 0.15, 0.8, 0, 6.0, 999.0, 0.0, 0.0, -1);
    show_hudmessage(id, "%d", iHealth);
    
    set_hudmessage(255, 255, 255, 0.15, 0.9, 0, 6.0, 999.0, 0.0, 0.0, -1);
    show_hudmessage(id,"%d", get_user_armor(id));
	
	switch(iHealth)
	{
		case 80..100:
		{
			name_spr[] = "health100"
			run = 1
		}
		case 21..79:
		{
			name_spr[] = "health70"
			run = 1
		}
		case 1..20:
		{
			name_spr[] = "health20"
			run = 1
		}
		case 0
		{
			name_spr[] = "health20"
			run = 1
		}
	}
	message_begin(MSG_ONE, g_iMsgStatusIcon, {0,0,0}, id)
    write_byte(run) // status: 0: off; 1: on; 2:flash
    write_string(name_spr)
    message_end()
}
}
 
^
PHP:
#include <amxmodx>


#define PLUGIN "BAG WPN"
#define VERSION "1.0"
#define AUTHOR "Bui Duc Duy"

new i

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
}

public event_round_start()
{
    for(i = 1;i<= get_maxplayers();i++) //--> replace , = ; *facepalm*
    {
        if(!is_user_bot(i)||!is_user_connected(i)) 
		{
			new wpn1_1[1024],wpn1_2[1024],len
			read_file("addons/amxmodx/configs/BDD_bag.cfg", 1, wpn1_1, charsmax(wpn1_1), len)
			read_file("addons/amxmodx/configs/BDD_bag.cfg", 2, wpn1_2, charsmax(wpn1_2), len)
			client_cmd(i,wpn1_1)
			client_cmd(i,wpn1_2)
			client_print(i,print_chat,"Ban da chon Ba lo 1")	
		}
    }
}
 
PHP:
new i
PHP:
for(new i = 1;i<= get_maxplayers();i++)
129092786498235257.jpg
 
Lỗi nhìu quá mà ko biết đâu mà sửa... Các bác PRO giúp em phát.. :((

Cái thứ 1:
PHP:
#include <amxmodx>


#define PLUGIN "BAG WPN"
#define VERSION "1.0"
#define AUTHOR "Bui Duc Duy"

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
}

public event_round_start()
{
    for(new i = 1,i<= get_maxplayers(),i++)
	{
		if(!is_user_bot(i)||!is_user_connected(i)) continue
		new wpn1_1[1024],wpn1_2[1024],len
		read_file("addons/amxmodx/configs/BDD_bag.cfg", 1, wpn1_1, charsmax(wpn1_1), len)
		read_file("addons/amxmodx/configs/BDD_bag.cfg", 2, wpn1_2, charsmax(wpn1_2), len)
		client_cmd(i,wpn1_1)
		client_cmd(i,wpn1_2)
		client_print(i,print_chat,"Ban da chon Ba lo 1")
	}
}

Cái thứ 2
PHP:
#include <amxmodx>

#define PLUGIN "Health and ammo"
#define VERSION "1.0"
#define AUTHOR "Bui Duc Duy"

new g_iMsgStatusIcon

public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR);
    register_event("Health", "event_health", "be") ;
    register_event("CurWeapon", "event_CurWeapon", "ab") 
    
    g_iMsgStatusIcon = get_user_msgid("StatusIcon");
}

public event_health(id)
{
if (!is_user_connected(id)||!is_user_alive(id))
{
    new iHealth = get_user_health(id);
	new name_spr[10], run
    
    set_hudmessage(255, 255, 255, 0.15, 0.8, 0, 6.0, 999.0, 0.0, 0.0, -1);
    show_hudmessage(id, "%d", iHealth);
    
    set_hudmessage(255, 255, 255, 0.15, 0.9, 0, 6.0, 999.0, 0.0, 0.0, -1);
    show_hudmessage(id,"%d", get_user_armor(id));
	
	switch(iHealth)
	{
		case 80..100:
		{
			name_spr[] = "health100"
			run = 1
		}
		case 21..79:
		{
			name_spr[] = "health70"
			run = 1
		}
		case 1..20:
		{
			name_spr[] = "health20"
			run = 1
		}
		case 0
		{
			name_spr[] = "health20"
			run = 1
		}
	}
	message_begin(MSG_ONE, g_iMsgStatusIcon, {0,0,0}, id)
    write_byte(run) // status: 0: off; 1: on; 2:flash
    write_string(name_spr)
    message_end()
}
}
PHP:
register_event("CurWeapon", "event_CurWeapon", "ab") // public event_CurWeapon đâu:|
129092786498235257.jpg
 
@Duy :
PHP:
#include <amxmodx>

#define PLUGIN "Health and ammo"
#define VERSION "1.0"
#define AUTHOR "Bui Duc Duy"

new g_iMsgStatusIcon

public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR);
    register_event("Health", "event_health", "be") ;
    g_iMsgStatusIcon = get_user_msgid("StatusIcon");
}

public event_health(id)
{
	if (!is_user_connected(id)||!is_user_alive(id))
	{
		new iHealth = get_user_health(id);
		new name_spr[10], run    
		set_hudmessage(255, 255, 255, 0.15, 0.8, 0, 6.0, 999.0, 0.0, 0.0, -1);
		show_hudmessage(id, "%d", iHealth);    
		set_hudmessage(255, 255, 255, 0.15, 0.9, 0, 6.0, 999.0, 0.0, 0.0, -1);
		show_hudmessage(id,"%d", get_user_armor(id));    
		switch(iHealth)
		{
			case 80..100:
			{
				name_spr = "health100"
				run = 1
			}
			case 21..79:
			{
				name_spr = "health70"
				run = 1
			}
			case 1..20:
			{
				name_spr = "health20"
				run = 1
			}
			case 0:
			{
				name_spr = "health0"
				run = 1
			}
		}
		message_begin(MSG_ONE, g_iMsgStatusIcon, {0,0,0}, id)
		write_byte(run) // status: 0: off; 1: on; 2:flash
		write_string(name_spr)
		message_end()
	}
}
P/s: Cái curWeapon chắc chưa viết xong =))
 
Chỉnh sửa cuối:
@KFC:
PHP:
#include <amxmodx>

#define PLUGIN "Health and ammo"
#define VERSION "1.0"
#define AUTHOR "Bui Duc Duy"

new g_iMsgStatusIcon

public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR);
    register_event("Health", "event_health", "be") ;
    g_iMsgStatusIcon = get_user_msgid("StatusIcon");
}

public event_health(id)
{
	if (!is_user_connected(id)||!is_user_alive(id))
	{
		new iHealth = get_user_health(id);
		new name_spr[10], run    
		set_hudmessage(255, 255, 255, 0.15, 0.8, 0, 6.0, 999.0, 0.0, 0.0, -1);
		show_hudmessage(id, "%d", iHealth);    
		set_hudmessage(255, 255, 255, 0.15, 0.9, 0, 6.0, 999.0, 0.0, 0.0, -1);
		show_hudmessage(id,"%d", get_user_armor(id));    
		switch(iHealth)
		{
			case 80..100:
			{
				name_spr = "health100"
				run = 1
			}
			case 21..79:
			{
				name_spr = "health70"
				run = 1
			}
			case 1..20:
			{
				name_spr = "health20"
				run = 1
			}
			case 0 //--> báo lỗi chỗ này, sao thế nhỉ ?
			{
				name_spr = "health0"
				run = 1
			}
		}
		message_begin(MSG_ONE, g_iMsgStatusIcon, {0,0,0}, id)
		write_byte(run) // status: 0: off; 1: on; 2:flash
		write_string(name_spr)
		message_end()
	}
}
Dấu hai chấm ở chỗ đó đâu:|
129092786498235257.jpg
 
Dấu hai chấm ở chỗ đó đâu:|
Ờ, mắt kém =))
@Duy: Đã fix

PHP:
#include <amxmodx>


#define PLUGIN "BAG WPN"
#define VERSION "1.0"
#define AUTHOR "Bui Duc Duy"

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
}

public event_round_start()
{
    for(new i = 1;i<= get_maxplayers();i++) //--> replace , = ; *facepalm*
    {
        if(!is_user_bot(i)||!is_user_connected(i)) 
		{
			new wpn1_1[1024],wpn1_2[1024],len
			read_file("addons/amxmodx/configs/BDD_bag.cfg", 1, wpn1_1, charsmax(wpn1_1), len)
			read_file("addons/amxmodx/configs/BDD_bag.cfg", 2, wpn1_2, charsmax(wpn1_2), len)
			client_cmd(i,wpn1_1)
			client_cmd(i,wpn1_2)
			client_print(i,print_chat,"Ban da chon Ba lo 1")	
		}
    }
}
PHP:
#include <amxmodx>

#define PLUGIN "Health and ammo"
#define VERSION "1.0"
#define AUTHOR "Bui Duc Duy"

new g_iMsgStatusIcon

public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR);
    register_event("Health", "event_health", "be") ;     
    g_iMsgStatusIcon = get_user_msgid("StatusIcon");
}

public event_health(id)
{
	if (!is_user_connected(id)||!is_user_alive(id))
	{
		new iHealth = get_user_health(id);
		new name_spr[10], run    
		set_hudmessage(255, 255, 255, 0.15, 0.8, 0, 6.0, 999.0, 0.0, 0.0, -1);
		show_hudmessage(id, "%d", iHealth);    
		set_hudmessage(255, 255, 255, 0.15, 0.9, 0, 6.0, 999.0, 0.0, 0.0, -1);
		show_hudmessage(id,"%d", get_user_armor(id));    
		switch(iHealth)
		{
			case 80..100:
			{
				name_spr = "health100"
				run = 1
			}
			case 21..79:
			{
				name_spr = "health70"
				run = 1
			}
			case 1..20:
			{
				name_spr = "health20"
				run = 1
			}
			case 0:
			{
				name_spr = "health0"
				run = 1
			}
		}
		message_begin(MSG_ONE, g_iMsgStatusIcon, {0,0,0}, id)
		write_byte(run) // status: 0: off; 1: on; 2:flash
		write_string(name_spr)
		message_end()
	}
}


---------- Post added at 15:08 ---------- Previous post was at 14:40 ----------

Yeah, ta biết cách tạo chế độ chơi tùy chọn theo tiền tố map r` :)>-
 
Chỉnh sửa cuối:
Back
Top