Raised This Month: $ Target: $400
 0% 

Solved change register_cvar


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
notahacker
Member
Join Date: Jan 2015
Old 03-16-2017 , 02:21   change register_cvar
Reply With Quote #1

Hello

Code:
public plugin_init() 
{ ...

enable = register_cvar("st_match","1");

...}

in a public(), i'm having to change it to 0 by " server_cmd( "st_match 0"); ".
if i write " enable = 0; ", it crashes the server.

How do i change it to 0 without going through server_cmd?

Thanks

Last edited by notahacker; 03-16-2017 at 05:51.
notahacker is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 03-16-2017 , 04:35   Re: change register_cvar
Reply With Quote #2

set_pcvar_num(enable, 0)
jimaway is offline
notahacker
Member
Join Date: Jan 2015
Old 03-16-2017 , 05:50   Re: change register_cvar
Reply With Quote #3

Quote:
Originally Posted by jimaway View Post
set_pcvar_num(enable, 0)
Thanks mate <3
notahacker is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 03-16-2017 , 05:41   Re: change register_cvar
Reply With Quote #4

Code:
 new enable = register_cvar("st_match","1");
Command: amx_cvar st_match 1
You cannot use amx_rcon to change the cvar, because the command is not being registered at server_cmd panel.(register_concmd is for server console)
__________________
Relaxing 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 17:52.


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