AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved change register_cvar (https://forums.alliedmods.net/showthread.php?t=295092)

notahacker 03-16-2017 02:21

change register_cvar
 
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

jimaway 03-16-2017 04:35

Re: change register_cvar
 
set_pcvar_num(enable, 0)

Relaxing 03-16-2017 05:41

Re: change register_cvar
 
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)

notahacker 03-16-2017 05:50

Re: change register_cvar
 
Quote:

Originally Posted by jimaway (Post 2504034)
set_pcvar_num(enable, 0)

Thanks mate :fox: <3


All times are GMT -4. The time now is 17:52.

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