Raised This Month: $ Target: $400
 0% 

register_cvar with -console option


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
bianster
Junior Member
Join Date: Sep 2009
Old 11-05-2009 , 23:04   register_cvar with -console option
Reply With Quote #1

I've a question regarding register_cvar when running hlds.exe with the -console option. I have the code below and the value of my_cvar is initialised to what I specify when starting a HLDS instance (in +servercfgfile) but it's not picking it up when I start the server with -console.

Do I need to do something else when using the -console option? Using Metamod 1.91 and AMX Mod X 1.81.

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

#define PLUGIN "HLDS Plugin"
#define VERSION "0.1"
#define AUTHOR "Author"

public plugin_init() {
  
register_plugin(PLUGINVERSIONAUTHOR)
  
register_cvar("my_cvar""0"FCVAR_SPONLY|FCVAR_SERVER)

  
log_message("mp_winlimit is %d"get_cvar_num("mp_winlimit"))
  
log_message("my_cvar is %d"get_cvar_num("my_cvar"))
}

public 
client_putinserver(id){
  
log_message("my_cvar is %d"get_cvar_num("my_cvar"))
  return 
PLUGIN_CONTINUE

bianster is offline
 


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 17:40.


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