24.03.2016, 16:40
This is my code i am trying to save server weather and time in a file called "WeatherInfo.INI" it works and save but when i restart the server both time and weather will be set to 0
My code:
My code:
PHP код:
enum wInfo
{
Weather,
Time
};
new WeatherInfo[wInfo];
// gamemodeint
INI_ParseFile("WeatherInfo.INI" , "LoadWeather_%s", .bExtra = true );
printf("Weather: %i.", WeatherInfo[Weather]);
printf("Time: %i.", WeatherInfo[Time]);
//gamemodeexit
new INI:File = INI_Open("WeatherInfo.INI");
INI_SetTag(File,"WeatherInfo");
INI_WriteInt(File,"Weather", WeatherInfo[Weather]);
INI_WriteInt(File,"Time", WeatherInfo[Time]);
INI_Close(File);
//loadfunction
forward LoadWeather_WeatherInfo(name[], value[]);
public LoadWeather_WeatherInfo(name[], value[])
{
INI_Int("Weather", WeatherInfo[Weather]);
INI_Int("Time", WeatherInfo[Time]);
return 1;
}