Raised This Month: $32 Target: $400
 8% 

Need help with nvault array


Post New Thread Reply   
 
Thread Tools Display Modes
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-25-2022 , 11:31   Re: Need help with nvault array
Reply With Quote #11

Show the variables definition.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
abdelwahab
Member
Join Date: Aug 2019
Old 06-25-2022 , 11:35   Re: Need help with nvault array
Reply With Quote #12

enum any:TYPES
{
PACKS = 0,
POINTS,
COINS
}
new g_PlayerGamePoints[33][TYPES]
new g_level[33]
new g_exp[33]
new g_zombieclass[33]
new g_zombieclassnext[33]
new g_humanclass[33]
new g_humanclassnext[33]
abdelwahab is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-25-2022 , 23:26   Re: Need help with nvault array
Reply With Quote #13

Quote:
Originally Posted by abdelwahab View Post
hmm 2 separate plugins ?
If you have 1 or 50 plugins it doesn't matter to the rule, from an individual data record perspective, nvault_get can only be used with nvault_set, and nvault_get_array can only be used with nvault_set_array. A vault file can have a mixture of regular nvault and nvault array data.
__________________
Bugsy is offline
abdelwahab
Member
Join Date: Aug 2019
Old 06-26-2022 , 09:46   Re: Need help with nvault array
Reply With Quote #14

Quote:
Originally Posted by Bugsy View Post
If you have 1 or 50 plugins it doesn't matter to the rule, from an individual data record perspective, nvault_get can only be used with nvault_set, and nvault_get_array can only be used with nvault_set_array. A vault file can have a mixture of regular nvault and nvault array data.
Is it possible to use the same vault from another plugin ?

Last edited by abdelwahab; 06-26-2022 at 09:50.
abdelwahab is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-27-2022 , 03:39   Re: Need help with nvault array
Reply With Quote #15

Since you're using individual players arrays to save players data you need to use nvault_set/get instead of nvault_set/grt_array
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-27-2022 , 16:33   Re: Need help with nvault array
Reply With Quote #16

Right, you could consolidate all player data items to a single nvault array record for each player, instead of having multiple nvault records for each data item, for each player.

So with nvault array you could have this for each player:

Code:
Key:STEAM:0:12345
Data: <Points, XP, Money>
Instead of all of these for each player

Code:
Key:STEAM:0:12345_Points
Data: Points value
Code:
Key:STEAM:0:12345_XP
Data: XP value
Code:
Key:STEAM:0:12345_Money
Data: Money value
__________________
Bugsy is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:36.


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