Raised This Month: $ Target: $400
 0% 

Execute on Commence


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FuZ!on
Senior Member
Join Date: Aug 2007
Old 02-02-2010 , 13:40   Execute on Commence
Reply With Quote #1

Received this code a while ago, but it doesn't seem to work now.

The HUD timer counts down and everything but the plugin doesn't restart the round.

Object:
When the Game Commencing text comes across the screen, this plugin counts down from 10 and then executes a command. In this case, sv_restart 1

PHP Code:
#include <amxmodx>
#include <amxmisc>

new pcvaramount

public plugin_init()
{
    
register_plugin("Restart @ Commencing""1.0""Atomen")
    
register_event("TextMsg""event_game_commencing""a""2&#Game_C")

    
pcvar register_cvar("amx_commencing""1")
    
amount 10
}

public 
event_game_commencing()
{
    if(
pcvar)
        
set_task(1.0"delayed_output"___"a"10)
}

public 
delayed_output()
{
    if(
amount == 0)
    {
        
server_cmd("sv_restart 1")
    }

    else
    {
        
set_hudmessage255255255, -1.00.3506.00.80.10.14)
        
show_hudmessage(0"Time Left Until Restart : %d"amount)
    
        
amount--
    }


Last edited by FuZ!on; 02-02-2010 at 14:42.
FuZ!on is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 02-02-2010 , 16:18   Re: Execute on Commence
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <amxmisc>

new pcvaramount

public plugin_init()
{
    
register_plugin("Restart @ Commencing""1.0""Atomen")
    
register_event("TextMsg""event_game_commencing""a""2&#Game_C")

    
pcvar register_cvar("amx_commencing""1")
    
amount 10
}

public 
event_game_commencing()
{
    if(
pcvar)
        
set_task(1.0"delayed_output"___"a"10)
}

public 
delayed_output()
{
    if(
amount == 1)
    {
        
set_task1.0"cmdTest" )
    }

    else
    {
        
set_hudmessage255255255, -1.00.3506.00.80.10.14)
        
show_hudmessage(0"Time Left Until Restart : %d"amount)
    
        
amount--
    }
}

public 
cmdTest()
{
    
server_cmd"sv_restart 1" )

__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-02-2010 , 19:44   Re: Execute on Commence
Reply With Quote #3

PHP Code:
        set_task(1.0"delayed_output"___"a"amount 1
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 07:20.


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