20.01.2015, 16:09
pawn Код:
#include <a_samp>
#include <foreach>
public OnGameModeInit()
{
SetTimer("TimeUpdater",1000,true);
return 1;
}
forward TimeUpdater(playerid);
public TimeUpdater(playerid)
{
foreach(Player, i)
{
SendClientMessage(i, -1, "increased your seconds by 1");
PlayerInfo[i][Seconds]++;
if(PlayerInfo[i][Seconds] >= 59)
{
PlayerInfo[i][Seconds] = 0;
PlayerInfo[i][Minutes] ++;
if(PlayerInfo[i][Minutes] >= 59)
{
PlayerInfo[i][Minutes] = 0;
PlayerInfo[i][Hours] = ++;
}
}
}
return 1;
}