OnGameModeExit problems.
#1

Why does this reset all values to 0.0?

pawn Code:
public  OnGameModeExit( ) {
    new
        vPath[48];
       
    for( new v = 0; v < MAX_OWNED_VEHICLES; v++ ) {
        format( vPath, sizeof( vPath ), VEHICLE_PATH, v);
        if( fexist ( vPath ) ) {
            printf("vPath: %s", vPath);
            new
                mStr[48],
                Float:vPos[4],
                C1,         C2,
                INI:vehFile = INI_Open( vPath );
               
            GetVehiclePos( v, vPos[0], vPos[1], vPos[2] );
            GetVehicleZAngle( v, vPos[3] );
            GetVehicleColor( v, C1, C2 );
               
            INI_SetTag(vehFile, "vehicle");
           
            INI_WriteInt(vehFile, "ModelID",            vehInfo[v][ModelID]);
            INI_WriteInt(vehFile, "PrimaryColour",      C1);
            INI_WriteInt(vehFile, "SecondaryColour",    C2);
           
            INI_WriteInt(vehFile, "Locked",             vehInfo[v][Locked]);
           
            for( new m = 0; m < MAX_VEHICLE_MODS; m++ ) {
                format( mStr, sizeof( mStr ), "Modification%d", m);
                INI_WriteInt(vehFile, mStr,             vehInfo[v][Modification][m]);
            }
           
            INI_WriteString(vehFile, "Owner",           vehInfo[v][Owner]);
            INI_WriteString(vehFile, "LicensePlate",    vehInfo[v][LicensePlate]);

            INI_WriteFloat(vehFile, "XPOS",             vPos[0]);
            printf("vPos[0]: %f", vPos[0]);
            INI_WriteFloat(vehFile, "YPOS",             vPos[1]);
            INI_WriteFloat(vehFile, "ZPOS",             vPos[2]);
            INI_WriteFloat(vehFile, "APOS",             vPos[3]);
               
            INI_Close( vehFile );
        }
    }
    return true;
}
Reply


Messages In This Thread
OnGameModeExit problems. - by 2KY - 07.03.2012, 02:09
Re: OnGameModeExit problems. - by Shabi RoxX - 07.03.2012, 09:03
Re: OnGameModeExit problems. - by T0pAz - 07.03.2012, 09:38
Re: OnGameModeExit problems. - by 2KY - 07.03.2012, 12:45

Forum Jump:


Users browsing this thread: 1 Guest(s)