Quote:
Originally Posted by Natsheh
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
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_sdPlayerSkins[ MAX_PLAYERS + 1 ][ MAX_USER_SKINS ][ SkinData ];
public QueryHandle( FailState , Handle:Query , const Error[] , Errcode , const Data[ 1 ] , DataSize ) { new id = Data[ 0 ] new i = 0; while( ( i < MAX_USER_SKINS ) && SQL_MoreResults( Query ) ) { g_sdPlayerSkins[ id ][ i ][ SkinID ] = SQL_ReadResult( Query , 1 ); g_sdPlayerSkins[ id ][ i ][ IsStattrak ] = bool:SQL_ReadResult( Query , 2 ); g_sdPlayerSkins[ id ][ i ][ SkinLevel ] = SQL_ReadResult( Query , 3 ); i++; }
}
|
Thanks Bugsy, I'll probably go with this.
__________________