• [THÔNG BÁO] CẢNH BÁO LỪA ĐẢO MẠO DANH QUẢN TRỊ VIÊN
    Chào các thành viên GameVN,
    Dạo gần đây tình trạng lừa đảo scamming và phishing đang gia tăng. Ban quản trị GameVN xin lưu ý toàn bộ thành viên:
    KHÔNG/ ĐỪNG / CẤM cho bất kỳ ai tự xưng là quản trị viên của server vay tiền.
    Mọi hành vi lân la làm quen, tự tiện nhắn tin trên Discord, Facebook, Zalo hoặc các nền tảng mạng xã hội khác,
    núp bóng dưới danh nghĩa sinh hoạt của quản trị viên, đều có tỉ lệ rất, rất cao là lừa đảo.
    Nếu có tài khoản lạ add friend hoặc nhắn tin xin tiền dưới danh nghĩa admin:
    Block ngay
    Report ngay
    Không chuyển khoản, không cung cấp thông tin cá nhân


    Quản trị viên của forum và Discord server GameVN không có nhu cầu vay tiền thành viên.
    Không có lý do nào để admin chủ động kết bạn rồi xin tiền.
    Mọi thông báo chính thức chỉ được đăng trên kênh thông báo của server và topic chính thức trên forum.
    Tin nhắn riêng từ tài khoản lạ không phải thông báo của ban quản trị.
    Cảm ơn các bạn đã chú ý và cùng giữ cộng đồng an toàn.
    — Ban quản trị GameVN

    Tắt thông báo bằng nút X bên góc phải của bảng thông báo*

[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
Mi đừng lua với leo nữa, ta chả hiểu j` cả .
LUA là 1 dạng Ngôn Ngữ Lập Trình, mi ko hiểu là đúng rồi:-"

---------------------[S.V.E.N] kungfulon a.k.a Counter-Striker---------------------
 
H muốn tạo 1 cái plugin đánh bom tự sát thì phải làm thế nào nhỉ ( hơi chuối =))) , ai hướng dẫn cho ta với.
 
More easy than easy...........
 
Thì phải bắt đầu từ Very Easy --> Easy --> Normal --> Medium --> Hard --> Very Hard --> Expert chứ (Nghe hơi nản =)))
Thế mấy bác júp em phần dàn ý thôi (bằng lời ý) rồi để em tự làm :D
 
đăng kí 1 lệnh (clcmd)
rồi trong public của lệnh đó. Write message Explode, sau đó sài user_kill(id) để tự kill mình.

phần write message explode thì kiếm các plugin tham khảo hoặc: http://wiki.alliedmods.net/Temp_Entity_Events_(Half-Life_1)
PHP:
#define TE_EXPLOSION 3

message_begin(MSG_BOARDCAST ,SVC_TEMPENTITY)
write_byte(TE_EXPLOSION)
write_coord()	// origin1
write_coord()      // origin 2
write_coord()      // origin 3
write_short()	// sprite index
write_byte()	// scale in 0.1's
write_byte()	// framerate
write_byte()	// flags
message_end()

nếu origin thì dùng pev_origin
cái phần message begin nếu dùng engfunc thì càng tốt nhưng thôi vọc mấy cái này trước đi
 
đăng kí 1 lệnh (clcmd)
rồi trong public của lệnh đó. Write message Explode, sau đó sài user_kill(id) để tự kill mình.

phần write message explode thì kiếm các plugin tham khảo hoặc: http://wiki.alliedmods.net/Temp_Entity_Events_(Half-Life_1)
PHP:
#define TE_EXPLOSION 3

message_begin(MSG_ ,SVC_TEMPENTITY)
write_byte(TE_EXPLOSION)
write_coord()	// origin1
write_coord()      // origin 2
write_coord()      // origin 3
write_short()	// sprite index
write_byte()	// scale in 0.1's
write_byte()	// framerate
write_byte()	// flags
message_end()

nếu origin thì dùng pev_origin
Cái chính là còn phải gây damage ra xung quanh. Dùng func radius_damage (chết mẹ, ở inc nào éo nhớ:|) là đc.
 
@Kungfulon:
- Có func đó nữa hả :>. tiện thật thế mà trước kai mình cư phải khổ vì nó :>.
- Đây nè mẹ, nó là của module engine
Ex:
PHP:
public radiusdamage(id)
{
     new origin[3]
     new damage = 50 //50 hp damage
     new radius = 100 //radius is within 100 units

     get_user_origin(id,origin)
     radius_damage(origin,damage,radius)
}

@darklegion:
- dùng find_ent_in_sphere để check ent trong 1 radius. sau đó nếu ent nào trong radius thì execute ham_takedamage là dc. bên kfl có cái radius_damage tiện thật :"> thì sài nó cũng dc
 
Chỉnh sửa cuối:
Uh thì precache. quên mất...................
 
return "Bỏ qua" thì dùng cái j` nhỉ , PLUGIN_INGORE à

---------- Post added at 22:35 ---------- Previous post was at 22:18 ----------

Mới thế này thôi đã, mấy cái kia tính sau
PHP:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#define PLUGIN	"Suicide Bombings"
#define AUTHOR	"LegionDark"
#define VERSION	"1.0"

new life
public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_clcmd("LD_sui_bomb", "sui_bomb")
	life = is_user_alive(id) //--> Tại sao k dùng id đc, nó báo là: undefined symbol (k xd đc ký tự) là sao
}

public sui_bomb()
	{
		if(life == 0 )
		{
			return HAM_IGNORED
		}else 
		{
			user_kill(id) //--> Vẫn câu hỏi như trên
		}
		return PLUGIN_CONTINUE
	}
 
Chỉnh sửa cuối:
Ai giúp mình với,Mình cài plugins nst_wpn,tạo ra 1 weapons mới nhưng mà vào game mình đang chơi VD:đang cầm khẩu Ak47-camo chẳng hạn thì bắn đc 1 or 2 round thì nó biến thành ak bình thường và lại phải ấn amx_on 1 cứ tầm 1 or 2 ván lại bị Ai fix cho mình với :(
 
@legiondark:
- Nhìn đống parameter của plugin_int(). có cái nào là id ko ?
 
@ dias : xem trong file .inc ấy, plugin_int() thì tức là không có giá trị nào khác => không có id
@ legion : return không phải là bỏ qua, mà là TRẢ VỀ GIÁ TRỊ, ví dụ:
stock check_zombie(id)
{
if (g_zombie[id])
return 1
return 0
}

có nghĩa là nếu người chơi là zombie, thì stock này trả về giá trị 1, còn không thì trả về 0
LƯU Ý: Khi trả về giá trị, thì các dòng code sau return đều không được tính đến
Trong ví dụ trên, khi return 1 thì dòng return 0 sẽ bị bỏ qua và kết thúc stock

---------- Post added at 10:22 ---------- Previous post was at 10:19 ----------

@ legion : nếu anh giảng không hiểu thì đừng chưởi anh nhá :)).
 
Code AMX ko có khó:))cái chính là đầu tiên phải hiểu đc cấu trúc hàm & các kiểu dữ liệu đã:))
 
return "Bỏ qua" thì dùng cái j` nhỉ , PLUGIN_INGORE à

---------- Post added at 22:35 ---------- Previous post was at 22:18 ----------

Mới thế này thôi đã, mấy cái kia tính sau
PHP:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#define PLUGIN	"Suicide Bombings"
#define AUTHOR	"LegionDark"
#define VERSION	"1.0"

new life
public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_clcmd("LD_sui_bomb", "sui_bomb")
	life = is_user_alive(id) //--> Tại sao k dùng id đc, nó báo là: undefined symbol (k xd đc ký tự) là sao
}

public sui_bomb()
	{
		if(life == 0 )
		{
			return HAM_IGNORED
		}else 
		{
			user_kill(id) //--> Vẫn câu hỏi như trên
		}
		return PLUGIN_CONTINUE
	}

tớ mới học tý code, mong có thể giúp đc cậu chút ít

PHP:
#include <amxmodx>

#define PLUGIN    "Suicide Bombings"
#define AUTHOR    "LegionDark pro"
#define VERSION    "1.0"

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_clcmd("LD_sui_bomb", "sui_bomb")
}

public sui_bomb(id)
    {
        if(is_user_alive(id))
                user_kill(id)
    }
 
Chỉnh sửa cuối:
@ryokin:
- Pro thế kia mà cứ... :))
- Thêm phần hiện spr khi nổ đi, nó bảo là nổ tự sát mà ==" (write message là dc)

@legiondark:
- trong forward của AMX thì sài return HAM_IGNORED làm gì ?.
- còn cái khúc life thì ghi mẹ vào trong luôn đi, làm gì cho dài dòng...

@ALL:
- có ai rút ngắn gọn và tối ưu hóa dc code này ko :-?. thấy nó dài dòng quá :)). ông kfl nói lại tui cái cách spawn tốt nhất đi
PHP:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

#define PLUGIN "[JailBreak] Buy Respawn"
#define VERSION "1.0"
#define AUTHOR "Dias"

new cvar_cost_te
new cvar_cost_ct

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_clcmd("say /buy_rp", "buy_respawn")
	
	cvar_cost_te = register_cvar("jail_rp_cost_te", "5000")
	cvar_cost_ct = register_cvar("jail_rp_cost_ct", "8000")
}

public buy_respawn(id)
{
	if(cs_get_user_team(id) == CS_TEAM_SPECTATOR || cs_get_user_team(id) == CS_TEAM_UNASSIGNED)
		return PLUGIN_HANDLED
		
	if(!is_user_alive(id))
	{
		new current_money = cs_get_user_money(id)
		
		if(cs_get_user_team(id) == CS_TEAM_T)
		{
			if(current_money >= get_pcvar_num(cvar_cost_te))
			{
				ExecuteHam(Ham_CS_RoundRespawn, id)
				cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_cost_te))
				client_print(id, print_chat, "[JailBreak] Da thanh toan... Hoi Sinh")
			} else {
				client_print(id, print_chat, "[JailBreak] Thieu tien kia may. Yeu cau: %i$ (Cho TE)", get_pcvar_num(cvar_cost_te))
			}
		} else if(cs_get_user_team(id) == CS_TEAM_CT) {
			if(current_money >= get_pcvar_num(cvar_cost_ct))
			{
				ExecuteHam(Ham_CS_RoundRespawn, id)
				cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_cost_ct))
				client_print(id, print_chat, "[JailBreak] Da thanh toan... Hoi Sinh")
			} else {
				client_print(id, print_chat, "[JailBreak] Thieu tien kia may. Yeu cau: %i$ (Cho CT)", get_pcvar_num(cvar_cost_ct))
			}			
		}
	} else {
		client_print(id, print_chat, "[JailBreak] Con song thi mua Hoi Sinh lam gi ?")
	}
	
	return PLUGIN_CONTINUE
}
 
Chỉnh sửa cuối:
1)
Mình thì GÀ code lắm , khuyến mãi bạn thêm 1 public .
PHP:
public suicide_bomba(id) {
// Vì trước đó đã check alive , tớ ko check nữa nha
static Float: origin[3]
entity_get_vector( id , EV_VEC_origin , origin )

// Vẽ spr cho đẹp
	message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
	write_byte(3);		// TE_EXPLOSION
	write_coord(floatround(origin[0])); // Floatround return => NUM , vì engine trả Float
	write_coord(floatround(origin[1]));
	write_coord(floatround(origin[2]));
	write_short(explodespr);// sprite
	write_byte(40);		// scale
	write_byte(12);		// fps
	write_byte(0);		// flags
	message_end();
// Gây damage !
radius_damage( Origin , get_pcvar_float(cvar_Fdamage) , get_pcvar_float(cvar_Fradius) ) 

}

2) Tạo 1 public plugin_precache()
PHP:
public plugin_precache() 
explodespr = precache_model("sprites/zerogxplode.spr");
Public này dùng để precache model , chạy trước cả plugin_init
3) Bạn tự tạo 2 cvar_Fdamage và cvar_Fradius nhé ( damage là sát thương , radius là bán kính , bạn để cỡ 300 thử xem :D .

4) Ở phần include thêm >>> #include <engine>

P/S : Chưa test thử nha :D . Có lỗi j thì báo :D .
 
ông sương xọ release mod bio rồi cơ ak
tưởng đang làm coder cho vnforce
@Dias:Làm JaiBreak ak
chưa chơi bao h ^^
 
Mấy PRO có thể FIX giúp mình cái này không? Sửa cả tối qua vẫn ko complie được [\B]
PHP:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "Misson"
#define VERSION "1.0"
#define AUTHOR "Duc Duy"


new  my_team 
new players_t[32],players_ct[32], ict,ite

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

public win_lose()
{
	get_players(players_t,ite,"ae","TERRORIST")
	get_players(players_ct,ict,"ae","CT")
	my_team = cs_get_user_team(id)
	
	if (my_team ==CS_TEAM_T){

	if (ite == 0 && ict!0){
		message_begin(MSG_ONE, get_user_msgid("StatusIcon"), {0,0,0}, id)
		write_byte(1) // status: 0: off; 1: on; 2:flash
		write_string(lose)
		write_byte(255) // red
		write_byte(255) // green
		write_byte(255) // blue
		message_end()
		hide_spr()
		} else {
		message_begin(MSG_ONE, get_user_msgid("StatusIcon"), {0,0,0}, id)
		write_byte(1) // status: 0: off; 1: on; 2:flash
		write_string(win)
		write_byte(255) // red
		write_byte(255) // green
		write_byte(255) // blue
		message_end()
		hide_spr()
		}
	}
	if (my_team ==CS_TEAM_CT){

	
	if (ite == 0 && ict!0){
		message_begin(MSG_ONE, get_user_msgid("StatusIcon"), {0,0,0}, id)
		write_byte(1) // status: 0: off; 1: on; 2:flash
		write_string(win)
		write_byte(255) // red
		write_byte(255) // green
		write_byte(255) // blue
		message_end()
		hide_spr()
		} else {
		message_begin(MSG_ONE, get_user_msgid("StatusIcon"), {0,0,0}, id)
		write_byte(1) // status: 0: off; 1: on; 2:flash
		write_string(lose)
		write_byte(255) // red
		write_byte(255) // green
		write_byte(255) // blue
		message_end()
		hide_spr()
		}
	}
}
	
public event_round_start()
{
	new iconstatus = get_user_msgid("StatusIcon")
	message_begin(MSG_ONE, get_user_msgid("StatusIcon"), {0,0,0}, id)
	write_byte(0)
	write_string(lose) 
	write_string(win) 
	message_end()
}

À, em được biết có 2 cách add spr
+ Dùng nguyên file SPR , tọa độ được hiểu trong hud.txt
+ Lấy 1 phần của SPR (hud_kill chẳng hạn) tọa độ được quy định ở>??
Mấy anh chỉ em với..!
 
Back
Top