View Single Post
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-02-2018 , 13:45   Re: Weapon firing when MOTD appears | CVAR not updating |
Reply With Quote #23

Quote:
Originally Posted by KliPPy View Post
My bad then. Is your plugin loading before admin.sma?
Sorry for reviving, but no, it's not called before admin.sma, even if I put the CVARs inside server.cfg, it still prints the CVARs defined in the .sma.

PHP Code:
public plugin_precache( )
{
    
g_iCvars] = register_cvar"csbr_team_num""32" ); // number of teams
    
g_iCvars] = register_cvar"csbr_player_per_team""1" ); // number of players in one team
}

public 
plugin_init( ) // tried plugin_cfg too
{
    
g_iMaxTeams get_pcvar_numg_iCvars] );
    
g_iPlayerPerTeam get_pcvar_numg_iCvars] );
    
    
log_to_file"Teams.txt""MaxTeams: %d | Player per team: %d"g_iMaxTeamsg_iPlayerPerTeam );

It always shows the un-updated CVAR values on first try, then after restarting it's ok. Same problem as get_user_msgid here
Code:
L 08/02/2018 - 19:41:03: MaxTeams: 32 | Player per team: 1
L 08/02/2018 - 19:42:28: MaxTeams: 8 | Player per team: 4
L 08/02/2018 - 19:42:33: MaxTeams: 8 | Player per team: 4
__________________

Last edited by edon1337; 08-02-2018 at 14:49.
edon1337 is offline