in the log it says this Number of vehicle models: 0 and i go in game no cars in there nothing but there should be
PHP код:
LoadcDealerships()
{
new string2[64];
format(string2, sizeof(string2), "cardealerships.ini");
new File: DealerFile = fopen(string2, io_read);
if ( DealerFile )
{
new key[ 256 ] , val[ 256 ];
new Data[ 256 ];
while ( fread( DealerFile , Data , sizeof( Data ) ) )
{
new string[128];
for(new f = 0; f < MAX_FAMILY; f++)
{
key = ini_GetKey( Data );
format(string, 128, "cd%dOwned",f);
if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); CarDealershipInfo[f][cdOwned] = strval( val ); }
format(string, 128, "cd%dOwner",f);
if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); strmid(CarDealershipInfo[f][cdOwner], val, 0, strlen(val)-1, 255); }
format(string, 128, "cd%dEntranceX",f);
if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); CarDealershipInfo[f][cdEntranceX] = floatstr( val ); }
format(string, 128, "cd%dEntranceY",f);
if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); CarDealershipInfo[f][cdEntranceY] = floatstr( val ); }
format(string, 128, "cd%dEntranceZ",f);
if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); CarDealershipInfo[f][cdEntranceZ] = floatstr( val ); }
format(string, 128, "cd%dExitX",f);
if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); CarDealershipInfo[f][cdExitX] = floatstr( val ); }
format(string, 128, "cd%dExitY",f);
if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); CarDealershipInfo[f][cdExitY] = floatstr( val ); }
format(string, 128, "cd%dExitZ",f);
if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); CarDealershipInfo[f][cdExitZ] = floatstr( val ); }
format(string, 128, "cd%dMessage",f);
if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); strmid(CarDealershipInfo[f][cdMessage], val, 0, strlen(val)-1, 255); }
format(string, 128, "cd%dTill",f);
if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); CarDealershipInfo[f][cdTill] = strval( val ); }
format(string, 128, "cd%dInterior",f);
if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); CarDealershipInfo[f][cdInterior] = strval( val ); }
format(string, 128, "cd%dVehicleSpawn0",f);
if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); CarDealershipInfo[f][cdVehicleSpawn][0] = floatstr( val ); }
format(string, 128, "cd%dVehicleSpawn1",f);
if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); CarDealershipInfo[f][cdVehicleSpawn][1] = floatstr( val ); }
format(string, 128, "cd%dVehicleSpawn2",f);
if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); CarDealershipInfo[f][cdVehicleSpawn][2] = floatstr( val ); }
format(string, 128, "cd%dVehicleSpawn3",f);
if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); CarDealershipInfo[f][cdVehicleSpawn][3] = floatstr( val ); }
format(string, 128, "cd%dRadius",f);
if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); CarDealershipInfo[f][cdRadius] = floatstr( val ); }
format(string, 128, "cd%dPrice",f);
if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); CarDealershipInfo[f][cdPrice] = strval( val ); }
for(new fv = 0; fv < MAX_DEALERSHIPVEHICLES; fv++)
{
format(string, 128, "cd%dVeh%dModelId",f, fv);
if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); CarDealershipInfo[f][cdVehicleModel][fv] = strval( val ); }
format(string, 128, "cd%dVeh%dCost",f, fv);
if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); CarDealershipInfo[f][cdVehicleCost][fv] = strval( val ); }
format(string, 128, "cd%dVeh%dSpawnX",f, fv);
if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); CarDealershipInfo[f][cdVehicleSpawnX][fv] = floatstr( val ); }
format(string, 128, "cd%dVeh%dSpawnY",f, fv);
if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); CarDealershipInfo[f][cdVehicleSpawnY][fv] = floatstr( val ); }
format(string, 128, "cd%dVeh%dSpawnZ",f, fv);
if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); CarDealershipInfo[f][cdVehicleSpawnZ][fv] = floatstr( val ); }
format(string, 128, "cd%dVeh%dSpawnA",f, fv);
if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); CarDealershipInfo[f][cdVehicleSpawnAngle][fv] = floatstr( val ); }
}
}
}
fclose(DealerFile);
}
return 1;
}
SavecDealerships()
{
new string3[32];
format(string3, sizeof(string3), "cardealerships.ini");
new File: hFile = fopen(string3, io_write);
if (hFile)
{
new var[32];
for(new f = 0; f < MAX_CARDEALERSHIPS; f++)
{
format(var, 32, "cd%dOwned=%d\n",f, CarDealershipInfo[f][cdOwned]); fwrite(hFile, var);
format(var, 32, "cd%dOwner=%s\n",f, CarDealershipInfo[f][cdOwner]); fwrite(hFile, var);
format(var, 32, "cd%dEntranceX=%.1f\n",f, CarDealershipInfo[f][cdEntranceX]); fwrite(hFile, var);
format(var, 32, "cd%dEntranceY=%.1f\n",f, CarDealershipInfo[f][cdEntranceY]); fwrite(hFile, var);
format(var, 32, "cd%dEntranceZ=%.1f\n",f, CarDealershipInfo[f][cdEntranceZ]); fwrite(hFile, var);
format(var, 32, "cd%dExitX=%.1f\n",f, CarDealershipInfo[f][cdExitX]); fwrite(hFile, var);
format(var, 32, "cd%dExitY=%.1f\n",f, CarDealershipInfo[f][cdExitX]); fwrite(hFile, var);
format(var, 32, "cd%dExitZ=%.1f\n",f, CarDealershipInfo[f][cdExitX]); fwrite(hFile, var);
format(var, 32, "cd%dMessage=%s\n\n",f, CarDealershipInfo[f][cdMessage]); fwrite(hFile, var);
format(var, 32, "cd%dTill=%d\n",f, CarDealershipInfo[f][cdTill]); fwrite(hFile, var);
format(var, 32, "cd%dInterior=%d\n",f, CarDealershipInfo[f][cdInterior]); fwrite(hFile, var);
format(var, 32, "cd%dVehicleSpawn0=%.1f\n",f, CarDealershipInfo[f][cdVehicleSpawn][0]); fwrite(hFile, var);
format(var, 32, "cd%dVehicleSpawn1=%.1f\n",f, CarDealershipInfo[f][cdVehicleSpawn][1]); fwrite(hFile, var);
format(var, 32, "cd%dVehicleSpawn2=%.1f\n",f, CarDealershipInfo[f][cdVehicleSpawn][2]); fwrite(hFile, var);
format(var, 32, "cd%dVehicleSpawn3=%.1f\n",f, CarDealershipInfo[f][cdVehicleSpawn][3]); fwrite(hFile, var);
format(var, 32, "cd%dRadius=%.1f\n",f, CarDealershipInfo[f][cdRadius]); fwrite(hFile, var);
format(var, 32, "cd%dPrice=%d\n",f, CarDealershipInfo[f][cdPrice]); fwrite(hFile, var);
for(new fv = 0; fv < MAX_DEALERSHIPVEHICLES; fv++)
{
format(var, 32, "cd%dVeh%dModelId=%d\n",f, fv, CarDealershipInfo[f][cdVehicleModel][fv]); fwrite(hFile, var);
format(var, 32, "cd%dVeh%dCost=%d\n",f, fv,CarDealershipInfo[f][cdVehicleCost][fv]); fwrite(hFile, var);
format(var, 32, "cd%dVeh%dSpawnX=%.1f\n",f, fv,CarDealershipInfo[f][cdVehicleSpawnX][fv]); fwrite(hFile, var);
format(var, 32, "cd%dVeh%dSpawnY=%.1f\n",f, fv,CarDealershipInfo[f][cdVehicleSpawnY][fv]); fwrite(hFile, var);
format(var, 32, "cd%dVeh%dSpawnZ=%.1f\n",f, fv,CarDealershipInfo[f][cdVehicleSpawnZ][fv]); fwrite(hFile, var);
format(var, 32, "cd%dVeh%dSpawnA=%.1f\n",f, fv,CarDealershipInfo[f][cdVehicleSpawnAngle][fv]); fwrite(hFile, var);
}
}
fclose(hFile);
}
return 1;
}
stock UpdatePoints() {
new
szFileStr[256],
File: fHandle = fopen("points.cfg", io_write);
if(fHandle)
{
for(new iIndex; iIndex < MAX_POINTS; iIndex++) {
format(szFileStr, sizeof(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(fHandle, szFileStr);
}
return fclose(fHandle);
}
return 0;
}