Need help in changing
#1

The is house my house system works, it is based on userfile, the variable of house entrance x e.t.c are stored in user file instead of any .cfg, but I want to read these data of all house files on game mode int, so houses still stay on playerdisconnect (we can remove that but, they will be not there on server restart), So is there any way i can change?
Код:
 	new tmp2[256];
    new string2[128];
	format(string2, sizeof(string2), "%s.ini", PlayerName(playerid));
	new File: UserFile = fopen(string2, io_read);
	if ( UserFile )
    {
        new PassData[128];
	    new keytmp[256], valtmp[256];
	    fread( UserFile , PassData , sizeof( PassData ) );
	    keytmp = ini_GetKey( PassData );
	    if( strcmp( keytmp , "Key" , true ) == 0 )
		{
			valtmp = ini_GetValue( PassData );
			strmid(PlayerInfo[playerid][pKey], valtmp, 0, strlen(valtmp)-1, 255);
		}
		if(strcmp(PlayerInfo[playerid][pKey],password, true ) == 0 )
        {
	    	new key[ 256 ] , val[ 256 ];
			new Data[ 256 ];
			while ( fread( UserFile , Data , sizeof( Data ) ) )
			{
if( strcmp( key , "HouseX" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pHouseX] = floatstr( val ); }
			    key = ini_GetKey( Data );
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)