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

[REQ]Round Restart


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Uncommon
Junior Member
Join Date: Sep 2015
Old 09-03-2015 , 15:18   [REQ]Round Restart
Reply With Quote #1

Hey guys,

I was looking for a way to print client a message whenever sv_restartround cvar changes (round restarts). Is there a way to do so? I have absolutely no idea how to do some action when server cvar changes.

Thanks.
Uncommon is offline
Hartmann
Senior Member
Join Date: Nov 2014
Old 09-03-2015 , 15:29   Re: [REQ]Round Restart
Reply With Quote #2

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

public plugin_init() {
    
register_event("TextMsg","gamestart","a","2&#Game_C","2&#Game_w");
}
public 
gamestart() {
    
// Code

__________________

RETAKES v1.0
github.com/alghtryer/retakes

Contact : [email protected]

BTC Donate: 1QAh1NLmeHy81LF9r8PaeGjYqHL2BBcJTx

Hartmann is offline
Uncommon
Junior Member
Join Date: Sep 2015
Old 09-03-2015 , 15:47   Re: [REQ]Round Restart
Reply With Quote #3

Thanks for the help.

But I lied. I want to change a variable in my plugin (reset it to zero) when this cvar changes. I thought that it had no difference whatever I wanted to do on a cvar change, but I was wrong. Is there such a way?

Sorry for the inconvenience.
Uncommon is offline
Hartmann
Senior Member
Join Date: Nov 2014
Old 09-03-2015 , 15:58   Re: [REQ]Round Restart
Reply With Quote #4

Block sv_restart?
__________________

RETAKES v1.0
github.com/alghtryer/retakes

Contact : [email protected]

BTC Donate: 1QAh1NLmeHy81LF9r8PaeGjYqHL2BBcJTx

Hartmann is offline
Uncommon
Junior Member
Join Date: Sep 2015
Old 09-03-2015 , 16:05   Re: [REQ]Round Restart
Reply With Quote #5

No, not exactly. I have a variable in my plugin which counts rounds. So basically if I "sv_restartround 1", I want to change variable roundcount to 0;

Like this:

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

new roundcount = 0;

public plugin_init() 
{ 
    register_event("TextMsg","gamestart","a","2&#Game_C","2&#Game_w"); 
} 
public gamestart() 
{ 
   roundcount=0;
   return roundcount;

}
Sorry if I'm being unclear.

Last edited by Uncommon; 09-03-2015 at 16:06.
Uncommon is offline
Hartmann
Senior Member
Join Date: Nov 2014
Old 09-03-2015 , 16:25   Re: [REQ]Round Restart
Reply With Quote #6

So what is the problem?

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

new roundcount 0;

public 
plugin_init() 

    
register_event("TextMsg","gamestart","a","2&#Game_C","2&#Game_w"); 

public 
gamestart() 

   
roundcount=0;

__________________

RETAKES v1.0
github.com/alghtryer/retakes

Contact : [email protected]

BTC Donate: 1QAh1NLmeHy81LF9r8PaeGjYqHL2BBcJTx

Hartmann is offline
Uncommon
Junior Member
Join Date: Sep 2015
Old 09-03-2015 , 16:35   Re: [REQ]Round Restart
Reply With Quote #7

Ahhh, nvm. I just screwed up with flags. It works flawlessly. Thanks for the help. I would +K, but I think I can't just do that yet...
Uncommon is offline
Hartmann
Senior Member
Join Date: Nov 2014
Old 09-03-2015 , 16:55   Re: [REQ]Round Restart
Reply With Quote #8

You're welcome.
__________________

RETAKES v1.0
github.com/alghtryer/retakes

Contact : [email protected]

BTC Donate: 1QAh1NLmeHy81LF9r8PaeGjYqHL2BBcJTx

Hartmann 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 04:55.


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