Loading my level from file?
#1

Hey guys,

Does anyone know what could be the problem , i got about 20lines of saving all of them saves , but when it comes to
loading , only 19 loads, the first one which is:

pawn Код:
if( strcmp( key , "Level" , true ) == 0 ) { val = ini_GetValue( Data ); playerDB[playerid][Level] = strval( val ); }
That line doesn't load above, everything else loads and they are same like that line above:

pawn Код:
if( strcmp( key , "Patirtis" , true ) == 0 ) { val = ini_GetValue( Data ); playerDB[playerid][Patirtis] = strval( val ); }
anyone knows the problem? rly annoying..


EDIT: It loads onplayerlogin, and saves onplayerupdateaccount, i always check after closing the server if theres the LEVEL, and there IS!when i connect its still there, just as i login it vanishes to 0or nothing.
Reply
#2

val is not string?
Why you use = strval( val ) then? use just = val
Reply
#3

doesn't work too.
Reply
#4

could you show how you format
Data
and key
?
Reply
#5

here:

pawn Код:
new PassData[256];
              new keytmp[256], valtmp[256];
              fread( level , PassData , sizeof( PassData ) );
              keytmp = ini_GetKey( PassData );
              if( strcmp( keytmp , "Slaptazodis" , true ) == 0 )
                {
                    valtmp = ini_GetValue( PassData );
                    strmid(playerDB[playerid][Slaptazodis], valtmp, 0, strlen(valtmp)-1, 255);
                }
                if(strcmp(playerDB[playerid][Slaptazodis],slaptazodis, true ) == 0 )
                {
                      new key[ 256 ] , val[ 256 ];
                      new Data[ 256 ];
                      while ( fread( level , Data , sizeof( Data ) ) )
                        {
                        key = ini_GetKey( Data );
                        if( strcmp( key , "Lygis" , true ) == 0 ) { val = ini_GetValue( Data ); playerDB[playerid][Lygis] = strval( val ); }
Reply
#6

guys?
Reply
#7

Quote:
Originally Posted by 0ne
pawn Код:
new Data[ 256 ];
                      while ( fread( level , Data , sizeof( Data ) ) )
You need to format Data before trying to read from it.
Reply
#8

what do you mean? It only fails to load Level not everything else..
Reply
#9

Ummm.... Guys?
Reply
#10

Is there a variable called "Level" in the file itself?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)