23.04.2017, 20:15
Quote:
Hey guys, how can i made a script when Admin go "On duty" to display time spended from admin on duty ..
For example : Admin Micho_Mkd is on duty ! [DutyTIME: 21hr:21min] Here is a picture : http://prnt.sc/ezh4vy |
PHP Code:
enum aduty
{
bool:isinduty,
dutysec,
dutymin
}
new admintime[MAX_PLAYERS][aduty];
//Global timer >>
settimer("duty",1000,true);
forward duty();
public duty()
{
for(new i;i<MAX_PLAYERS;i++)
{
if(IsAnAdmin(i))
{
if(admintime[i][isinduty])
{
if(dutysec < 60)
{
admintime[i][dutysec]++;
}
if(dutysec == 60)
{
admintime[i][dutysec] = 0;
admintime[i][dutymin]++;
}
}
}
}
return 1;
}