Can't change weather in my server
#2

Quote:
Originally Posted by WingedFrostWolf
Посмотреть сообщение
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!
If you mean the function GetWeather(weather);

It is not, but it can be created from an array

PHP код:
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;

* Since sa-mp 0.3.7 R2-1:

PHP код:
// 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;

Reply


Messages In This Thread
[FIXED]Can't change weather in my server - by WingedFrostWolf - 28.08.2015, 11:27
Re: Can't change weather in my server - by Logofero - 28.08.2015, 14:46
Re: Can't change weather in my server - by WingedFrostWolf - 28.08.2015, 18:57

Forum Jump:


Users browsing this thread: 1 Guest(s)