Raised This Month: $32 Target: $400
 8% 

set_pcvar_*() broken ?!?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
_Master_
Senior Member
Join Date: Dec 2006
Old 04-30-2007 , 03:31   set_pcvar_*() broken ?!?
Reply With Quote #1

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_*()
_Master_ is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 04-30-2007 , 03:44   Re: set_pcvar_*() broken ?!?
Reply With Quote #2

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.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
_Master_
Senior Member
Join Date: Dec 2006
Old 04-30-2007 , 04:06   Re: set_pcvar_*() broken ?!?
Reply With Quote #3

Quote:
Originally Posted by teame06 View Post
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

Last edited by _Master_; 04-30-2007 at 04:31.
_Master_ is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 04-30-2007 , 04:30   Re: set_pcvar_*() broken ?!?
Reply With Quote #4

when you call this func? :/ depends...
__________________
Still...lovin' . Connor noob! Hello
Alka 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 12:12.


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