[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
Ryokin đâu rồi... Vừa post nhầm qua bên kia chưa kịp đọc đã del :))
 
Lâu lâu lọ mọ mấy tìm mấy cái plugin về Grenade phát.
KICK THE NADE
Description: Có thể sút quả bom đi =)), cúi xuống chỗ bom rồi nhấn USE button (E)
Nguồn và download: http://forums.alliedmods.net/showthread.php?t=15539
Cvar:
kickthenades_radius 75 - Khoảng cách cho phép đá grenade đi ( Nếu player nào gần hơn tất nhiên đá được ) - Default : 75
kickthenades_speed 1000 - Tốc độ của grenade khi bị đá văng. - Default: 1000
kickthenades_height 50 - Càng tăng số này thì khi grenade bị đá sẽ bay lên cao hơn - Default: 50
 
Spam chứ còn gì nữa! Tui thấy hắn spam 1 loạt bên box Đánh Giá,Cảm Nhận,về đây thấy câu ta là phải để ý luôn và có lẽ vẫn có ý định spam ở đây thì phải!^^
Nếu cậu dancuibapkg muốn tiếp tục spam thì xin mời,nhận đủ points rồi tiễn cậu ra đảo chơi Tết luôn!
 
nó muốn spam để lấy nhiều post cho để = mình =))

---------- Post added at 06:59 ---------- Previous post was at 06:41 ----------

@Ryokin ơi:
- Tui điên con Quark này quá. Sau khi sài lặp while để lấy các ent trong phạm vi thì các hàm không chạy nữa. Tui để sẵn 1 cái print message để thử xem cái nào chạy thì cái đứng trước lặp chạy. còn đứng sau thì...

PHP:
#include <amxmodx>
#include <fakemeta>
#include <fun>
#include <engine>
#include <zombieplague>

#define MAX_PLAYERS 33 // Max Player 32 + 1 Server = 33

new const zclass_name[] = "Quark Zombie" // name
new const zclass_info[] = "Make Human Can't Move" // description
new const zclass_model[] = "zombie_classic1" // model
new const zclass_clawmodel[] = "v_knife_classic1.mdl" // claw model
const zclass_health = 2000 // health
const zclass_speed = 250 // speed
const Float:zclass_gravity = 1.0 // gravity
const Float:zclass_knockback = 1.0 // knockback

// Main vars
new g_quark
new g_beamspr
new bool:can_do_skill[33]
new g_msgbartime

// Main cvars
new time_wait
new cooldown_time
new distance

public plugin_init()
{
	register_plugin("[ZP] Zombie Class: Quark", "1.0", "Dias")
	register_concmd("drop", "do_skill")
	
	time_wait = register_cvar("qz_time_wait_to_do_skill", "3")
	cooldown_time = register_cvar("qz_cooldown_after_do_skill", "30")
	distance = register_cvar("qz_distance_to_do_skill", "500")
	g_msgbartime = get_user_msgid("BarTime")
}
public plugin_precache()
{
	g_quark = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)	
	g_beamspr = precache_model("sprites/shockwave.spr")
}

public zp_user_humanized_post(id, survivor)
{
	if (is_user_alive(id) && zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_quark)
	{
		// If user is alive and a human
		can_do_skill[id] = false
	}
}

public zp_user_infected_post(id, infector)
{
	if (is_user_alive(id) && zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_quark)
	{
		// Check if user is alive and a zombie with class is Quark Zombie
		client_print(id, print_chat, "[Quark Zombie] Press (G) to make your near victim can't move.")
		can_do_skill[id] = true
	}
}

public do_skill(id)
{
	if(is_user_alive(id) && zp_get_user_zombie(id))
	{
		if(zp_get_user_zombie_class(id) == g_quark && can_do_skill[id] == true)
		{
			static Float:origin[3]
			entity_get_vector(id, EV_VEC_origin, origin)
			
			// Set time wait to do skill
			message_begin(MSG_ONE, g_msgbartime, _, id)
			write_byte(get_pcvar_num(time_wait))
			write_byte(0)
			message_end
			
			engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)
			write_byte(TE_BEAMCYLINDER)
			engfunc(EngFunc_WriteCoord, origin[0])
			engfunc(EngFunc_WriteCoord, origin[1])
			engfunc(EngFunc_WriteCoord, origin[2])
			engfunc(EngFunc_WriteCoord, origin[0])
			engfunc(EngFunc_WriteCoord, origin[1])
			engfunc(EngFunc_WriteCoord, origin[2] + get_pcvar_num(distance))
			write_short(g_beamspr)
			write_byte(0)
			write_byte(0)
			write_byte(10)
			write_byte(25)
			write_byte(0)
			write_byte(200)
			write_byte(200)
			write_byte(200)
			write_byte(200)
			write_byte(0) // speed
			message_end()
			
			new victim = -1
			new Float:current_distance
			client_print(id, print_chat, "Did") // Test Message
			while((victim = engfunc(EngFunc_FindEntityInSphere, victim, origin, get_pcvar_num(distance))) != 0) 
			{ 
				static Float:attacker_origin[3]
				static Float:victim_origin[3]
				
				pev(id, pev_origin, attacker_origin)
				pev(victim, pev_origin, victim_origin)
				current_distance = get_distance_f(attacker_origin, victim_origin)
				
				if(current_distance <= distance)
				{
					set_user_maxspeed(victim, -1.0)
				}
			}
			client_print(id, print_chat, "Did, %f", current_distance) // Test Message 2
			can_do_skill[id] = false
			set_task(get_pcvar_float(cooldown_time), "ability_reload", id)
			
			} else {
			client_print(id, print_chat, "[Quark Zombie] You can't do your ability now. Please wait for %i", get_pcvar_num(cooldown_time))
		}
		} else {
	}
}

public ability_reload(id)
{
	if (is_user_alive(id) && zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_quark && can_do_skill[id] == false)
	{
		// Check if user is alive and a zombie with class is Quark Zombie
		client_print(id, print_chat, "[Quark Zombie] Press (G) to make your near victim can't move.")
		can_do_skill[id] = true
	}
}
 
Con zom này có đòn ulti đánh văng human đi à ? Có cần ta kiếm mdl hợp cho nó không ?
 
Hình như tôi còn giữ cái plugin nst_combo_kill ấy ở nhà.. Cũng chỉ hiện 1spr như chú Trung nói.
 
nó muốn spam để lấy nhiều post cho để = mình =))

---------- Post added at 06:59 ---------- Previous post was at 06:41 ----------

@Ryokin ơi:
- Tui điên con Quark này quá. Sau khi sài lặp while để lấy các ent trong phạm vi thì các hàm không chạy nữa. Tui để sẵn 1 cái print message để thử xem cái nào chạy thì cái đứng trước lặp chạy. còn đứng sau thì...

PHP:
#include <amxmodx>
#include <fakemeta>
#include <fun>
#include <engine>
#include <zombieplague>

#define MAX_PLAYERS 33 // Max Player 32 + 1 Server = 33

new const zclass_name[] = "Quark Zombie" // name
new const zclass_info[] = "Make Human Can't Move" // description
new const zclass_model[] = "zombie_classic1" // model
new const zclass_clawmodel[] = "v_knife_classic1.mdl" // claw model
const zclass_health = 2000 // health
const zclass_speed = 250 // speed
const Float:zclass_gravity = 1.0 // gravity
const Float:zclass_knockback = 1.0 // knockback

// Main vars
new g_quark
new g_beamspr
new bool:can_do_skill[33]
new g_msgbartime

// Main cvars
new time_wait
new cooldown_time
new distance

public plugin_init()
{
	register_plugin("[ZP] Zombie Class: Quark", "1.0", "Dias")
	register_concmd("drop", "do_skill")
	
	time_wait = register_cvar("qz_time_wait_to_do_skill", "3")
	cooldown_time = register_cvar("qz_cooldown_after_do_skill", "30")
	distance = register_cvar("qz_distance_to_do_skill", "500")
	g_msgbartime = get_user_msgid("BarTime")
}
public plugin_precache()
{
	g_quark = zp_register_zombie_class(zclass_name, zclass_info, zclass_model, zclass_clawmodel, zclass_health, zclass_speed, zclass_gravity, zclass_knockback)	
	g_beamspr = precache_model("sprites/shockwave.spr")
}

public zp_user_humanized_post(id, survivor)
{
	if (is_user_alive(id) && zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_quark)
	{
		// If user is alive and a human
		can_do_skill[id] = false
	}
}

public zp_user_infected_post(id, infector)
{
	if (is_user_alive(id) && zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_quark)
	{
		// Check if user is alive and a zombie with class is Quark Zombie
		client_print(id, print_chat, "[Quark Zombie] Press (G) to make your near victim can't move.")
		can_do_skill[id] = true
	}
}

public do_skill(id)
{
	if(is_user_alive(id) && zp_get_user_zombie(id))
	{
		if(zp_get_user_zombie_class(id) == g_quark && can_do_skill[id] == true)
		{
			static Float:origin[3]
			entity_get_vector(id, EV_VEC_origin, origin)
			
			// Set time wait to do skill
			message_begin(MSG_ONE, g_msgbartime, _, id)
			write_byte(get_pcvar_num(time_wait))
			write_byte(0)
			message_end
			
			engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)
			write_byte(TE_BEAMCYLINDER)
			engfunc(EngFunc_WriteCoord, origin[0])
			engfunc(EngFunc_WriteCoord, origin[1])
			engfunc(EngFunc_WriteCoord, origin[2])
			engfunc(EngFunc_WriteCoord, origin[0])
			engfunc(EngFunc_WriteCoord, origin[1])
			engfunc(EngFunc_WriteCoord, origin[2] + get_pcvar_num(distance))
			write_short(g_beamspr)
			write_byte(0)
			write_byte(0)
			write_byte(10)
			write_byte(25)
			write_byte(0)
			write_byte(200)
			write_byte(200)
			write_byte(200)
			write_byte(200)
			write_byte(0) // speed
			message_end()
			
			new victim = -1
			new Float:current_distance
			client_print(id, print_chat, "Did") // Test Message
			while((victim = engfunc(EngFunc_FindEntityInSphere, victim, origin, get_pcvar_num(distance))) != 0) 
			{ 
				static Float:attacker_origin[3]
				static Float:victim_origin[3]
				
				pev(id, pev_origin, attacker_origin)
				pev(victim, pev_origin, victim_origin)
				current_distance = get_distance_f(attacker_origin, victim_origin)
				
				if(current_distance <= distance)
				{
					set_user_maxspeed(victim, -1.0)
				}
			}
			client_print(id, print_chat, "Did, %f", current_distance) // Test Message 2
			can_do_skill[id] = false
			set_task(get_pcvar_float(cooldown_time), "ability_reload", id)
			
			} else {
			client_print(id, print_chat, "[Quark Zombie] You can't do your ability now. Please wait for %i", get_pcvar_num(cooldown_time))
		}
		} else {
	}
}

public ability_reload(id)
{
	if (is_user_alive(id) && zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_quark && can_do_skill[id] == false)
	{
		// Check if user is alive and a zombie with class is Quark Zombie
		client_print(id, print_chat, "[Quark Zombie] Press (G) to make your near victim can't move.")
		can_do_skill[id] = true
	}
}
sax, code gì mà lung tung hết cả lên
- check distance = float ko phải num
- đoạn check cooldown thì else của dòng này thôi
PHP:
 if(can_do_skill[id] == true)
- và còn 1 số vấn đề khác...
@tin
PHP:
#include <amxmodx>

new const kill_spr[] = "sprites/.."; //kill icon viet vao day
const TASK_KILLICON = 8910;
new gMsgStatusIcon;

public plugin_init() 
{
	register_plugin("kill icon show", "1.0", "Ryokin")
	gMsgStatusIcon = get_user_msgid("StatusIcon");
}

public client_death(killer, victim)
{
	if((killer == victim) || !is_user_connected(killer)) 
		return;
	 
	message_begin(MSG_ONE, gMsgStatusIcon, {0,0,0}, killer);
	write_byte(1); // status (0=hide, 1=show, 2=flash)
	write_string(kill_spr); // sprite name
	message_end();
	
	if(task_exists(killer+TASK_KILLICON))
		remove_task(killer+TASK_KILLICON);
	set_task(5.0, "hide_icon", killer+TASK_KILLICON);
} 

public hide_icon(taskid)
{
	new id = taskid - TASK_KILLICON; 
	message_begin(MSG_ONE, gMsgStatusIcon, {0,0,0},id);
	write_byte(0); // status (0=hide, 1=show, 2=flash)
	write_string(kill_spr); // sprite name
	message_end();
}
kill icon đây nè, giảm bớt sạch luôn
 
Chỉnh sửa cuối:
@ryokin:
- Sửa hộ tui đi :|.
Cái code get ent trong phạm vi của ông tui chưa làm dc
 
Vì Minh nói không rõ nên tưởng là mua C4.. Plugin trên đó có thể nói ngắn gọn là "ask for c4".
 
Back
Top