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

28 Sep 2010, 10:34

salut vreau sa-mi modificat acest plugin cand da restart sa se auda un sunet rundasevarestarta.wav . Sunetul il am eu :P
| Afiseaza codul
#include <amxmodx>

#define PLUGIN "Auto Restart vl"
#define VERSION "1.3"
#define AUTHOR "vato loco [GE-S]"

#define TIMER_TASK        123456
#define RESTART_TASK      789123

new g_counter  

new g_autorestart
new g_autoenabled
new g_autocds

new g_SyncGameStart
new g_SyncRestartTimer

new bool:g_bRoundStart 

public plugin_init() 
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_logevent("RoundStart", 2, "1=Round_Start")
	register_event("TextMsg","RestartTask","a","2&#Game_C")   
	
	register_dictionary("auto_restart_vl.txt")
	
	g_autoenabled = register_cvar("amx_autorr_enable","1")
        g_autocds = register_cvar("amx_autorr_cds","1")
	g_autorestart = register_cvar("amx_auto_restart","60.0")
	
	g_SyncGameStart = CreateHudSyncObj()
	g_SyncRestartTimer = CreateHudSyncObj()
}

public RoundStart()
{
	if(!get_pcvar_num(g_autoenabled))
		return PLUGIN_HANDLED
	
	if(g_bRoundStart)
	{
		set_hudmessage( 255, 255, 0, -1.0, 0.25, 1, 5.0, 8.0, 0.0, 0.0, -1)
		ShowSyncHudMsg( 0, g_SyncGameStart, "%L",LANG_PLAYER, "GAME_STARTED")
	}
	g_bRoundStart = false
	
	return PLUGIN_CONTINUE
}

public RestartTask() 
{
	if(!get_pcvar_num(g_autoenabled))
		return PLUGIN_HANDLED
	
	set_task(1.0,"TimeCounter",TIMER_TASK,_,_,"a",get_pcvar_num(g_autorestart))
	set_task(get_pcvar_float(g_autorestart),"RestartRound",RESTART_TASK)
	
	return PLUGIN_CONTINUE
}

public TimeCounter() 
{
	g_counter++
	
	new Float:iRestartTime = get_pcvar_float(g_autorestart) - g_counter
	new Float:fSec
	fSec = iRestartTime 
	
	set_hudmessage( 0, 255, 255, -1.0, 0.25, 0, 0.0, 1.0, 0.0, 0.0, -1)
	ShowSyncHudMsg( 0, g_SyncRestartTimer, "%L",LANG_PLAYER, "AUTO_RESTART", fSec)
	
	if(get_pcvar_num(g_autocds) && get_pcvar_num(g_autorestart) - g_counter < 11 && get_pcvar_num(g_autorestart) - g_counter !=0)
	{
		static szNum[32]
		num_to_word(get_pcvar_num(g_autorestart) - g_counter, szNum, 31)
		client_cmd(0,"speak ^"vox/%s^"", szNum)
	}
        if(g_counter == get_pcvar_num(g_autorestart))
	{
		g_bRoundStart = true
                g_counter = 0
	}
}

public RestartRound() 
{
	server_cmd("sv_restartround 1")
}
Last edited by b[L]u on 01 Oct 2010, 11:27, edited 1 time in total.
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

01 Oct 2010, 10:20

UP!!!:(
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

01 Oct 2010, 11:27

pana la urma am rezolvat singur puteti da tc
Nick: MiSteR D
Image
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 11 guests