02.10.2011, 22:32
hola tengo un problema es que cuando uno muere el clima es de dia pero cuando muero de nuevo se pone de noche como puedo poner el clima que corra bien .
//Example to sync time between players
static i_ServerSeconds;
static i_ServerMinutes;
static i_ServerHours;
forward ProcessGameTime();
public OnGameModeInit()
{
SetTimer("ProcessGameTime", 1000, 1);
}
public ProcessGameTime()
{
i_ServerSeconds++;
// One minute has passed...
if(i_ServerSeconds == 60)
{
// Reset the second counter
i_ServerSeconds = 0;
// Increment the minute counter
i_ServerMinutes++;
// One hour has passed
if(i_ServerMinutes == 60)
{
i_ServerMinutes = 0;
i_ServerHours++;
if(i_ServerHours == 24)
{
// One day has passed
i_ServerHours = 0;
}
}
}
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
UpdatePlayerTime(playerid);
}
stock UpdatePlayerTime(playerid)
{
SetPlayerTime(playerid, i_ServerHours, i_ServerMinutes);
}