AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Save bool with map changing (https://forums.alliedmods.net/showthread.php?t=163562)

eXtrem 07-31-2011 16:39

Save bool with map changing
 
Hi,

I'd like to know how to save a boolean variable (with array) without vault and even if the map change.

Is it possible ?

Thanks.

zeus 07-31-2011 16:56

Re: Save bool with map changing
 
file,nvault,sql

eXtrem 07-31-2011 16:58

Re: Save bool with map changing
 
Ok thanks

fysiks 07-31-2011 17:11

Re: Save bool with map changing
 
local info will work too. [s|g]et_localinfo().

eXtrem 07-31-2011 17:18

Re: Save bool with map changing
 
Thanks :)

EDIT : How can I do if I have this :

Code:
#define WEAPONS CSW_P90 new bool:bWeapon[ WEAPONS ] function( ) {      .....      new weaponid = get_weaponid( szWeapon )      // my bool : bWeapon[ weaponid ] }

Hunter-Digital 07-31-2011 17:52

Re: Save bool with map changing
 
What exacly do you need to check after mapchange ?
Because if you want an array, either you use a bitsum to store the weapon IDs or make 29 different localinfos, each having it's weapon ... which isn't verry pretty... so, answer the above question.

eXtrem 07-31-2011 19:15

Re: Save bool with map changing
 
I want to save my boolean with each array. (bool[ 1 ] = true; bool[ 2 ] = false; bool[ 3 ] = false etc...)

I have a command which modify this boolean and I would like to load it at each changemap.

Bugsy 07-31-2011 21:18

Re: Save bool with map changing
 
CSW_P90 = 30 so you can store bool values in a single variable via a bit field which makes saving easy. Look here.

Also, why do you not want to use nvault?

eXtrem 07-31-2011 22:07

Re: Save bool with map changing
 
Quote:

Originally Posted by Bugsy (Post 1523015)
Also, why do you not want to use nvault?

Because I don't want to use nvault for just a boolean.

Thank you very much.

fysiks 07-31-2011 22:43

Re: Save bool with map changing
 
Also realize that local info is lost when you shutdown the server so it should only be used if you only need the info between mapchanges.


All times are GMT -4. The time now is 03:22.

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