[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
- Tên kungfulon share còn share pass là sao :|
- Muốn decompile cái quote trên mi phải cho ta mấy cái str_000,001,002 nữa chứ :)). thế thì decom = mắt
Xóa ngay link đi:-wta share pass ai cần thì hỏi:-wmi share nhặng tầm bậy hết cả lên:-wbiết ngay là không thể tin mi đc:-w
 
Hơ lúc mi share ta mi có bảo là phải private đâu :))
 
Các bác giải thích dùm em cái này vơi... Rốt Eng nên cũng chả hỉu mấy:
PHP:
/* Creates a death message. */
stock dod_make_deathmsg(killer, victim, weaponNUM)// Là sao?
{
	message_begin(MSG_ALL, get_user_msgid("DeathMsg"), {0,0,0}, 0);
	write_byte(killer); // Là sao?
	write_byte(victim);// Là sao?
	write_byte(weaponNUM);// Là sao?
	message_end();

	return 1;
}

PHP:
native message_begin(dest, msg_type, const origin[3] = {0,0,0}, player = 0);
native message_end();
native write_byte(x);//Là sao?
native write_char(x);//Là sao?
native write_short(x);//Là sao?
native write_long(x);//Là sao?
native write_entity(x);//Là sao?
native write_angle(x);//Là sao?
native write_coord(x);//Là sao?
native write_string(const x[]);//Là sao?

PHP:
native emessage_begin(dest, msg_type, const origin[3] = {0,0,0}, player = 0);//Là sao?
native emessage_end();//Là sao?
native ewrite_byte(x);//Là sao?
native ewrite_char(x);//Là sao?
native ewrite_short(x);//Là sao?
native ewrite_long(x);//Là sao?
native ewrite_entity(x);//Là sao?
native ewrite_angle(x);//Là sao?
native ewrite_coord(x);//Là sao?
native ewrite_string(const x[]);//Là sao?

Cả cái này nữa
PHP:
#define	MSG_BROADCAST               0        // Unreliable to all
#define	MSG_ONE                     1        // Reliable to one (msg_entity)
#define	MSG_ALL                     2        // Reliable to all
#define	MSG_INIT                    3        // Write to the init string
#define MSG_PVS                     4        // Ents in PVS of org
#define MSG_PAS                     5        // Ents in PAS of org
#define MSG_PVS_R                   6        // Reliable to PVS
#define MSG_PAS_R                   7        // Reliable to PAS
#define MSG_ONE_UNRELIABLE          8        // Send to one client, but don't put in reliable stream, put in unreliable datagram (could be dropped)
#define	MSG_SPEC                    9        // Sends to all spectator proxies
CÁc bác giúp em với :((
 
Các bác giải thích dùm em cái này vơi... Rốt Eng nên cũng chả hỉu mấy:
Nhét vô spoil cho con nhờ^:)^
[spoil]
PHP:
/* Creates a death message. */
stock dod_make_deathmsg(killer, victim, weaponNUM)// Là tên func, facepalm...
{
	message_begin(MSG_ALL, get_user_msgid("DeathMsg"), {0,0,0}, 0);
	write_byte(killer); // send 1 byte của message về client
	write_byte(victim); // như trên
	write_byte(weaponNUM); // như trên
	message_end();

	return 1;
}

PHP:
native message_begin(dest, msg_type, const origin[3] = {0,0,0}, player = 0);
native message_end();
native write_byte(x);// send 1 byte của message về client
native write_char(x);// 2 bytes
native write_short(x);// 4 bytes
native write_long(x);// 8 bytes
native write_entity(x);// send 1 entity id, = 1 bytes
native write_angle(x);// góc độ
native write_coord(x);// vector
native write_string(const x[]);// send dãy ký tự về client

PHP:
native emessage_begin(dest, msg_type, const origin[3] = {0,0,0}, player = 0);// như trên
native emessage_end();// như trên
native ewrite_byte(x);// như trên
native ewrite_char(x);// như trên
native ewrite_short(x);// như trên
native ewrite_long(x);// như trên
native ewrite_entity(x);// như trên
native ewrite_angle(x);// như trên
native ewrite_coord(x);// như trên
native ewrite_string(const x[]);// như trên

PHP:
// Lý thuyết về destination của message:
// Gồm 3 channel: Reliable, Unreliable, Spectator.
// Channel Unreliable khác với channel Reliable ở chỗ là channel Unreliable cho phép quá tải.
// Channel Spectator được sử dụng khi destination là MSG_SPEC.
#define	MSG_BROADCAST               0        // Send msg đến tất cả client thông qua channel Unreliable
#define	MSG_ONE                     1        // Send msg đến 1 client thông qua channel Reliable
#define	MSG_ALL                     2        // Send msg đến tất cả client thông qua channel Reliable
#define	MSG_INIT                    3        // Hầu như không dùng nên không biết
#define MSG_PVS                     4        // Cái này thường dùng để tạo các hiệu ứng không có âm thanh (send thông qua channel Unreliable)
#define MSG_PAS                     5        // Cái này thường dùng để tạo các hiệu ứng có âm thanh (send thông qua channel Unreliable)
#define MSG_PVS_R                   6        // Như cái MSG_PVS nhưng dùng channel Reliable
#define MSG_PAS_R                   7        // Như cái MSGPAS nhưng dùng channel Reliable
#define MSG_ONE_UNRELIABLE          8        // Send msg đến 1 client thông qua channel Unreliable
#define	MSG_SPEC                    9        // Send msg đến tất cả các spectator thông qua channel Spectator
[/spoil]
 
Nhét vô spoil cho con nhờ^:)^
[spoil]
PHP:
/* Creates a death message. */
stock dod_make_deathmsg(killer, victim, weaponNUM)// Là tên func, facepalm...
{
	message_begin(MSG_ALL, get_user_msgid("DeathMsg"), {0,0,0}, 0);
	write_byte(killer); // send 1 byte của message về client
	write_byte(victim); // như trên
	write_byte(weaponNUM); // như trên
	message_end();

	return 1;
}

PHP:
native message_begin(dest, msg_type, const origin[3] = {0,0,0}, player = 0);
native message_end();
native write_byte(x);// send 1 byte của message về client
native write_char(x);// 2 bytes
native write_short(x);// 4 bytes
native write_long(x);// 8 bytes
native write_entity(x);// send 1 entity id, = 1 bytes
native write_angle(x);// góc độ
native write_coord(x);// vector
native write_string(const x[]);// send dãy ký tự về client

PHP:
native emessage_begin(dest, msg_type, const origin[3] = {0,0,0}, player = 0);// như trên
native emessage_end();// như trên
native ewrite_byte(x);// như trên
native ewrite_char(x);// như trên
native ewrite_short(x);// như trên
native ewrite_long(x);// như trên
native ewrite_entity(x);// như trên
native ewrite_angle(x);// như trên
native ewrite_coord(x);// như trên
native ewrite_string(const x[]);// như trên

PHP:
// Lý thuyết về destination của message:
// Gồm 3 channel: Reliable, Unreliable, Spectator.
// Channel Unreliable khác với channel Reliable ở chỗ là channel Unreliable cho phép quá tải.
// Channel Spectator được sử dụng khi destination là MSG_SPEC.
#define	MSG_BROADCAST               0        // Send msg đến tất cả client thông qua channel Unreliable
#define	MSG_ONE                     1        // Send msg đến 1 client thông qua channel Reliable
#define	MSG_ALL                     2        // Send msg đến tất cả client thông qua channel Reliable
#define	MSG_INIT                    3        // Hầu như không dùng nên không biết
#define MSG_PVS                     4        // Cái này thường dùng để tạo các hiệu ứng không có âm thanh (send thông qua channel Unreliable)
#define MSG_PAS                     5        // Cái này thường dùng để tạo các hiệu ứng có âm thanh (send thông qua channel Unreliable)
#define MSG_PVS_R                   6        // Như cái MSG_PVS nhưng dùng channel Reliable
#define MSG_PAS_R                   7        // Như cái MSGPAS nhưng dùng channel Reliable
#define MSG_ONE_UNRELIABLE          8        // Send msg đến 1 client thông qua channel Unreliable
#define	MSG_SPEC                    9        // Send msg đến tất cả các spectator thông qua channel Spectator
[/spoil]


Ý em là khi nào thì dùng cái nào?
Bác giải thích dùm em... Ví dụ như
PHP:
write_byte(x) // RED
write_byte(x) // GREEN
write_byte(x) // BLUE
write_string(y) // SPR

Chứ ai chẳng biết write_byte là send 1 byte :((
 
PHP:
/* Creates a death message. */
stock dod_make_deathmsg(killer, victim, weaponNUM)// Khỏi phải nói :))
{
	message_begin(MSG_ALL, get_user_msgid("DeathMsg"), {0,0,0}, 0);
	write_byte(killer); //Người giết (Khi giết 1 ai đó bạn sẽ là killer)
	write_byte(victim);// Nạn nhân (dễ hiểu r`)
	write_byte(weaponNUM);//Là vũ khí của killer để kill victim, hình như phải dùng số
	message_end();

	return 1;
}
:))
 
1. Nếu cứ lên đây mà than phiền về trình eng thì đừng có học code làm gì cho mất công
2. Muốn học code thì học eng trc đi
3. Sao phải xoắn ?
 
Hắn ta đã nói dốt Eng r` lại bảo vô đó mà đọc
1dd69265d4bba682897f32d87c9e18c1.jpg
 
Vậy sinh ra Google Translator để làm gì
1dd69265d4bba682897f32d87c9e18c1.jpg
Làm cảnh thôi, cái đấy có trans đc đâu, cùng lắm tra từng từ 1 để hiểu rõ nghĩa của nó chứ đọc cả câu chắc hóc quá :))
 
^ chỉ có thằng bị vấn đề mới dùng Google để trans cả câu rồi ko chịu mở đầu ra theo hướng khác mà cứ khăng khăng theo bài dịch
 
Nói chung Google Trans chỉ dùng để dịch từ, dịch câu (50% đúng). Nhưng về đời sống con người thôi, chứ dịch vừ về coder thì thôi khỏi dịch là vừa
 
Nó chỉ translate chứ làm sao dịch theo chuyên môn 1 ngành cho các bố được =)).. Một từ dùng theo nghĩa thực tế khác với nghĩa nó khi theo từ điển tin học.
 
Các bác fix dùm em cái này với:
PHP:
#include <amxmodx>
#include <file>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new weapon1_1,weapon1_2
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_connected(i)||!is_user_bot(i)) continue;
		weapon1_1 = read_file(addons\amxmodx\configs\BDD_bag.cfg, 1, weapon1, 100, 100) // nó báo lỗi dòng này nhưng em chả biết sửa	
		weapon1_2 = read_file(addons\amxmodx\configs\BDD_bag.cfg, 2, weapon2, 100, 100)
		client_cmd(i,weapon1_1)
		client_cmd(i,weapon1_2)
	}
}
 
Nói chung Google Trans chỉ dùng để dịch từ, dịch câu (50% đúng). Nhưng về đời sống con người thôi, chứ dịch vừ về coder thì thôi khỏi dịch là vừa
mình thấy google dịch cũng được mà , có điều không sát nghĩa .
 
Các bác fix dùm em cái này với:
PHP:
#include <amxmodx>
#include <file>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new weapon1_1,weapon1_2
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_connected(i)||!is_user_bot(i)) continue;
		weapon1_1 = read_file(addons\amxmodx\configs\BDD_bag.cfg, 1, weapon1, 100, 100) // nó báo lỗi dòng này nhưng em chả biết sửa	
		weapon1_2 = read_file(addons\amxmodx\configs\BDD_bag.cfg, 2, weapon2, 100, 100)
		client_cmd(i,weapon1_1)
		client_cmd(i,weapon1_2)
	}
}
PHP:
#include <amxmodx>
#include <hamsandwich>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1)
}

public fw_PlayerSpawn_Post(id)
{
	give_weapon_bag(id)
}

public give_weapon_bag(id)
{
	new wpn1_1[1024], wpn1_2[1024], txtlen
	read_file("addons\amxmodx\configs\BDD_bag.cfg", 1, linedata, charsmax(linedata), txtlen)
	read_file("addons\amxmodx\configs\BDD_bag.cfg", 2, linedata, charsmax(linedata), txtlen)
	client_cmd(id, wpn1_1)
	client_cmd(id, wpn1_2)
}
 
^
^
^
-> String thì phải bỏ trong " " ^:)^
 
PHP:
#include <amxmodx>
#include <hamsandwich>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1) // nghĩa là gì vậy? cũng là sự kiện ván mới hả bác?
}

public fw_PlayerSpawn_Post(id)
{
	give_weapon_bag(id) // Là sao? sao lại có public give_weapon_bag(id)  khi chưa đăng kí ạ?
}

public give_weapon_bag(id) 
{
	new wpn1_1[1024], wpn1_2[1024], txtlen
	read_file("addons\amxmodx\configs\BDD_bag.cfg", 1, linedata, charsmax(linedata), txtlen)
	read_file("addons\amxmodx\configs\BDD_bag.cfg", 2, linedata, charsmax(linedata), txtlen)
	client_cmd(id, wpn1_1)
	client_cmd(id, wpn1_2)
}


---------- Post added at 19:33 ---------- Previous post was at 19:30 ----------

^
^
^
-> String thì phải bỏ trong " " ^:)^

Em bỏ trong " " rồi nhưng ko complie được.. nó báo lỗi lung tung, nên em bỏ dấu " " đi :D
Nhân tiện các bác cho em hỏi:
+ Làm sao để set Orgin cho models ạ?
+ Tạo độ để set Orgin có giống trong hlmv?
(em đang làm tuyệt chiêu của con zombie đỏ)
 
Back
Top