Loading my level from file? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Loading my level from file? (
/showthread.php?tid=144259)
Loading my level from file? -
0ne - 26.04.2010
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.
Re: Loading my level from file? -
SiJ - 26.04.2010
val is not string?
Why you use
= strval( val ) then? use just
= val
Re: Loading my level from file? -
0ne - 26.04.2010
doesn't work too.
Re: Loading my level from file? -
SiJ - 26.04.2010
could you show how you format
Data
and
key
?
Re: Loading my level from file? -
0ne - 26.04.2010
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 ); }
Re: Loading my level from file? -
0ne - 27.04.2010
guys?
Re: Loading my level from file? -
SiJ - 27.04.2010
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.
Re: Loading my level from file? -
0ne - 27.04.2010
what do you mean? It only fails to load Level not everything else..
Re: Loading my level from file? -
0ne - 28.04.2010
Ummm....

Guys?
Re: Loading my level from file? -
MenaceX^ - 28.04.2010
Is there a variable called "Level" in the file itself?