28.01.2011, 21:37
(
Последний раз редактировалось David5290; 29.01.2011 в 03:22.
)
Okay my clock shows but it starts at 16:30 and then it goes to like 17:30 then it restarts at 16:30 again.
I tried messing with it, to sync my clock to WorldTime, and I messed it up it seems.
Here's the codes that I have in my GameMode.
Could someone check these codes and make sure they are correct, if they aren't could you please fix them in a reply.
I tried messing with it, to sync my clock to WorldTime, and I messed it up it seems.
Here's the codes that I have in my GameMode.
Could someone check these codes and make sure they are correct, if they aren't could you please fix them in a reply.
Код:
public OnGameModeInit()
{
SetTimer("UpdateTime",65009, 1);
Код:
public OnPlayerConnect(playerid)
{
TogglePlayerClock(playerid, 1);
gettime(hour, minute);
PlayerInfo[playerid][logminute] = 0;
SetPlayerTime(playerid,hour,minute);
Код:
public OnPlayerSpawn(playerid) gettime(hour, minute); SetPlayerTime(playerid,hour,minute);
Код:
new worldTime;
public UpdateTime()
{
gettime(hour, minute);
worldTime++;
worldTime%=24;
SetWorldTime(hour);
new x=0;
while(x!=MAX_PLAYERS)
{
if(IsPlayerConnected(x) && GetPlayerState(x) != PLAYER_STATE_NONE)
{
SetPlayerTime(x,hour,minute);
}
x++;
}
if(minute < 1)
{
new string[128];
format(string, 128, "Game Time: %02d:00", minute);
SendClientMessageToAll(COLOR_GREEN, string);


