PHP Code:
#define PLUGIN_VERSION "1.1"
new Hours, Minutes, Seconds;
public Plugin:myinfo = {
name = "MapTime",
author = "WeSTMan",
description = "Time Map by WeSTMan",
version = PLUGIN_VERSION,
url = ""
};
public OnPluginStart()
{
RegAdminCmd("sm_maptime", CMD_TimeMap, ADMFLAG_GENERIC);
}
public OnMapStart()
{
Hours = 0;
Minutes = 0;
Seconds = 0;
CreateTimer(1.0, TimeMapOne, _, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
}
public Action:CMD_TimeMap(client, args)
{
PrintToChat(client, "\x04[MapTime] \x01Сыграно \x04%d \x01час(ов), \x04%d\x01 минут(ы) и \x04%d\x01 секунд(ы).", Hours, Minutes, Seconds);
return Plugin_Handled;
}
public Action:TimeMapOne(Handle:timer)
{
Seconds += 1;
if (Seconds == 60)
{
Seconds = 0;
Minutes += 1;
}
if (Minutes == 60)
{
Minutes = 0;
Hours += 1;
}
return Plugin_Continue;
}
__________________