01.08.2009, 23:25
I have an script , but i don't know how to read from file and give custom name.ini vallues for PlayerInfo[playerid][AdminLevel] ,PlayerInfo[playerid][Moneyl] , etc .
So far it writes me some things in name.ini(%s.ini)
Here is the full script on pastebin http://pastebin.com/m699b9e43
I tryed something at public playerenter(playerid) .( Ps I'm calling the public playerenter(playerid) with command /login )
Here is the playerenter , anything else work fine .
And this is how an account looks like
Please don't say "use dini" coz i already tryed
So far it writes me some things in name.ini(%s.ini)
Here is the full script on pastebin http://pastebin.com/m699b9e43
I tryed something at public playerenter(playerid) .( Ps I'm calling the public playerenter(playerid) with command /login )
Here is the playerenter , anything else work fine .
pawn Код:
public playerenter(playerid)
{
new string2[64];
new valtmp[256];
new val[ 256 ];
new PassData[256];
new Data[ 256 ];
new key[ 256 ];
new playername2[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername2, sizeof(playername2));
format(string2, sizeof(string2), "%s.ini", playername2);
new File: UserFile = fopen(string2, io_read);
if ( UserFile )
{
valtmp = ini_GetValue( PassData );
while ( fread( UserFile , Data , sizeof( Data ) ) )
{
if( strcmp( key , "AdminLevel" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][AdminLevel] = strval( val );}
}
}
return 1;
}
Код:
AdminLevel=0 Money=0 Password=temppas Logedin=0 Coordx=1156901832.1 Coordy=1151860981.1 Coordz=1098251876.1
![Sad](images/smilies/sad.gif)