Raised This Month: $51 Target: $400
 12% 

Changing roundtime so it takes effect ATM


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 12-27-2011 , 18:24   Changing roundtime so it takes effect ATM
Reply With Quote #1

Hey guys,
Is there any possibility to script a code that sets the round time so it takes effect right away? so for example imagine the time goes like:
1:21
1:20
1:19
...
*typing /resettime that i scripted a command for it, that it sets it back to 5*
5:00
4:59
...

Is it possible?
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive
Diegorkable is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 12-27-2011 , 19:41   Re: Changing roundtime so it takes effect ATM
Reply With Quote #2

You can change displayed round time using RoundTime message. You can block / force round end using plugins: infinite round, round terminator.
__________________
Impossible is Nothing
Sylwester is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 12-27-2011 , 19:54   Re: Changing roundtime so it takes effect ATM
Reply With Quote #3

I tried installing the infinite_round.amxx plugin on my server, and it didnt block it still.
I am asking, if can I change the value of the time left on a round, not just by visual "changing the displayed round time" but not changing the actual round time value.
How do I change the round time value so it changes at the moment and not in next round?
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive
Diegorkable is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 12-27-2011 , 23:47   Re: Changing roundtime so it takes effect ATM
Reply With Quote #4

There probably is some way to actually change the round time using orpheu, but until someone finds out how to do it, the only thing you can do is to emulate it using RoundTime message + infinite round + round terminator.
__________________
Impossible is Nothing
Sylwester is offline
Old 12-28-2011, 13:53
Devil259
This message has been deleted by Devil259.
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-28-2011 , 14:16   Re: Changing roundtime so it takes effect ATM
Reply With Quote #5

mp_timelimit is not the round time, but the map time.
mp_roundtime is the round time in minutes.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 12-28-2011 , 14:28   Re: Changing roundtime so it takes effect ATM
Reply With Quote #6

I don't get it then, what can I do to make a round not END? because infinite_round didnt do it at all.
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive
Diegorkable is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-28-2011 , 14:32   Re: Changing roundtime so it takes effect ATM
Reply With Quote #7

Quote:
Originally Posted by Sylwester View Post
the only thing you can do is to emulate it using RoundTime message + infinite round + round terminator.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-28-2011 , 14:58   Re: Changing roundtime so it takes effect ATM
Reply With Quote #8

Round time is calculated this way with these CGameRules offsets : g_pGameRules->m_iRoundTimeSecs - gpGlobals->time + g_pGameRules->m_flRoundCount.

If purpose is to update timer without restarting the round, all you need to do is to set m_iRoundTimeSecs to your value and m_flRoundCount to current time. Also sending a RoundTime message to update the timer.

(Will make the plugin after eating)
__________________

Last edited by Arkshine; 12-28-2011 at 15:12.
Arkshine is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 12-28-2011 , 15:02   Re: Changing roundtime so it takes effect ATM
Reply With Quote #9

What? I dont understand a word you guys say... can you please explain better? =\
@Exolent - Yeah, but how do I do that? Im confused.
@Arkshine - Yeah, and how do I set those values?
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive

Last edited by Diegorkable; 12-28-2011 at 15:02.
Diegorkable is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-28-2011 , 16:56   Re: Changing roundtime so it takes effect ATM
Reply With Quote #10

Here a basic exemple, with say /resettime as stated in your first post :

PHP Code:
#include <amxmodx>
#include <orpheu>
#include <orpheu_memory>

new const PluginName   [] = "Set Round Time";
new const 
PluginVersion[] = "1.0";
new const 
PluginAuthor [] = "Arkshine";

const 
YourRoundTimeValue 60// 5 min in seconds.

enum GameRulesMembers 

    
m_iRoundTimeSecs
    
m_flRoundCount 
};

new const 
GameRulesMIGameRulesMembers ][] = 

    
"m_iRoundTimeSecs"
    
"m_flRoundCount" 
};
    
new 
g_pGameRules;

#define set_mp_pdata(%1,%2)  ( OrpheuMemorySetAtAddress( g_pGameRules, GameRulesMI[ %1 ], 1, %2 ) )
#define get_mp_pdata(%1)     ( OrpheuMemoryGetAtAddress( g_pGameRules, GameRulesMI[ %1 ] ) )

public plugin_precache()
{
    
OrpheuRegisterHookOrpheuGetFunction"InstallGameRules" ), "OnInstallGameRules"OrpheuHookPost );
}

public 
OnInstallGameRules()
{
    
g_pGameRules OrpheuGetReturn();
}

public 
plugin_init()
{
    
register_pluginPluginNamePluginVersionPluginAuthor );

    
register_clcmd"say /resettime""ClientCommand_ResetRoundTime" );
}

public 
ClientCommand_ResetRoundTime( const client )
{
    
setRoundTimeYourRoundTimeValue );
    return 
PLUGIN_HANDLED;
}

setRoundTime( const newTime )
{
    
set_mp_pdatam_iRoundTimeSecsnewTime );
    
set_mp_pdatam_flRoundCountget_gametime() );
    
    static 
msgIndexRoundTime;
    
    if( 
msgIndexRoundTime || ( msgIndexRoundTime get_user_msgid"RoundTime" ) ) )
    {
        
message_beginMSG_ALLmsgIndexRoundTime );
        
write_shortnewTime );
        
message_end();
    }


Installation :
  1. Make sure Orpheu is installed. If not, unzip that in your amxmodx/ directory.
  2. Unzip the provided package in your amxmodx/ directory, overwrite if need.
  3. Restart.
Attached Files
File Type: zip set_round_time.zip (5.9 KB, 176 views)
__________________

Last edited by Arkshine; 12-28-2011 at 16:59.
Arkshine 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 03:21.


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