Raised This Month: $32 Target: $400
 8% 

CountDown to Restart with effects


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 10-20-2018 , 06:12   CountDown to Restart with effects
Reply With Quote #1

Hi, i'm using this plugin to auto restart the rounds after 20 seconds after a map change so all players can join, i'm using this plugin

PHP Code:
#include <amxmodx>

#define PLUGIN "Auto Restart vl"
#define VERSION "1.1"
#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_SyncGameStart
new g_SyncRestartTimer

new bool:g_bRoundStart 

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
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_autorestart register_cvar("amx_auto_restart","20.0")
    
    
g_SyncGameStart CreateHudSyncObj()
    
g_SyncRestartTimer CreateHudSyncObj()
}

public 
RoundStart()
{
    if(!
get_pcvar_num(g_autoenabled))
        return 
PLUGIN_HANDLED
    
    
if(g_bRoundStart)
    {
        
set_hudmessage02550, -1.00.4015.08.00.00.0, -1)
        
ShowSyncHudMsg0g_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
0255255, -1.00.2500.01.00.00.0, -1)
    
ShowSyncHudMsg0g_SyncRestartTimer"%L",LANG_PLAYER"AUTO_RESTART"fSec)
    
    if(
g_counter == get_pcvar_num(g_autorestart))
    {
        
g_bRoundStart true
    
}
}

public 
RestartRound() 
{
    
server_cmd("sv_restartround 1")

i want to add the following sounds to use with countdown:

begin countdown from -20

-7 plays restart/prepare.wav
-5 plays restart/round_begins_in.wav
-3 plays restart/3.wav
-2 plays restart/2.wav
-1 plays restart/1.wav

and after the restart, play the sound restart/fight.wav

effects, on the restart, blink the screen with fadeout effect from blue to normal, this is optional, i think this will look cool!

the sound files are attached

thanks very much
Attached Files
File Type: zip restart.zip (107.5 KB, 42 views)
tarsisd2 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:06.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode