Raised This Month: $51 Target: $400
 12% 

Storing data


Post New Thread Reply   
 
Thread Tools Display Modes
Natsheh
Veteran Member
Join Date: Sep 2012
Old 02-01-2020 , 06:23   Re: Storing data
Reply With Quote #11

I suggest you to save the skins by name and not an index inside an array.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 02-01-2020 at 06:23.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Airkish
AlliedModders Donor
Join Date: Apr 2016
Location: Lithuania
Old 02-01-2020 , 08:59   Re: Storing data
Reply With Quote #12

Quote:
Originally Posted by Natsheh View Post
I suggest you to save the skins by name and not an index inside an array.
User can have multiple skins with same name, so that wouldn't work.

Quote:
Originally Posted by Bugsy View Post
Can do something like this:
PHP Code:
#define MAX_USER_SKINS 1024 //let's say user can have max 1024 skins

enum SkinData
{
    
SkinID,
    
bool:IsStattrak,
    
SkinLevel
}

new 
g_sdPlayerSkinsMAX_PLAYERS ][ MAX_USER_SKINS ][ SkinData ];

public 
QueryHandleFailState Handle:Query , const Error[] , Errcode , const Data] , DataSize )
{
    new 
id Data]
    new 
0;
    
    while( ( 
MAX_USER_SKINS ) && SQL_MoreResultsQuery ) ) 
    {
        
g_sdPlayerSkinsid ][ ][ SkinID ] = SQL_ReadResultQuery );
        
g_sdPlayerSkinsid ][ ][ IsStattrak ] = bool:SQL_ReadResultQuery );
        
g_sdPlayerSkinsid ][ ][ SkinLevel ] = SQL_ReadResultQuery );
        
i++;
    } 


Thanks Bugsy, I'll probably go with this.
__________________

Last edited by Airkish; 02-01-2020 at 09:00.
Airkish 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 22:22.


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