AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   nvault_get - Clear Explanation to question please (https://forums.alliedmods.net/showthread.php?t=29962)

SubStream 06-19-2006 15:11

nvault_get - Clear Explanation to question please
 
Quote:

Originally Posted by AMX Mod X Documentation
nvault_get ( vault, const key[], ... )

nvault_get - Gets a vault value by returning an int setting a byref float or setting a string & maxlength.

so assuming I've already opened the vault in plugin_init, I assume that I could do
Code:
i_myinteger = nvault_get ( myvault, s_keyname ) if ( i_myinteger == 0 )            // blah blah my code here

Is that correct usage of nvault_get and would I then need to do
Code:
nvault_pset ( myvault, s_keyname, 0 )
to change the value to 0 and
Code:
nvault_pset ( myvault, s_keyname, 1 )
in order to turn the value BACK to 1 in other parts of the code? Is this correct?

Hawk552 06-19-2006 15:43

I don't understand why people ask questions like this.

Why don't you try it and see for yourself?

But as far as this goes, I think your usage is correct assuming s_keyname is a valid key name.

BAILOPAN 06-20-2006 17:50

nvault_set() requires a string for the value, not an integer.


All times are GMT -4. The time now is 07:59.

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