public OnGameModeInit()
{
SetWorldTime(0);
}
public OnPlayerSpawn(playerid)
{
TogglePlayerClock(playerid, true);
return 1;
}
new ClockMinutes;
new ClockHours;
public OnGameModeInit()
{
ClockMinutes = 0;
ClockHours = 0;
SetTimer("Clock", 1000, true);
SetTimer("SetTime", 1000, true);
return 1;
}
forward SetTime();
public SetTime()
{
for(new i = 0; i < MAX_PLAYERS; i ++)
{
SetPlayerTime(i, ClockHours, ClockMinutes);
}
return 1;
}
forward Clock();
public Clock()
{
ClockMinutes ++;
if(ClockMinutes >= 60)
{
ClockHours ++;
ClockMinutes = 0;
}
return 1;
}
|
Originally Posted by Johnson_boy
You could try this:
pawn Код:
Код:
public OnGameModeInit()
{
ClockMinutes = 0;
ClockHours = 0;
SetTimer("Clock", 1000, true);
SetTimer("SetTime", 1000, true);
return 1;
}
Код:
forward SetTime();
public SetTime()
{
for(new i = 0; i < MAX_PLAYERS; i ++)
{
SetPlayerTime(i, ClockHours, ClockMinutes);
}
return 1;
}
forward Clock();
public Clock()
{
ClockMinutes ++;
if(ClockMinutes >= 60)
{
ClockHours ++;
ClockMinutes = 0;
}
return 1;
}
|
SetPlayerTime(i, ClockHours, ClockMinutes);