Raised This Month: $ Target: $400
 0% 

nvault double dimonsional array


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Natsheh
Veteran Member
Join Date: Sep 2012
Old 01-17-2021 , 14:36   Re: nvault double dimonsional array
Reply With Quote #4

why don't you work with bits it will be much easier.

here's an example

Code:
============>
menu format will be like.
============>
SKINS menu

1. Default Skin ( Selected )
2. GSG9 Killer ( Bought )
3. FBI Agent Killer ( Price 3000$ )
4. SAS Killer ( Bought )

===========>

enum (*=2)
{
     GSG9_KILLER = 1, // (1<<0)
     FBI_KILLER, // (1<<1)
     SAS_KILLER // (1<<2)
}


// meaning that user will have access to GSG9_KILLER skin and the SAS_KILLEr
g_PlayerSkins[ id ] = GSG9_KILLER|SAS_KILLER;

Save(id)
{
     new szData[32]; formatex(szData, charsmax(szData), "%d %d", g_iPlayerSelectedSkin[id], g_PlayerSkins[id]);
     nvault_set(nVault, g_szAuthID[ id ], szData)
}

Retrieve(id)
{
     new szData[32], szSelection[4];
     nvault_get(nVault, g_szAuthID[ id ], szData, charsmax(szData))
     strbreak(szData, szSelection, charsmax(szSelection), szData, charsmax(szData));
     g_iPlayerSelectedSkin[id] = str_to_num(szSelection);
     g_PlayerSkins[id] = str_to_num(szData);
}

Edit: Altho you will be limited for 32 skins which i think it will be more than enough
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 01-17-2021 at 15:07.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
 



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 14:06.


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