[CS MOD] CSO-NST Refresh Edition [2011] - A new thread

  • Thread starter Thread starter Orpheus
  • Ngày gửi Ngày gửi
Status
Không mở trả lời sau này.
Copy that. Bây giờ mọi người trong nhóm cũng chỉ tập trung dev cái NST WPN và ZM3 thôi..



:-j
Từ nay có gì cứ viết lên tường của tôi trên fb cho đỡ cần ghi vào nhé:|
 
Đang định bảo là sau này làm việc theo kiểu thông báo theo gạch đầu dòng có khi dễ nhìn hơn... Viết ra notepad những thứ khắc phục/cần làm <------> Thông báo/change log lại cũng bằng notepad.
 
Có ai biết cái phần SHOW RADAR như trong CSO NST bên Tàu làm không ? :)
cái này là cả mh lẫn plugins zb3 link lại vs nhau
dùng :
_Hud_StudioEvent__EventCode__d__En
_overview_boxzoom
_overview_playerzoom
_overview_toggle
_overview_height
_overview_width
_hud_zoom
_hud_widthnumber
_drawradar
_hideradar
=> đoán chúng dùng những fun này thôi
Chủ yếu là chúng lấy các tham số từ overview
Vd: nhập các tham số từ cs_italy.txt vào mh
PHP:
// overview description file for cs_italy.bsp

global 
{
	ZOOM	1.76
	ORIGIN	-212 	243	-240
	ROTATED	0
}

layer 
{
	IMAGE	"overviews/cs_italy.bmp"
	HEIGHT	-240
}
Thực ra ngồi chơi tí cũng biết thôi mà, lấy 1 cái map trên bana2 về rồi copy vào cstrike, *đừng coppy thư mục overview => mục đích để test xem nó có draw radar đc ko* Vào game chắc chắn cái radar sẽ chỉ có mỗi cái ô vuông ko :))
 
^
AWESOME .
Để ý rằng cái radar overview của Zm3 origin nó show vị trí của teammates và vị trí teammate bị infect cũng không đúng đâu... nó bị lệch đi vài cm trên màn hình :-?
 
bản nhái lại thì sao chuẩn bằng bản gốc, nhưng nếu đó là quan sát kỹ vs dân exp, nghiệp dư chỉ biết vào chơi thôi ;)) vs lại bọn nó đã dev xong đâu ;))
 
Không đâu, tôi đang nói CSO TW cơ chứ không phải mấy bản phát triển từ CS \:d/... Nó lệch đi vài cm nhưng mà vẫn biết được chính xác nó ở đâu.
 
Tôi khoái radar ở css hơn, khi mình di chuyển nó show cả vệt trắng chỉ rõ những đường mình đi, vs lại nhìn nó cũng hd hơn :">
 
@Chiếp: có thể tôi sẽ đổi tên mấy cái hàm ông đưa đó.
 
Zombie Tank :
PHP:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>
#include <nst_zombie>
#include <metahook>
#include <nst_wpn>
#define PLUGIN "NST Zombie Class Tank"
#define VERSION "1.0"
#define AUTHOR "NST"


new const CONFIG_NAME[] = "[Tank Zombie]"
new spr_skill[] = "g_fastrun"
new idclass
new zombie_name[64], zombie_model[64], zombie_health, zombie_sex, zombie_modelindex, zombie_boss, Float:zombie_gravity, Float:zombie_speed, Float:zombie_knockback, zombie_sound_evolution[64],
zombie_sound_death1[64], zombie_sound_death2[64], zombie_sound_hurt1[64], zombie_sound_hurt2[64], zombie_sound_heal[64],
Float:fastrun_time, Float:fastrun_timewait, Float:fastrun_speed, sound_fastrun_start[64], Array:sound_fastrun_heartbeat, fastrun_dmg,
Array:fastrun_glowshell_color, fastrun_fov

new g_fastrun[33], g_fastrun_wait[33],g_current_speed[33]

// Task offsets
enum (+= 100)
{
	TASK_FASTRUN = 2000,
	TASK_FASTRUN_HEARTBEAT,
	TASK_FASTRUN_WAIT,
	TASK_BOT_USE_SKILL
}
// IDs inside tasks
#define ID_FASTRUN (taskid - TASK_FASTRUN)
#define ID_FASTRUN_HEARTBEAT (taskid - TASK_FASTRUN_HEARTBEAT)
#define ID_FASTRUN_WAIT (taskid - TASK_FASTRUN_WAIT)
#define ID_BOT_USE_SKILL (taskid - TASK_BOT_USE_SKILL)

public nst_zb_user_infected(id,inf)
{
	if(idclass==nst_zb_get_user_zombie_class(id)&&MH_IsMetaHookPlayer(id))
	{
		new class=djb_cus_ui_get_zombie_class(id)
		MH_NewZBUI(id,"zbs_speedup",1,1,1,2,9999.0,class)
				MH_NewZBUI(id,"zbs_tancel",1,4,1,2,0.0,class)
		remove_task(id+888)
	}
}
public djb_zbu_selectclass(id)
{
	if(idclass==nst_zb_get_user_zombie_class(id)&&MH_IsMetaHookPlayer(id))
	{
		new class=djb_cus_ui_get_zombie_class(id)
		MH_NewZBUI(id,"zbs_speedup",1,1,1,2,9999.0,class)
		MH_NewZBUI(id,"zbs_tancel",1,4,1,2,0.0,class)
		remove_task(id+888)
	}
}
public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	// Language files
	register_dictionary(LANG_FILE)
	
	
	// Events
	register_logevent("logevent_round_start",2, "1=Round_Start")
	register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
	register_event("DeathMsg", "Death", "a")
	register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
	
	register_clcmd("drop", "cmd_fastrun")
}
public plugin_precache()
{
	fastrun_glowshell_color = ArrayCreate(1, 1)
	sound_fastrun_heartbeat = ArrayCreate(64, 1)
	
	load_customization_from_files()
	
	new i, buffer[100]
	for (i = 0; i < ArraySize(sound_fastrun_heartbeat); i++)
	{
		ArrayGetString(sound_fastrun_heartbeat, i, buffer, charsmax(buffer))
		engfunc(EngFunc_PrecacheSound, buffer)
	}
	engfunc(EngFunc_PrecacheSound, sound_fastrun_start)
	
	// register zombie class
	new modrun = nst_zb_get_mod()
	if (modrun==NSTZB_ZB3) idclass = nst_zb3_register_zombie_class(zombie_name, zombie_model, zombie_gravity, zombie_speed, zombie_knockback, zombie_sound_death1, zombie_sound_death2, zombie_sound_hurt1, zombie_sound_hurt2, zombie_sound_heal, zombie_sound_evolution, zombie_sex, zombie_modelindex)
	if (modrun==NSTZB_ZBU) idclass = nst_zbu_register_zombie_class(zombie_name, zombie_model, zombie_health, zombie_gravity, zombie_speed, zombie_knockback, zombie_sound_death1, zombie_sound_death2, zombie_sound_hurt1, zombie_sound_hurt2, zombie_sound_heal, zombie_sex, zombie_modelindex)
	if (modrun==NSTZB_ZBS) idclass = nst_zbs_register_zombie_class(zombie_name, zombie_model, zombie_health, zombie_gravity, zombie_speed, zombie_knockback, zombie_sound_death1, zombie_sound_death2, zombie_sound_hurt1, zombie_sound_hurt2, zombie_sound_heal, zombie_sex, zombie_modelindex, zombie_boss)

}
public event_round_start()
{
	for (new id=1; id<33; id++)
	{
		if (!is_user_connected(id)) continue;
		
		reset_value_player(id)
	}
}
public logevent_round_start()
{
	for (new id=1; id<33; id++)
	{
		if (!is_user_connected(id)) continue;
		if (is_user_bot(id))
		{
			if (task_exists(id+TASK_BOT_USE_SKILL)) remove_task(id+TASK_BOT_USE_SKILL)
			set_task(float(random_num(5,15)), "bot_use_skill", id+TASK_BOT_USE_SKILL)
		}
	}
}
public Death()
{
	new victim = read_data(2) 
	
	reset_value_player(victim)
}
reset_value_player(id)
{
	if (task_exists(id+TASK_FASTRUN)) remove_task(id+TASK_FASTRUN)
	if (task_exists(id+TASK_FASTRUN_HEARTBEAT)) remove_task(id+TASK_FASTRUN_HEARTBEAT)
	if (task_exists(id+TASK_FASTRUN_WAIT)) remove_task(id+TASK_FASTRUN_WAIT)
	if(!nst_zb_get_take_damage()) if (task_exists(id+TASK_BOT_USE_SKILL)) remove_task(id+TASK_BOT_USE_SKILL)
	remove_task(id+888)
	if(MH_IsMetaHookPlayer(id))
	{
		MH_DrawRetina(id,0,1)
	}
	
	g_fastrun[id] = 0
	g_fastrun_wait[id] = 0
}
// bot use skill
public bot_use_skill(taskid)
{
	new id = ID_BOT_USE_SKILL
	if (!is_user_bot(id)) return;

	cmd_fastrun(id)
	if (task_exists(taskid)) remove_task(taskid)
	set_task(float(random_num(5,15)), "bot_use_skill", id+TASK_BOT_USE_SKILL)
}

// #################### FASTRUN PUBLIC ####################
// Cmd fast run
public cmd_fastrun(id)
{
	if (!is_user_alive(id) || !nst_zb_get_take_damage()) return PLUGIN_CONTINUE

	if (nst_zb_get_mod()==NSTZB_ZBS) fastrun_dmg = 0
	new health = get_user_health(id) - fastrun_dmg
	if (idclass==nst_zb_get_user_zombie_class(id) && nst_zb_get_user_zombie(id) && health>0 && !g_fastrun[id] && !g_fastrun_wait[id])
	{
		// set current speed
		pev(id, pev_maxspeed, g_current_speed[id])
		
		// set fastrun
		g_fastrun[id] = 1
		
		// set glow shell
		new color[3]
		color[0] = ArrayGetCell(fastrun_glowshell_color, 0)
		color[1] = ArrayGetCell(fastrun_glowshell_color, 1)
		color[2] = ArrayGetCell(fastrun_glowshell_color, 2)
		fm_set_rendering(id, kRenderFxGlowShell, color[0], color[1], color[2], kRenderNormal, 0)

		// set effect
		EffectFastrun(id, fastrun_fov)
		
		// set health
		fm_set_user_health(id, health)
		
		// task fastrun
		new Float:timerun, level
		level = nst_zb_get_user_level(id)
		if (level==1) timerun = fastrun_time*0.5
		else timerun = fastrun_time
		if (task_exists(id+TASK_FASTRUN)) remove_task(id+TASK_FASTRUN)
		set_task(timerun, "RemoveFastRun", id+TASK_FASTRUN)
		new Float:timewait = fastrun_timewait
		if (nst_zb_get_user_level(id)>1) timewait = 0.5
		if(MH_IsMetaHookPlayer(id))
		{
			new class=djb_cus_ui_get_zombie_class(id)
			remove_task(id+888)
			MH_NewZBUI(id,"zbs_speedup",1,1,1,2,0.0,class)
			MH_NewZBUI(id,"zbs_speedup",1,4,1,2,timerun+timewait,class)
			MH_DrawRetina(id,1,1)
			MH_DrawRetina(id,1,1)
		}
		
		// play sound start
		PlayEmitSound(id, sound_fastrun_start)
		
		// task fastrun sound heartbeat
		if (task_exists(id+TASK_FASTRUN_HEARTBEAT)) remove_task(id+TASK_FASTRUN_HEARTBEAT)
		set_task(2.0, "FastRunHeartBeat", id+TASK_FASTRUN_HEARTBEAT, _, _, "b")

		return PLUGIN_HANDLED
	}
	
	return PLUGIN_CONTINUE
}
public RemoveFastRun(taskid)
{
	new id = ID_FASTRUN

	g_fastrun[id] = 0
	set_pev(id, pev_maxspeed, g_current_speed[id])
	fm_set_rendering(id)
	EffectFastrun(id)
	if (task_exists(taskid)) remove_task(taskid)
	
	new Float:timewait = fastrun_timewait
	if (nst_zb_get_user_level(id)>1) timewait = 0.5
	g_fastrun_wait[id] = 1
	if (task_exists(id+TASK_FASTRUN_WAIT)) remove_task(id+TASK_FASTRUN_WAIT)
	set_task(timewait, "RemoveWaitFastRun", id+TASK_FASTRUN_WAIT)
	if(MH_IsMetaHookPlayer(id))
	{
		MH_DrawRetina(id,0,1)
	}
}
public RemoveWaitFastRun(taskid)
{
	new id = ID_FASTRUN_WAIT
	g_fastrun_wait[id] = 0
	if (task_exists(taskid)) remove_task(taskid)
	if(MH_IsMetaHookPlayer(id))
	{
		new class=djb_cus_ui_get_zombie_class(id)
		if(idclass!=nst_zb_get_user_zombie_class(id)) return
		MH_NewZBUI(id,"zbs_speedup",1,3,1,2,1.0,class)
		set_task(1.0,"Fade_Icon",id+888,"",0,"a",2)
		set_task(3.0,"Fade_Icon_End",id+888)
		
	}
}
public Fade_Icon(idx)
{
	new id=idx-888
	if(idclass!=nst_zb_get_user_zombie_class(id)) return
	new class=djb_cus_ui_get_zombie_class(id)
	MH_NewZBUI(id,"zbs_speedup",1,3,1,2,1.0,class)
}
public Fade_Icon_End(idx)
{
	new id=idx-888
	if(idclass!=nst_zb_get_user_zombie_class(id)) return
	new class=djb_cus_ui_get_zombie_class(id)
	MH_NewZBUI(id,"zbs_speedup",1,1,1,2,9999.0,class)
}
public FastRunHeartBeat(taskid)
{
	new id = ID_FASTRUN_HEARTBEAT
	
	if (g_fastrun[id])
	{
		new sound[64]
		ArrayGetString(sound_fastrun_heartbeat, random(ArraySize(sound_fastrun_heartbeat)), sound, charsmax(sound))
		PlayEmitSound(id, sound)
	}
	else if (task_exists(taskid)) remove_task(taskid)
}
// set speed
public fw_PlayerPreThink(id)
{
	if (!is_user_alive(id)) return;
	
	if (idclass==nst_zb_get_user_zombie_class(id) && nst_zb_get_user_zombie(id) && g_fastrun[id])
	{
		set_pev(id, pev_maxspeed, fastrun_speed)
	}
}
// MAIN FUNCTION

PlayEmitSound(id, const sound[])
{
	emit_sound(id, CHAN_VOICE, sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
fm_set_user_health(id, health)
{
	(health > 0) ? set_pev(id, pev_health, float(health)) : dllfunc(DLLFunc_ClientKill, id);
}
fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16) 
{
	new Float:RenderColor[3];
	RenderColor[0] = float(r);
	RenderColor[1] = float(g);
	RenderColor[2] = float(b);

	set_pev(entity, pev_renderfx, fx);
	set_pev(entity, pev_rendercolor, RenderColor);
	set_pev(entity, pev_rendermode, render);
	set_pev(entity, pev_renderamt, float(amount));

	return 1;
}
EffectFastrun(id, num = 90)
{
	message_begin(MSG_ONE, get_user_msgid("SetFOV"), {0,0,0}, id)
	write_byte(num)
	message_end()
}
// OTHER PUNLIC
public ww(id)
{
	for (new id = 1; id <= 32; id++)
	{
		cmd_fastrun(id)
	}
	client_print(id, print_chat, "[%s][%s][%i][%i][%i]", zombie_sound_death2, zombie_model, zombie_gravity, zombie_speed, zombie_knockback)
	
}

// LOAD CONFIG
load_customization_from_files()
{
	// Build customization file path
	new path[64]
	get_configsdir(path, charsmax(path))
	format(path, charsmax(path), "%s/%s", path, CLASS_FILE)
	
	// File not present
	if (!file_exists(path))
	{
		new error[100]
		formatex(error, charsmax(error), "Cannot load customization file %s!", path)
		set_fail_state(error)
		return;
	}
	
	// Set up some vars to hold parsing info
	new linedata[1024], key[64], value[960], section
	
	// Open customization file for reading
	new file = fopen(path, "rt")
	
	while (file && !feof(file))
	{
		// Read one line at a time
		fgets(file, linedata, charsmax(linedata))
		
		// Replace newlines with a null character to prevent headaches
		replace(linedata, charsmax(linedata), "^n", "")
		
		// Blank line or comment
		if (!linedata[0] || linedata[0] == ';') continue;
		
		// New section starting
		if (equali(linedata, CONFIG_NAME))
		{
			section = 1
			continue;
		}
		else if (linedata[0] == '[')
		{
			if (section)
			{
				section = 0
				return;
			}
			continue;
		}
		
		if (section)
		{
			// Get key and value(s)
			strtok(linedata, key, charsmax(key), value, charsmax(value), '=')
			
			// Trim spaces
			trim(key)
			trim(value)
			
			// set value
			if (equal(key, "NAME"))
				format(zombie_name, charsmax(zombie_name), "%s", value)
			else if (equal(key, "MODEL"))
				format(zombie_model, charsmax(zombie_model), "%s", value)
			else if (equal(key, "SET_MODEL_INDEX"))
				zombie_modelindex = str_to_num(value)
			else if (equal(key, "HEALTH"))
				zombie_health = str_to_num(value)
			else if (equal(key, "SEX"))
				zombie_sex = str_to_num(value)
			else if (equal(key, "BOSS"))
				zombie_boss = str_to_num(value)
			else if (equal(key, "GRAVITY"))
				zombie_gravity = str_to_float(value)
			else if (equal(key, "SPEED"))
				zombie_speed = str_to_float(value)
			else if (equal(key, "KNOCK_BACK"))
				zombie_knockback = str_to_float(value)
			else if (equal(key, "SOUND_HURT1"))
				format(zombie_sound_hurt1, charsmax(zombie_sound_hurt1), "%s", value)
			else if (equal(key, "SOUND_HURT2"))
				format(zombie_sound_hurt2, charsmax(zombie_sound_hurt2), "%s", value)
			else if (equal(key, "SOUND_DEATH1"))
				format(zombie_sound_death1, charsmax(zombie_sound_death1), "%s", value)
			else if (equal(key, "SOUND_DEATH2"))
				format(zombie_sound_death2, charsmax(zombie_sound_death2), "%s", value)
			else if (equal(key, "SOUND_HEAL"))
				format(zombie_sound_heal, charsmax(zombie_sound_heal), "%s", value)
			else if (equal(key, "SOUND_EVOLUTION"))
				format(zombie_sound_evolution, charsmax(zombie_sound_evolution), "%s", value)

			else if (equal(key, "FASTRUN_TIME"))
				fastrun_time = str_to_float(value)
			else if (equal(key, "FASTRUN_TIME_WAIT"))
				fastrun_timewait = str_to_float(value)
			else if (equal(key, "FASTRUN_DAMAGE"))
				fastrun_dmg = str_to_num(value)
			else if (equal(key, "FASTRUN_SPEED"))
				fastrun_speed = str_to_float(value)
			else if (equal(key, "FASTRUN_FOV"))
				fastrun_fov = str_to_num(value)
			else if (equal(key, "SOUND_FASTRUN_START"))
				format(sound_fastrun_start, charsmax(sound_fastrun_start), "%s", value)
			else if (equal(key, "SOUND_FASTRUN_HEARTBEAT"))
			{
				while (value[0] != 0 && strtok(value, key, charsmax(key), value, charsmax(value), ','))
				{
					trim(key)
					trim(value)
					ArrayPushString(sound_fastrun_heartbeat, key)
				}
			}
			else if (equal(key, "FASTRUN_GLOWSHELL_COLOR"))
			{
				while (value[0] != 0 && strtok(value, key, charsmax(key), value, charsmax(value), ','))
				{
					trim(key)
					trim(value)
					ArrayPushCell(fastrun_glowshell_color, str_to_num(key))
				}
			}

		}
		else continue;

	}
	if (file) fclose(file)
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
 
Zombie Tank :
PHP:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>
#include <nst_zombie>
#include <metahook>
#include <nst_wpn>
#define PLUGIN "NST Zombie Class Tank"
#define VERSION "1.0"
#define AUTHOR "NST"


new const CONFIG_NAME[] = "[Tank Zombie]"
new spr_skill[] = "g_fastrun"
new idclass
new zombie_name[64], zombie_model[64], zombie_health, zombie_sex, zombie_modelindex, zombie_boss, Float:zombie_gravity, Float:zombie_speed, Float:zombie_knockback, zombie_sound_evolution[64],
zombie_sound_death1[64], zombie_sound_death2[64], zombie_sound_hurt1[64], zombie_sound_hurt2[64], zombie_sound_heal[64],
Float:fastrun_time, Float:fastrun_timewait, Float:fastrun_speed, sound_fastrun_start[64], Array:sound_fastrun_heartbeat, fastrun_dmg,
Array:fastrun_glowshell_color, fastrun_fov

new g_fastrun[33], g_fastrun_wait[33],g_current_speed[33]

// Task offsets
enum (+= 100)
{
	TASK_FASTRUN = 2000,
	TASK_FASTRUN_HEARTBEAT,
	TASK_FASTRUN_WAIT,
	TASK_BOT_USE_SKILL
}
// IDs inside tasks
#define ID_FASTRUN (taskid - TASK_FASTRUN)
#define ID_FASTRUN_HEARTBEAT (taskid - TASK_FASTRUN_HEARTBEAT)
#define ID_FASTRUN_WAIT (taskid - TASK_FASTRUN_WAIT)
#define ID_BOT_USE_SKILL (taskid - TASK_BOT_USE_SKILL)

public nst_zb_user_infected(id,inf)
{
	if(idclass==nst_zb_get_user_zombie_class(id)&&MH_IsMetaHookPlayer(id))
	{
		new class=djb_cus_ui_get_zombie_class(id)
		MH_NewZBUI(id,"zbs_speedup",1,1,1,2,9999.0,class)
				MH_NewZBUI(id,"zbs_tancel",1,4,1,2,0.0,class)
		remove_task(id+888)
	}
}
public djb_zbu_selectclass(id)
{
	if(idclass==nst_zb_get_user_zombie_class(id)&&MH_IsMetaHookPlayer(id))
	{
		new class=djb_cus_ui_get_zombie_class(id)
		MH_NewZBUI(id,"zbs_speedup",1,1,1,2,9999.0,class)
		MH_NewZBUI(id,"zbs_tancel",1,4,1,2,0.0,class)
		remove_task(id+888)
	}
}
public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	// Language files
	register_dictionary(LANG_FILE)
	
	
	// Events
	register_logevent("logevent_round_start",2, "1=Round_Start")
	register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
	register_event("DeathMsg", "Death", "a")
	register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
	
	register_clcmd("drop", "cmd_fastrun")
}
public plugin_precache()
{
	fastrun_glowshell_color = ArrayCreate(1, 1)
	sound_fastrun_heartbeat = ArrayCreate(64, 1)
	
	load_customization_from_files()
	
	new i, buffer[100]
	for (i = 0; i < ArraySize(sound_fastrun_heartbeat); i++)
	{
		ArrayGetString(sound_fastrun_heartbeat, i, buffer, charsmax(buffer))
		engfunc(EngFunc_PrecacheSound, buffer)
	}
	engfunc(EngFunc_PrecacheSound, sound_fastrun_start)
	
	// register zombie class
	new modrun = nst_zb_get_mod()
	if (modrun==NSTZB_ZB3) idclass = nst_zb3_register_zombie_class(zombie_name, zombie_model, zombie_gravity, zombie_speed, zombie_knockback, zombie_sound_death1, zombie_sound_death2, zombie_sound_hurt1, zombie_sound_hurt2, zombie_sound_heal, zombie_sound_evolution, zombie_sex, zombie_modelindex)
	if (modrun==NSTZB_ZBU) idclass = nst_zbu_register_zombie_class(zombie_name, zombie_model, zombie_health, zombie_gravity, zombie_speed, zombie_knockback, zombie_sound_death1, zombie_sound_death2, zombie_sound_hurt1, zombie_sound_hurt2, zombie_sound_heal, zombie_sex, zombie_modelindex)
	if (modrun==NSTZB_ZBS) idclass = nst_zbs_register_zombie_class(zombie_name, zombie_model, zombie_health, zombie_gravity, zombie_speed, zombie_knockback, zombie_sound_death1, zombie_sound_death2, zombie_sound_hurt1, zombie_sound_hurt2, zombie_sound_heal, zombie_sex, zombie_modelindex, zombie_boss)

}
public event_round_start()
{
	for (new id=1; id<33; id++)
	{
		if (!is_user_connected(id)) continue;
		
		reset_value_player(id)
	}
}
public logevent_round_start()
{
	for (new id=1; id<33; id++)
	{
		if (!is_user_connected(id)) continue;
		if (is_user_bot(id))
		{
			if (task_exists(id+TASK_BOT_USE_SKILL)) remove_task(id+TASK_BOT_USE_SKILL)
			set_task(float(random_num(5,15)), "bot_use_skill", id+TASK_BOT_USE_SKILL)
		}
	}
}
public Death()
{
	new victim = read_data(2) 
	
	reset_value_player(victim)
}
reset_value_player(id)
{
	if (task_exists(id+TASK_FASTRUN)) remove_task(id+TASK_FASTRUN)
	if (task_exists(id+TASK_FASTRUN_HEARTBEAT)) remove_task(id+TASK_FASTRUN_HEARTBEAT)
	if (task_exists(id+TASK_FASTRUN_WAIT)) remove_task(id+TASK_FASTRUN_WAIT)
	if(!nst_zb_get_take_damage()) if (task_exists(id+TASK_BOT_USE_SKILL)) remove_task(id+TASK_BOT_USE_SKILL)
	remove_task(id+888)
	if(MH_IsMetaHookPlayer(id))
	{
		MH_DrawRetina(id,0,1)
	}
	
	g_fastrun[id] = 0
	g_fastrun_wait[id] = 0
}
// bot use skill
public bot_use_skill(taskid)
{
	new id = ID_BOT_USE_SKILL
	if (!is_user_bot(id)) return;

	cmd_fastrun(id)
	if (task_exists(taskid)) remove_task(taskid)
	set_task(float(random_num(5,15)), "bot_use_skill", id+TASK_BOT_USE_SKILL)
}

// #################### FASTRUN PUBLIC ####################
// Cmd fast run
public cmd_fastrun(id)
{
	if (!is_user_alive(id) || !nst_zb_get_take_damage()) return PLUGIN_CONTINUE

	if (nst_zb_get_mod()==NSTZB_ZBS) fastrun_dmg = 0
	new health = get_user_health(id) - fastrun_dmg
	if (idclass==nst_zb_get_user_zombie_class(id) && nst_zb_get_user_zombie(id) && health>0 && !g_fastrun[id] && !g_fastrun_wait[id])
	{
		// set current speed
		pev(id, pev_maxspeed, g_current_speed[id])
		
		// set fastrun
		g_fastrun[id] = 1
		
		// set glow shell
		new color[3]
		color[0] = ArrayGetCell(fastrun_glowshell_color, 0)
		color[1] = ArrayGetCell(fastrun_glowshell_color, 1)
		color[2] = ArrayGetCell(fastrun_glowshell_color, 2)
		fm_set_rendering(id, kRenderFxGlowShell, color[0], color[1], color[2], kRenderNormal, 0)

		// set effect
		EffectFastrun(id, fastrun_fov)
		
		// set health
		fm_set_user_health(id, health)
		
		// task fastrun
		new Float:timerun, level
		level = nst_zb_get_user_level(id)
		if (level==1) timerun = fastrun_time*0.5
		else timerun = fastrun_time
		if (task_exists(id+TASK_FASTRUN)) remove_task(id+TASK_FASTRUN)
		set_task(timerun, "RemoveFastRun", id+TASK_FASTRUN)
		new Float:timewait = fastrun_timewait
		if (nst_zb_get_user_level(id)>1) timewait = 0.5
		if(MH_IsMetaHookPlayer(id))
		{
			new class=djb_cus_ui_get_zombie_class(id)
			remove_task(id+888)
			MH_NewZBUI(id,"zbs_speedup",1,1,1,2,0.0,class)
			MH_NewZBUI(id,"zbs_speedup",1,4,1,2,timerun+timewait,class)
			MH_DrawRetina(id,1,1)
			MH_DrawRetina(id,1,1)
		}
		
		// play sound start
		PlayEmitSound(id, sound_fastrun_start)
		
		// task fastrun sound heartbeat
		if (task_exists(id+TASK_FASTRUN_HEARTBEAT)) remove_task(id+TASK_FASTRUN_HEARTBEAT)
		set_task(2.0, "FastRunHeartBeat", id+TASK_FASTRUN_HEARTBEAT, _, _, "b")

		return PLUGIN_HANDLED
	}
	
	return PLUGIN_CONTINUE
}
public RemoveFastRun(taskid)
{
	new id = ID_FASTRUN

	g_fastrun[id] = 0
	set_pev(id, pev_maxspeed, g_current_speed[id])
	fm_set_rendering(id)
	EffectFastrun(id)
	if (task_exists(taskid)) remove_task(taskid)
	
	new Float:timewait = fastrun_timewait
	if (nst_zb_get_user_level(id)>1) timewait = 0.5
	g_fastrun_wait[id] = 1
	if (task_exists(id+TASK_FASTRUN_WAIT)) remove_task(id+TASK_FASTRUN_WAIT)
	set_task(timewait, "RemoveWaitFastRun", id+TASK_FASTRUN_WAIT)
	if(MH_IsMetaHookPlayer(id))
	{
		MH_DrawRetina(id,0,1)
	}
}
public RemoveWaitFastRun(taskid)
{
	new id = ID_FASTRUN_WAIT
	g_fastrun_wait[id] = 0
	if (task_exists(taskid)) remove_task(taskid)
	if(MH_IsMetaHookPlayer(id))
	{
		new class=djb_cus_ui_get_zombie_class(id)
		if(idclass!=nst_zb_get_user_zombie_class(id)) return
		MH_NewZBUI(id,"zbs_speedup",1,3,1,2,1.0,class)
		set_task(1.0,"Fade_Icon",id+888,"",0,"a",2)
		set_task(3.0,"Fade_Icon_End",id+888)
		
	}
}
public Fade_Icon(idx)
{
	new id=idx-888
	if(idclass!=nst_zb_get_user_zombie_class(id)) return
	new class=djb_cus_ui_get_zombie_class(id)
	MH_NewZBUI(id,"zbs_speedup",1,3,1,2,1.0,class)
}
public Fade_Icon_End(idx)
{
	new id=idx-888
	if(idclass!=nst_zb_get_user_zombie_class(id)) return
	new class=djb_cus_ui_get_zombie_class(id)
	MH_NewZBUI(id,"zbs_speedup",1,1,1,2,9999.0,class)
}
public FastRunHeartBeat(taskid)
{
	new id = ID_FASTRUN_HEARTBEAT
	
	if (g_fastrun[id])
	{
		new sound[64]
		ArrayGetString(sound_fastrun_heartbeat, random(ArraySize(sound_fastrun_heartbeat)), sound, charsmax(sound))
		PlayEmitSound(id, sound)
	}
	else if (task_exists(taskid)) remove_task(taskid)
}
// set speed
public fw_PlayerPreThink(id)
{
	if (!is_user_alive(id)) return;
	
	if (idclass==nst_zb_get_user_zombie_class(id) && nst_zb_get_user_zombie(id) && g_fastrun[id])
	{
		set_pev(id, pev_maxspeed, fastrun_speed)
	}
}
// MAIN FUNCTION

PlayEmitSound(id, const sound[])
{
	emit_sound(id, CHAN_VOICE, sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
fm_set_user_health(id, health)
{
	(health > 0) ? set_pev(id, pev_health, float(health)) : dllfunc(DLLFunc_ClientKill, id);
}
fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16) 
{
	new Float:RenderColor[3];
	RenderColor[0] = float(r);
	RenderColor[1] = float(g);
	RenderColor[2] = float(b);

	set_pev(entity, pev_renderfx, fx);
	set_pev(entity, pev_rendercolor, RenderColor);
	set_pev(entity, pev_rendermode, render);
	set_pev(entity, pev_renderamt, float(amount));

	return 1;
}
EffectFastrun(id, num = 90)
{
	message_begin(MSG_ONE, get_user_msgid("SetFOV"), {0,0,0}, id)
	write_byte(num)
	message_end()
}
// OTHER PUNLIC
public ww(id)
{
	for (new id = 1; id <= 32; id++)
	{
		cmd_fastrun(id)
	}
	client_print(id, print_chat, "[%s][%s][%i][%i][%i]", zombie_sound_death2, zombie_model, zombie_gravity, zombie_speed, zombie_knockback)
	
}

// LOAD CONFIG
load_customization_from_files()
{
	// Build customization file path
	new path[64]
	get_configsdir(path, charsmax(path))
	format(path, charsmax(path), "%s/%s", path, CLASS_FILE)
	
	// File not present
	if (!file_exists(path))
	{
		new error[100]
		formatex(error, charsmax(error), "Cannot load customization file %s!", path)
		set_fail_state(error)
		return;
	}
	
	// Set up some vars to hold parsing info
	new linedata[1024], key[64], value[960], section
	
	// Open customization file for reading
	new file = fopen(path, "rt")
	
	while (file && !feof(file))
	{
		// Read one line at a time
		fgets(file, linedata, charsmax(linedata))
		
		// Replace newlines with a null character to prevent headaches
		replace(linedata, charsmax(linedata), "^n", "")
		
		// Blank line or comment
		if (!linedata[0] || linedata[0] == ';') continue;
		
		// New section starting
		if (equali(linedata, CONFIG_NAME))
		{
			section = 1
			continue;
		}
		else if (linedata[0] == '[')
		{
			if (section)
			{
				section = 0
				return;
			}
			continue;
		}
		
		if (section)
		{
			// Get key and value(s)
			strtok(linedata, key, charsmax(key), value, charsmax(value), '=')
			
			// Trim spaces
			trim(key)
			trim(value)
			
			// set value
			if (equal(key, "NAME"))
				format(zombie_name, charsmax(zombie_name), "%s", value)
			else if (equal(key, "MODEL"))
				format(zombie_model, charsmax(zombie_model), "%s", value)
			else if (equal(key, "SET_MODEL_INDEX"))
				zombie_modelindex = str_to_num(value)
			else if (equal(key, "HEALTH"))
				zombie_health = str_to_num(value)
			else if (equal(key, "SEX"))
				zombie_sex = str_to_num(value)
			else if (equal(key, "BOSS"))
				zombie_boss = str_to_num(value)
			else if (equal(key, "GRAVITY"))
				zombie_gravity = str_to_float(value)
			else if (equal(key, "SPEED"))
				zombie_speed = str_to_float(value)
			else if (equal(key, "KNOCK_BACK"))
				zombie_knockback = str_to_float(value)
			else if (equal(key, "SOUND_HURT1"))
				format(zombie_sound_hurt1, charsmax(zombie_sound_hurt1), "%s", value)
			else if (equal(key, "SOUND_HURT2"))
				format(zombie_sound_hurt2, charsmax(zombie_sound_hurt2), "%s", value)
			else if (equal(key, "SOUND_DEATH1"))
				format(zombie_sound_death1, charsmax(zombie_sound_death1), "%s", value)
			else if (equal(key, "SOUND_DEATH2"))
				format(zombie_sound_death2, charsmax(zombie_sound_death2), "%s", value)
			else if (equal(key, "SOUND_HEAL"))
				format(zombie_sound_heal, charsmax(zombie_sound_heal), "%s", value)
			else if (equal(key, "SOUND_EVOLUTION"))
				format(zombie_sound_evolution, charsmax(zombie_sound_evolution), "%s", value)

			else if (equal(key, "FASTRUN_TIME"))
				fastrun_time = str_to_float(value)
			else if (equal(key, "FASTRUN_TIME_WAIT"))
				fastrun_timewait = str_to_float(value)
			else if (equal(key, "FASTRUN_DAMAGE"))
				fastrun_dmg = str_to_num(value)
			else if (equal(key, "FASTRUN_SPEED"))
				fastrun_speed = str_to_float(value)
			else if (equal(key, "FASTRUN_FOV"))
				fastrun_fov = str_to_num(value)
			else if (equal(key, "SOUND_FASTRUN_START"))
				format(sound_fastrun_start, charsmax(sound_fastrun_start), "%s", value)
			else if (equal(key, "SOUND_FASTRUN_HEARTBEAT"))
			{
				while (value[0] != 0 && strtok(value, key, charsmax(key), value, charsmax(value), ','))
				{
					trim(key)
					trim(value)
					ArrayPushString(sound_fastrun_heartbeat, key)
				}
			}
			else if (equal(key, "FASTRUN_GLOWSHELL_COLOR"))
			{
				while (value[0] != 0 && strtok(value, key, charsmax(key), value, charsmax(value), ','))
				{
					trim(key)
					trim(value)
					ArrayPushCell(fastrun_glowshell_color, str_to_num(key))
				}
			}

		}
		else continue;

	}
	if (file) fclose(file)
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
Đồ của tùng của cổ rồi ông à:-jnói chung là các class zombie chúng nó chỉ thêm func metahook vào thôi (tui decompile hết):-j
 
Tưởng bọn nó hào phóng tặng cho ace world cái source mà mk nó ém nhất định ko post lên :(
 
@Chiếp: có thể tôi sẽ đổi tên mấy cái hàm ông đưa đó.

Này, cái type búa có thể làm hệ thống sound khác đi chút không :-??, không dùng func set sound chung chung nữa... vì hôm qua tôi thấy bất thường về sound hit quá.
 
có MTH 2.0 rồi hả =))
có khác j cái cũ ko
MTH đang dc testing nên chưa share Source code
 
Chỉnh sửa cuối:
Này, cái type búa có thể làm hệ thống sound khác đi chút không :-??, không dùng func set sound chung chung nữa... vì hôm qua tôi thấy bất thường về sound hit quá.
Nghĩa là sao hở ông:-??
có MTH 2.0 rồi hả =))
có khác j cái cũ ko
MTH đang dc testing nên chưa share Source code
MTH v40 đâu:|
 
thằng tàu khựa đã onl đếch đâu
ê mặt quá .....
PS:đúng là sắp có MTH 2.0 nhưng chỉ là test thôi
 
^
^
Khi đổi mode thì tiếng stab và slash bị giống nhau..... Cứ thử đạt đúng tên sound cho hammer rồi chơi thử xem.
Trong CSO thì hammar khi gõ gió và gõ vào tường thì sound giống nhau ( đối với stab mode và slash mode )
Còn sound khi đập vào người và zombie thì slash và stab khác nhau hoàn toàn..
 
xin xỏ mãi mới dc share cho metahook.dll v2.0
vì đây là file private nên ai cần pass pm nhé
http://www.mediafire.com/?lb5is2eb1npl2wa
Bonus thêm cái hình về source code MTH v2.0
22.jpg
 
Chỉnh sửa cuối:
Status
Không mở trả lời sau này.
Back
Top