16.03.2011, 17:53
Hello all!
I have a problem with y_ini.. So, when player leaves server its saves all items, etc.. But, when I connect(server checks player file if its exists or not fine) and spawn - my all stats are nulled..
Login dialog:
UzkraunamProfili:
I have a problem with y_ini.. So, when player leaves server its saves all items, etc.. But, when I connect(server checks player file if its exists or not fine) and spawn - my all stats are nulled..
Login dialog:
pawn Код:
case 1:
{
if( !strlen( inputtext ) ) return ShowPlayerDialog( playerid, 1, DIALOG_STYLE_INPUT, ""#h_Balta"Prisijungimas.", ""#h_Zydra"Suveskite savo slaptaюodб, jog galлtшmлte tжsti.\n\n"#h_Raudona"Laukelyje PRIVALO bыti бvestas Jыsш slaptaюodis", "Prisijungti", "" );
new
Failas[ 51 ]
;
format( Failas, 51, "DuomenuBaze/Zaidejai/%s.ini", Vardas( playerid ) );
INI_ParseFile( Failas, "UzkraunamSlaptazodi", false, true, playerid, true, false );
if( ! strcmp( inputtext, ZaidejuDB[ playerid ][ pSlaptazodis ], false ) )
{
ZaidejuDB[ playerid ][ pPrisijunges ] = 1;
SendClientMessage( playerid, -1, ""#h_Balta"["#h_Zydra"SERVERIS"#h_Balta"] "#h_Raudona"Sлkmingai prisijungлte." );
INI_ParseFile( Failas, "UzkraunamProfili", false, true, playerid, true, false );
}
else
{
SendClientMessage( playerid, -1, ""#h_Balta"["#h_Zydra"SERVERIS"#h_Balta"] "#h_Raudona"Slaptaюodis yra neteisingas." );
Kick( playerid );
}
}
pawn Код:
forward UzkraunamProfili( playerid, vardas[ ], nustatymas[ ] );
public UzkraunamProfili( playerid, vardas[ ], nustatymas[ ] )
{
// Funkcija: UzkraunamProfili( playerid, vardas, nustatymas[ ] )
// Uюkraus юaidлjo profilб, pagal parametrus.
if( ! strcmp( vardas, "Administratorius", true ) ) ZaidejuDB[ playerid ][ pAdministratorius ] = strval( nustatymas );
if( ! strcmp( vardas, "Pralaimejimai", true ) ) ZaidejuDB[ playerid ][ pPralaimejimai ] = strval( nustatymas );
if( ! strcmp( vardas, "Laimejimai", true ) ) ZaidejuDB[ playerid ][ pLaimejimai ] = strval( nustatymas );
if( ! strcmp( vardas, "Nuzudymai", true ) ) ZaidejuDB[ playerid ][ pNuzudymai ] = strval( nustatymas );
if( ! strcmp( vardas, "Patirtis", true ) ) SetPlayerScore( playerid, strval( nustatymas ) );
if( ! strcmp( vardas, "Pinigai", true ) ) GivePlayerMoneyEx( playerid, strval( nustatymas ) );
if( ! strcmp( vardas, "Mirtys", true ) ) ZaidejuDB[ playerid ][ pMirtys ] = strval( nustatymas );
if( ! strcmp( vardas, "Rankas", true ) ) ZaidejuDB[ playerid ][ pRangas ] = strval( nustatymas );
return true;
}