nVault
I have this vault and I need to add one more saving, it's bool variable: g_bTrue[][]. Here is what I have
PHP Code:
|
Re: nVault
Simply format it into your data string by converting it to a string like so:
Code:
bBooleanVariable ? "1" : "0"Code:
bBooleanVariable ? "true" : "false"Code:
format(szData, charsmax(szData), "%s %s %s", szString, szString, bBooleanVariable ? "1" : "0") |
Re: nVault
Yes, I understand. But what about formating data, should I create new formatex line? and new string near
PHP Code:
PHP Code:
|
Re: nVault
Why do you you need to loop through it? What does this array contain?
|
Re: nVault
It contains g_szSomething
PHP Code:
Quote:
|
Re: nVault
You can make a loop to append a 1 or a 0 for each one.
|
Re: nVault
This is my attempt, is it okay? Will it save and load data correctly and is it the best way?
PHP Code:
|
Re: nVault
Are you just trying to save a list of boolean settings? If so, you can accomplish this with a single bit-field. With this, the saved data will appear as a random integer "234343" in nvault and not plain english "setting1:0#setting2:4".
If this isn't what you have in mind, explain what you're trying to do in english instead of code. |
Re: nVault
Yes I'm trying to save a list of bools, some of them can be true and other will be false, so I need to save and load them correctly and in the best way :) Added this in to my first post's code would be great :) When I make some bools (from the g_szSomething) true and reconnect I want to see them true.
|
Re: nVault
From this tut: https://forums.alliedmods.net/showthread.php?t=139916
PHP Code:
PHP Code:
|
| All times are GMT -4. The time now is 17:41. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.