Number of vehicle models: 0?
#4

PHP код:
LoadcDealerships()
{
    new 
string2[64];
    
format(string2sizeof(string2), "cardealerships.ini");
    new 
FileDealerFile fopen(string2io_read);
    if ( 
DealerFile )
    {
        new 
key256 ] , val256 ];
        new 
Data256 ];
        while ( 
freadDealerFile Data sizeofData ) ) )
        {
            new 
string[128];
            for(new 
0MAX_FAMILYf++)
            {
                
key ini_GetKeyData );
                
format(string128"cd%dOwned",f);
                if( 
strcmpkey string true ) == ) { val ini_GetValueData ); CarDealershipInfo[f][cdOwned] = strvalval ); }
                
format(string128"cd%dOwner",f);
                if( 
strcmpkey string true ) == ) { val ini_GetValueData ); strmid(CarDealershipInfo[f][cdOwner], val0strlen(val)-1255); }
                
format(string128"cd%dEntranceX",f);
                if( 
strcmpkey string true ) == ) { val ini_GetValueData ); CarDealershipInfo[f][cdEntranceX] = floatstrval ); }
                
format(string128"cd%dEntranceY",f);
                if( 
strcmpkey string true ) == ) { val ini_GetValueData ); CarDealershipInfo[f][cdEntranceY] = floatstrval ); }
                
format(string128"cd%dEntranceZ",f);
                if( 
strcmpkey string true ) == ) { val ini_GetValueData ); CarDealershipInfo[f][cdEntranceZ] = floatstrval ); }
                
format(string128"cd%dExitX",f);
                if( 
strcmpkey string true ) == ) { val ini_GetValueData ); CarDealershipInfo[f][cdExitX] = floatstrval ); }
                
format(string128"cd%dExitY",f);
                if( 
strcmpkey string true ) == ) { val ini_GetValueData ); CarDealershipInfo[f][cdExitY] = floatstrval ); }
                
format(string128"cd%dExitZ",f);
                if( 
strcmpkey string true ) == ) { val ini_GetValueData ); CarDealershipInfo[f][cdExitZ] = floatstrval ); }
                
format(string128"cd%dMessage",f);
                if( 
strcmpkey string true ) == ) { val ini_GetValueData ); strmid(CarDealershipInfo[f][cdMessage], val0strlen(val)-1255); }
                
format(string128"cd%dTill",f);
                if( 
strcmpkey string true ) == ) { val ini_GetValueData ); CarDealershipInfo[f][cdTill] = strvalval ); }
                
format(string128"cd%dInterior",f);
                if( 
strcmpkey string true ) == ) { val ini_GetValueData ); CarDealershipInfo[f][cdInterior] = strvalval ); }
                
format(string128"cd%dVehicleSpawn0",f);
                if( 
strcmpkey string true ) == ) { val ini_GetValueData ); CarDealershipInfo[f][cdVehicleSpawn][0] = floatstrval ); }
                
format(string128"cd%dVehicleSpawn1",f);
                if( 
strcmpkey string true ) == ) { val ini_GetValueData ); CarDealershipInfo[f][cdVehicleSpawn][1] = floatstrval ); }
                
format(string128"cd%dVehicleSpawn2",f);
                if( 
strcmpkey string true ) == ) { val ini_GetValueData ); CarDealershipInfo[f][cdVehicleSpawn][2] = floatstrval ); }
                
format(string128"cd%dVehicleSpawn3",f);
                if( 
strcmpkey string true ) == ) { val ini_GetValueData ); CarDealershipInfo[f][cdVehicleSpawn][3] = floatstrval ); }
                
format(string128"cd%dRadius",f);
                if( 
strcmpkey string true ) == ) { val ini_GetValueData ); CarDealershipInfo[f][cdRadius] = floatstrval ); }
                
format(string128"cd%dPrice",f);
                if( 
strcmpkey string true ) == ) { val ini_GetValueData ); CarDealershipInfo[f][cdPrice] = strvalval ); }
                for(new 
fv 0fv MAX_DEALERSHIPVEHICLESfv++)
                {
                    
format(string128"cd%dVeh%dModelId",ffv);
                    if( 
strcmpkey string true ) == ) { val ini_GetValueData ); CarDealershipInfo[f][cdVehicleModel][fv] = strvalval ); }
                    
format(string128"cd%dVeh%dCost",ffv);
                    if( 
strcmpkey string true ) == ) { val ini_GetValueData ); CarDealershipInfo[f][cdVehicleCost][fv] = strvalval ); }
                    
format(string128"cd%dVeh%dSpawnX",ffv);
                    if( 
strcmpkey string true ) == ) { val ini_GetValueData ); CarDealershipInfo[f][cdVehicleSpawnX][fv] = floatstrval ); }
                    
format(string128"cd%dVeh%dSpawnY",ffv);
                    if( 
strcmpkey string true ) == ) { val ini_GetValueData ); CarDealershipInfo[f][cdVehicleSpawnY][fv] = floatstrval ); }
                    
format(string128"cd%dVeh%dSpawnZ",ffv);
                    if( 
strcmpkey string true ) == ) { val ini_GetValueData ); CarDealershipInfo[f][cdVehicleSpawnZ][fv] = floatstrval ); }
                    
format(string128"cd%dVeh%dSpawnA",ffv);
                    if( 
strcmpkey string true ) == ) { val ini_GetValueData ); CarDealershipInfo[f][cdVehicleSpawnAngle][fv] = floatstrval ); }
                }
            }
        }
        
fclose(DealerFile);
    }
    return 
1;
}
SavecDealerships()
{
    new 
string3[32];
    
format(string3sizeof(string3), "cardealerships.ini");
    new 
FilehFile fopen(string3io_write);
    if (
hFile)
    {
        new var[
32];
        for(new 
0MAX_CARDEALERSHIPSf++)
           {
            
format(var, 32"cd%dOwned=%d\n",fCarDealershipInfo[f][cdOwned]); fwrite(hFile, var);
            
format(var, 32"cd%dOwner=%s\n",fCarDealershipInfo[f][cdOwner]); fwrite(hFile, var);
            
format(var, 32"cd%dEntranceX=%.1f\n",fCarDealershipInfo[f][cdEntranceX]); fwrite(hFile, var);
            
format(var, 32"cd%dEntranceY=%.1f\n",fCarDealershipInfo[f][cdEntranceY]); fwrite(hFile, var);
            
format(var, 32"cd%dEntranceZ=%.1f\n",fCarDealershipInfo[f][cdEntranceZ]); fwrite(hFile, var);
            
format(var, 32"cd%dExitX=%.1f\n",fCarDealershipInfo[f][cdExitX]); fwrite(hFile, var);
            
format(var, 32"cd%dExitY=%.1f\n",fCarDealershipInfo[f][cdExitX]); fwrite(hFile, var);
            
format(var, 32"cd%dExitZ=%.1f\n",fCarDealershipInfo[f][cdExitX]); fwrite(hFile, var);
            
format(var, 32"cd%dMessage=%s\n\n",fCarDealershipInfo[f][cdMessage]); fwrite(hFile, var);
            
format(var, 32"cd%dTill=%d\n",fCarDealershipInfo[f][cdTill]); fwrite(hFile, var);
            
format(var, 32"cd%dInterior=%d\n",fCarDealershipInfo[f][cdInterior]); fwrite(hFile, var);
            
format(var, 32"cd%dVehicleSpawn0=%.1f\n",fCarDealershipInfo[f][cdVehicleSpawn][0]); fwrite(hFile, var);
            
format(var, 32"cd%dVehicleSpawn1=%.1f\n",fCarDealershipInfo[f][cdVehicleSpawn][1]); fwrite(hFile, var);
            
format(var, 32"cd%dVehicleSpawn2=%.1f\n",fCarDealershipInfo[f][cdVehicleSpawn][2]); fwrite(hFile, var);
            
format(var, 32"cd%dVehicleSpawn3=%.1f\n",fCarDealershipInfo[f][cdVehicleSpawn][3]); fwrite(hFile, var);
            
format(var, 32"cd%dRadius=%.1f\n",fCarDealershipInfo[f][cdRadius]); fwrite(hFile, var);
            
format(var, 32"cd%dPrice=%d\n",fCarDealershipInfo[f][cdPrice]); fwrite(hFile, var);
            for(new 
fv 0fv MAX_DEALERSHIPVEHICLESfv++)
               {
                   
format(var, 32"cd%dVeh%dModelId=%d\n",ffvCarDealershipInfo[f][cdVehicleModel][fv]); fwrite(hFile, var);
                
format(var, 32"cd%dVeh%dCost=%d\n",ffv,CarDealershipInfo[f][cdVehicleCost][fv]); fwrite(hFile, var);
                
format(var, 32"cd%dVeh%dSpawnX=%.1f\n",ffv,CarDealershipInfo[f][cdVehicleSpawnX][fv]); fwrite(hFile, var);
                
format(var, 32"cd%dVeh%dSpawnY=%.1f\n",ffv,CarDealershipInfo[f][cdVehicleSpawnY][fv]); fwrite(hFile, var);
                
format(var, 32"cd%dVeh%dSpawnZ=%.1f\n",ffv,CarDealershipInfo[f][cdVehicleSpawnZ][fv]); fwrite(hFile, var);
                
format(var, 32"cd%dVeh%dSpawnA=%.1f\n",ffv,CarDealershipInfo[f][cdVehicleSpawnAngle][fv]); fwrite(hFile, var);
            }
          }
        
fclose(hFile);
    }
    return 
1;
}
stock UpdatePoints() {
    new
        
szFileStr[256],
        
FilefHandle fopen("points.cfg"io_write);
    if(
fHandle)
    {
        for(new 
iIndexiIndex MAX_POINTSiIndex++) {
            
format(szFileStrsizeof(szFileStr), "%f|%f|%f|%d|%d|%s|%s|%s|%d\r\n",
                
Points[iIndex][Pointx],
                
Points[iIndex][Pointy],
                
Points[iIndex][Pointz],
                
Points[iIndex][Type],
                
Points[iIndex][Vulnerable],
                
Points[iIndex][Owner],
                
Points[iIndex][CapperName],
                
Points[iIndex][Name],
                
Points[iIndex][MatPoint]
            );
            
fwrite(fHandleszFileStr);
        }
        return 
fclose(fHandle);
    }
    return 
0;

Reply


Messages In This Thread
Number of vehicle models: 0? - by Samieastwood - 24.11.2014, 21:06
Re: Number of vehicle models: 0? - by Samieastwood - 24.11.2014, 21:24
Re: Number of vehicle models: 0? - by Rdx - 24.11.2014, 21:28
Re: Number of vehicle models: 0? - by Samieastwood - 24.11.2014, 21:43

Forum Jump:


Users browsing this thread: 1 Guest(s)