AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   set_pcvar_*() broken ?!? (https://forums.alliedmods.net/showthread.php?t=54618)

_Master_ 04-30-2007 03:31

set_pcvar_*() broken ?!?
 
So my question is: given the following code, what value will "amx_some_cvar" have in the end ?
PHP Code:

#include <amxmodx>

new the_pcvar

public plugin_init(){
    
the_pcvar register_cvar("amx_some_cvar""0")
}

// this is just an example
public client_connect(id){
    
set_pcvar_num(the_pcvar1)


The reason I'm asking this is that I've tried to change the PCVARs but so far it doesn't seem to work. The only way I was able to change them was via set_cvar_*()

teame06 04-30-2007 03:44

Re: set_pcvar_*() broken ?!?
 
set_pcvar_* works fine except when you type your cvar in console. It because how pcvar worked. There is a changed in AMX Mod X 1.8 addressed the issued.

If you did server_print("My pCvar Value: %d", get_pcvar_num(the_pcvar)); It will show you the correct value.

P.S. Don't ask when AMX Mod X 1.8 is going to be release. It will probably be done when the Dev believe it ready.

_Master_ 04-30-2007 04:06

Re: set_pcvar_*() broken ?!?
 
Quote:

Originally Posted by teame06 (Post 471412)
If you did server_print("My pCvar Value: %d", get_pcvar_num(the_pcvar)); It will show you the correct value.

For some odd reason it doesn't work:
PHP Code:

set_pcvar_num(the_pcvar1)
server_print("the_cvar: %d"get_pcvar_num(the_cvar)) 

EDIT: nvm I've found a workaround. Thanks

Alka 04-30-2007 04:30

Re: set_pcvar_*() broken ?!?
 
when you call this func? :/ depends...


All times are GMT -4. The time now is 06:33.

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