AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Fvault_load(id) error (https://forums.alliedmods.net/showthread.php?t=222898)

iloadding 08-07-2013 20:49

Fvault_load(id) error
 
I have a problem when using Fvault_load(id)
someone could help I am trying to use this:

PHP Code:

public client_putinserver (id)
{
g_Password [id] [0] = '^ 0'g_Status [id] = UNREGISTERED
g_AlredyChanged 
[id] [NAME] = 0g_AlredyChanged [id] [PASSWORD] = 0
fvault_load 
(id)


but will not the the following error:


I: \ AMXX_Studio \ Compile \ include \ fvault.inc (641): error 017: undefined symbol "Invalid_Array"
I: \ AMXX_Studio \ Compile \ include \ fvault.inc (666): error 017: undefined symbol "Invalid_Array"
I: \ AMXX_Studio \ Compile \ include \ fvault.inc (670): error 017: undefined symbol "Invalid_Array"
I: \ AMXX_Studio \ Compile \ include \ fvault.inc (674): error 017: undefined symbol "Invalid_Array"

Can someone help or give a hint?

Black Rose 08-08-2013 11:16

Re: Fvault_load(id) error
 
Update your fvault inc file from here.
Also, id is not correct usage for fvault_load().
Code:
/**  * Gets all vault keys, data, and timestamps  *  * @param       vaultname - Vault name to look in  * @param       keys - cellarray holding all of the keys  * @param       datas - cellarray holding all of the data values  * @param       timestamps - cellarray holding all of the timestamps  *  * @return      Returns total number of entries in vault  *  * @note        keys needs to be created like this: ArrayCreate(64)  *          datas needs to be created like this: ArrayCreate(512)  *          timestamps need to be created like this: ArrayCreate()  */ stock fvault_load(const vaultname[], Array:keys=Invalid_Array, Array:datas=Invalid_Array, Array:timestamps=Invalid_Array)

I think you want fvault_get_data():
Code:
/**  * Retrieves data specified by a key  *  * @param vaultname Vault name to look in  * @param key       Key name to look for the data  * @param data      String which data will be copied to  * @param len       Length of data  * @param timestamp The unix time of when the data was last set ( -1 if permanent data, 0 if old fvault version ) ( optional param )  * @return      Returns 1 on success, 0 on failue.  */ stock fvault_get_data(const vaultname[], const key[], data[], len, &timestamp=0)

iloadding 08-08-2013 13:00

Re: Fvault_load(id) error
 
what?, how to use it?

Black Rose 08-08-2013 15:31

Re: Fvault_load(id) error
 
Well, that depends what you're doing with it...
What are you using it for?

iloadding 08-08-2013 15:40

Re: Fvault_load(id) error
 
that's why I call it in a function

and the function of it this way:

public fvault_load (id)
{
static szName [32], szData [64]; get_user_name (id, szName, 31)

if (! fvault_get_data (g_Vault, szName, szData, 63))
g_Status [id] = UNREGISTERED
else {
strbreak (szData, g_Password [id], 31, g_Date [id], 31)

g_Status [id] = REGISTERED
}
}

but fvault_load (id) will not.

YamiKaitou 08-08-2013 15:41

Re: Fvault_load(id) error
 
fvault_load already exists, use a different name for you function

iloadding 08-08-2013 16:07

Re: Fvault_load(id) error
 
changed the public but from this error now

H: \ AMXX_Studio \ Compile \ include \ fvault.inc (641): error 017: undefined symbol "Invalid_Array"


fvault_load_2 (id)

Black Rose 08-08-2013 16:19

Re: Fvault_load(id) error
 
Update your AMXx, it's probably outdated.
Invalid_Array is defined in cellarray.inc which is included through amxmodx.inc.

iloadding 08-08-2013 16:51

Re: Fvault_load(id) error
 
thank you ^ ^ 100% working


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

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