Raised This Month: $399 Target: $400
 99%   Almost there!

[CS 1.6] Huge problem with 'users.ini'


Post New Thread Reply   
 
Thread Tools Display Modes
Wortexx
Member
Join Date: Apr 2020
Location: Serbia
Old 04-05-2020 , 14:30   Re: [CS 1.6] Huge problem with 'users.ini'
Reply With Quote #11

Quote:
Originally Posted by Bugsy View Post
Ok, it should be pretty simple to make. When you say all rounds, what does this correspond to?
Well, when I start the server my maxrounds cvar is set to 50, so there's 50 rounds left. The plugin I am searching for is the one which will restart the server when 50 rounds are played and server should change the map, that's where the plugin should kick in and restart the server.

You already know you didn't understand
My english is not very perfect, sorry.
Wortexx is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-05-2020 , 14:46   Re: [CS 1.6] Huge problem with 'users.ini'
Reply With Quote #12

Ideally you should find the source of the problem instead of applying band-aids. Might be difficult though with the number of plugins you are running.

Untested
PHP Code:

#include <amxmodx>
#include <nvault>

new const Version[] = "0.1";

new 
g_pNumRounds;

public 
plugin_init() 
{
    
register_plugin"Server Restarter" Version "bugsy" );
    
    new 
iVault nvault_open"server_restart" );
    new 
szNextMap64 ];
    
    if ( 
nvault_getiVault "NextMap" szNextMap charsmaxszNextMap ) ) )
    {
        
nvault_removeiVault "NextMap" );
        
nvault_closeiVault );
        
server_cmd"changelevel ^"%s^"" szNextMap );
        return;
    }
    
    
nvault_closeiVault );
    
    
g_pNumRounds register_cvar"server_restart_rounds" "50" );
    
    
register_logevent"RoundEnd" "1=Round_End" );
}

public 
RoundEnd()
{
    new 
iVault nvault_open"server_restart" );
    new 
iNumRounds szRounds] , szNextMap64 ];
    
    
iNumRounds nvault_getiVault "NumRounds" );
    
    if ( ( 
iNumRounds ) >= get_pcvar_numg_pNumRounds ) )
    {
        
get_cvar_string"amx_nextmap" szNextMap charsmaxszNextMap ) );
        
nvault_setiVault "NextMap" szNextMap );
        
nvault_setiVault "NumRounds" "0" );
        
nvault_closeiVault );
        
server_cmd"restart" );
    }
    else
    {
        
num_to_striNumRounds szRounds charsmaxszRounds ) );
        
nvault_setiVault "NumRounds" szRounds );
        
nvault_closeiVault );
    }

__________________
Bugsy is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-05-2020 , 15:11   Re: [CS 1.6] Huge problem with 'users.ini'
Reply With Quote #13

Does the "amx_reloadadmins" command fix the issue? If yes, that may be a better solution rather than restarting the entire server.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-05-2020 , 15:14   Re: [CS 1.6] Huge problem with 'users.ini'
Reply With Quote #14

Lol good call.

If this is the case, the below can solve your problem, or add that one line to one of your other plugins.
PHP Code:
#include <amxmodx>

public plugin_init() 
{
     
server_cmd"amx_reloadadmins" );

__________________
Bugsy is offline
Wortexx
Member
Join Date: Apr 2020
Location: Serbia
Old 04-07-2020 , 14:50   Re: [CS 1.6] Huge problem with 'users.ini'
Reply With Quote #15

Quote:
Originally Posted by OciXCrom View Post
Does the "amx_reloadadmins" command fix the issue? If yes, that may be a better solution rather than restarting the entire server.
My god that's iq200...
Wortexx is offline
Wortexx
Member
Join Date: Apr 2020
Location: Serbia
Old 04-07-2020 , 14:52   Re: [CS 1.6] Huge problem with 'users.ini'
Reply With Quote #16

Quote:
Originally Posted by Bugsy View Post
Lol good call.

If this is the case, the below can solve your problem, or add that one line to one of your other plugins.
PHP Code:
#include <amxmodx>

public plugin_init() 
{
     
server_cmd"amx_reloadadmins" );

But when will it reload the admins, I don't understand that.
Wortexx is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-07-2020 , 14:54   Re: [CS 1.6] Huge problem with 'users.ini'
Reply With Quote #17

Quote:
Originally Posted by Wortexx View Post
But when will it reload the admins, I don't understand that.
It will execute the code as soon the plugin gets initiated. That would be if the server started up succesfully and your plugins were loaded succesfully.

Just save that code as reloadusers.sma and compile it.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Wortexx
Member
Join Date: Apr 2020
Location: Serbia
Old 04-07-2020 , 14:56   Re: [CS 1.6] Huge problem with 'users.ini'
Reply With Quote #18

Quote:
Originally Posted by Napoleon_be View Post
It will execute the code as soon the plugin gets initiated. That would be if the server started up succesfully and your plugins were loaded succesfully.

Just save that code as reloadusers.sma and compile it.
I added it to another plugin is that ok?
Wortexx is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-07-2020 , 15:01   Re: [CS 1.6] Huge problem with 'users.ini'
Reply With Quote #19

Quote:
Originally Posted by Wortexx View Post
I added it to another plugin is that ok?
yea, you'll just have to add that one line in the plugin_init() function.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Wortexx
Member
Join Date: Apr 2020
Location: Serbia
Old 04-07-2020 , 15:02   Re: [CS 1.6] Huge problem with 'users.ini'
Reply With Quote #20

This is roundsleft.sma, the plugin shows rounds left in the hud

Code:
#include <amxmodx>
#include <cstrike>

new brojrundi;

public plugin_init() {
	register_plugin("Preostalo rundi - Hud", "1.0", "Desikac")
	
	register_event("SendAudio", "krajrunde", "a", "2&%!MRAD_terwin")
	register_event("SendAudio", "krajrunde", "a", "2&%!MRAD_ctwin")
	
	register_event("TextMsg", "restart", "a", "2&#Game_C", "2&#Game_w")
	
	brojrundi = 0;
	
	register_logevent( "krajrunde" , 4, "1=Round_Draw" );
	
	set_task(1.0, "tajmer",0,"",0,"b") 

	server_cmd( "amx_reloadadmins" );
}

public krajrunde() { 
brojrundi+=1; }

public restart() {
brojrundi = 0; }

public tajmer(){ 
    new nextmap[32] 
    new ukupnorundi = get_cvar_num("mp_maxrounds")
    get_cvar_string("amx_nextmap",nextmap,31) 
    new razlika = ukupnorundi - brojrundi
    set_hudmessage(50,255,50,-1.0,0.05,0, 1.0, 1.0, 0.1, 0.2, 13)
    show_hudmessage(0,"Preostalo rundi: %d^nSledeca mapa: %s", razlika,nextmap) 
    return PLUGIN_CONTINUE 
}
Wortexx is offline
Reply


Thread Tools
Display Modes

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 16:26.


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