Hello, I just ran into an issue where I can't seem to be able to change the weather of my server, nor the time. I tried isolating the problem, which resulted in it occuring with only my gamemode running. However, I can't find in the gamemode script any sign of a weather reverting script, as the search for "weather" gave no results. If anyone happens to know what might be causing this problem, and wants to share, I'd be very thankfull. Thank you for reading!
|
enum E_SRV_INFO {
WEATHERID,
HOURS
}
new srv_info[E_SRV_INFO];
// Declaration new functions
#define SetWeatherAll(%1) srv_info[WEATHERID] = %1; SetWeather(%1)
#define GetWeatherAll() srv_info[WEATHERID]
#define SetTimeAll(%1) srv_info[HOURS] = %1; SetWorldTime(%1)
#define GetTimeAll() srv_info[HOURS]
public OnGameModeInit() {
SetTimeAll(5);
SetWeatherAll(3);
return true;
}
public OnPlayerSpawn(playerid) {
prinf("SERVER: hours %d weather %d", GetTimeAll(), GetWeatherAll());
return true;
}
// Server wide persistent variable system (SVars)
// Declaration new functions
#define SetWeatherAll(%1) SetSVarInt("WEATHERID", %1); SetWeather(%1)
#define GetWeatherAll() GetSVarInt("WEATHERID")
#define SetTimeAll(%1) SetSVarInt("HOURS", %1); SetWorldTime(%1)
#define GetTimeAll() GetSVarInt("HOURS")
public OnGameModeInit() {
SetTimeAll(5);
SetWeatherAll(3);
return true;
}
public OnPlayerSpawn(playerid) {
prinf("SERVER: hours %d weather %d", GetTimeAll(), GetWeatherAll());
return true;
}