modificare plugin[rezolvat!]

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
b[L]u
Membru, skill +1
Membru, skill +1
Posts: 314
Joined: 31 May 2010, 13:27
Detinator Steam: Nu
Has thanked: 26 times
Been thanked: 8 times

25 Sep 2010, 10:43

salut am facut o modificare la auto_round restart dar acum nu se mai aud ultimele 10 secunde 10,9,8..1 unde am gresit?
asa e modificat
| Afiseaza codul
#include <amxmodx>


#define PLUGIN "Auto Round Restart"
#define VERSION "1.0"
#define AUTHOR "FireW@ll"

#define time_delay 13
#define time_delay_hud 10

new num_time, sync, time_s

public plugin_init() 
{
	// Plugin register
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	// Event
	register_event("TextMsg","rr","a","2&#Game_C") 
	
	// Other Shit
	sync = CreateHudSyncObj();
	
	// Cvars
	num_time = register_cvar("time_for_display","30")
	check_cvars()
}

public check_cvars()
{
	if(get_pcvar_num(num_time) > 60)
		set_pcvar_num(num_time, 25)
}

public rr()
{
	time_s = get_pcvar_num(num_time)
	set_task(float(time_delay),"restart_time")
	set_task(float(time_delay_hud),"hud_rr")
}


public restart_time()
{
	if(time_s >= 0)
	{
		if(time_s == 40 || time_s == 30 || time_s == 20)
		{
			new voice_[64]
			num_to_word(time_s, voice_, 63)
			client_cmd(0, "spk ^"vox/%s _comma^"", voice_)
		}
		if(time_s > 10)
			set_hudmessage(255, 170, 0, 0.10, 0.37, 1, 6.1, 6.0)
			
		else
		if(time_s > 9)
			set_hudmessage(255, 170, 0, 0.10, 0.39, 1, 6.1, 6.0)
			
		else
		if(time_s > 8)
			set_hudmessage(255, 170, 0, 0.10, 0.41, 1, 6.1, 6.0)
			
		else
		if(time_s > 7)
			set_hudmessage(255, 170, 0, 0.10, 0.43, 1, 6.1, 6.0)
			
		else
		if(time_s > 6)
			set_hudmessage(255, 170, 0, 0.10, 0.46, 1, 6.1, 6.0)
			
		else
		if(time_s > 5)
			set_hudmessage(255, 170, 0, 0.10, 0.49, 1, 6.1, 6.0)
			
		else
		if(time_s > 4)
			set_hudmessage(255, 0, 0, 0.10, 0.51, 1, 6.1, 6.0)
			
		else
		if(time_s > 3)
			set_hudmessage(255, 0, 0, 0.10, 0.54, 1, 6.1, 6.0)
		else
		if(time_s > 2) 
			set_hudmessage(255, 0, 0, 0.10, 0.57, 1, 6.1, 6.0)
			
		else
		if(time_s > 1) 
		{
			set_hudmessage(255, 0, 0, 0.10, 0.60, 1, 6.1, 6.0)
			set_task(1.0,"hud_")
		}
			
		if(time_s < 1)
		{
			set_cvar_float("sv_restartround",2.0)
		}
		ShowSyncHudMsg(0, sync, "[Restart in %d]", time_s);
		--time_s;
		set_task(1.0,"restart_time")
	}
	return PLUGIN_HANDLED;
}



public hud_()
{
	set_hudmessage(0, 255, 0, -1.0, 0.0, 1, 6.0, 3.0)
	show_hudmessage(0, "**RESTART** GL & HF")
	
}


public hud_rr()
{
	set_hudmessage(255, 0, 0, -1.0, 0.0, 1, 6.0, 2.0)
	show_hudmessage(0, "Restart In %d secunde", get_pcvar_num(num_time));
si asa nemodificat
| Afiseaza codul
#include <amxmodx>


#define PLUGIN "Auto Round Restart"
#define VERSION "1.0"
#define AUTHOR "FireW@ll"

#define time_delay 13
#define time_delay_hud 10

new num_time, sync, time_s

public plugin_init() 
{
	// Plugin register
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	// Event
	register_event("TextMsg","rr","a","2&#Game_C") 
	
	// Other Shit
	sync = CreateHudSyncObj();
	
	// Cvars
	num_time = register_cvar("time_for_display","25")
	check_cvars()
}

public check_cvars()
{
	if(get_pcvar_num(num_time) > 60)
		set_pcvar_num(num_time, 25)
}

public rr()
{
	time_s = get_pcvar_num(num_time)
	set_task(float(time_delay),"restart_time")
	set_task(float(time_delay_hud),"hud_rr")
}


public restart_time()
{
	if(time_s >= 0)
	{
		if(time_s == 40 || time_s == 30 || time_s == 20)
		{
			new voice_[64]
			num_to_word(time_s, voice_, 63)
			client_cmd(0, "spk ^"vox/%s _comma seconds until biological hazard^"", voice_)
		}
		else
		if(time_s < 11)
		{
			new voice_[64]
			num_to_word(time_s, voice_, 63)
			client_cmd(0, "spk ^"vox/%s _comma^"", voice_)
		}
		if(time_s > 15)
			set_hudmessage(0, 255, 0, 0.10, 0.33, 1, 6.1, 6.0)

		else
		if(time_s > 11)
			set_hudmessage(255, 170, 0, 0.10, 0.35, 1, 6.1, 6.0)
		
		else
		if(time_s > 10)
			set_hudmessage(255, 170, 0, 0.10, 0.37, 1, 6.1, 6.0)
			
		else
		if(time_s > 9)
			set_hudmessage(255, 170, 0, 0.10, 0.39, 1, 6.1, 6.0)
			
		else
		if(time_s > 8)
			set_hudmessage(255, 170, 0, 0.10, 0.41, 1, 6.1, 6.0)
			
		else
		if(time_s > 7)
			set_hudmessage(255, 170, 0, 0.10, 0.43, 1, 6.1, 6.0)
			
		else
		if(time_s > 6)
			set_hudmessage(255, 170, 0, 0.10, 0.46, 1, 6.1, 6.0)
			
		else
		if(time_s > 5)
			set_hudmessage(255, 170, 0, 0.10, 0.49, 1, 6.1, 6.0)
			
		else
		if(time_s > 4)
			set_hudmessage(255, 0, 0, 0.10, 0.51, 1, 6.1, 6.0)
			
		else
		if(time_s > 3)
			set_hudmessage(255, 0, 0, 0.10, 0.54, 1, 6.1, 6.0)
		else
		if(time_s > 2) 
			set_hudmessage(255, 0, 0, 0.10, 0.57, 1, 6.1, 6.0)
			
		else
		if(time_s > 1) 
		{
			set_hudmessage(255, 0, 0, 0.10, 0.60, 1, 6.1, 6.0)
			set_task(1.0,"hud_")
		}
			
		if(time_s < 1)
		{
			set_cvar_float("sv_restartround",2.0)
		}
		ShowSyncHudMsg(0, sync, "[%d]", time_s);
		--time_s;
		set_task(1.0,"restart_time")
	}
	return PLUGIN_HANDLED;
}



public hud_()
{
	set_hudmessage(255, 255, 255, -1.0, 0.28, 1, 6.0, 3.0)
	show_hudmessage(0, "*** Have Fun & Good Luck ***")
	
}


public hud_rr()
{
	set_hudmessage(255, 255, 255, -1.0, 0.28, 1, 6.0, 2.0)
	show_hudmessage(0, "*** The Game Will Restart In %d seconds ***", get_pcvar_num(num_time));
}
Nick: MiSteR D
Image
User avatar
b[L]u
Membru, skill +1
Membru, skill +1
Posts: 314
Joined: 31 May 2010, 13:27
Detinator Steam: Nu
Has thanked: 26 times
Been thanked: 8 times

25 Sep 2010, 15:18

am rezolvat!:D scuze pentru dublu post
Nick: MiSteR D
Image
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests