AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   nVault - looping through all entries (https://forums.alliedmods.net/showthread.php?t=27501)

v3x 04-23-2006 10:06

nVault - looping through all entries
 
How would I loop through every single entry in the vault and then set the data to something where "entry = BLAH"?

Twilight Suzuka 04-23-2006 10:51

You CANT!
If you need something like this, something that works less like a long term storage device, and more like an ACTUAL dynamic unit, use Array module. Thats what it was MADE for.

v3x 04-23-2006 10:52

zomg, noes :'(

I have no clue how to use Array module.

Maybe you could give me a brief example?

Twilight Suzuka 04-23-2006 11:02

Explain what you want to do.

v3x 04-23-2006 11:16

Loop through all keys and set their values to "0".

Twilight Suzuka 04-23-2006 11:22

For a list of any kind:
Code:

static success;
        for(new next = list_first(sample_list,_, success); success != 0 ; next = list_next(sample_list,next, success))
// in for loop, set stuff

for a map of any kind:

Code:

        static next[512], success
        map_first(map_example, _, next, 511, success);

        while(success != 0 )
// do stuff
map_next(map_example, next, next, 511, success);



All times are GMT -4. The time now is 05:12.

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