PHP код:
CMD:time(playerid, params[])
{
if(PlayerLogged[playerid] == 0) return true;
new mtext[20];
new year, month,day;
getdate(year, month, day);
if(month == 1) { mtext = "January"; }
else if(month == 2) { mtext = "February"; }
else if(month == 3) { mtext = "March"; }
else if(month == 4) { mtext = "April"; }
else if(month == 5) { mtext = "May"; }
else if(month == 6) { mtext = "June"; }
else if(month == 7) { mtext = "Juli"; }
else if(month == 8) { mtext = "August"; }
else if(month == 9) { mtext = "September"; }
else if(month == 10) { mtext = "October"; }
else if(month == 11) { mtext = "November"; }
else if(month == 12) { mtext = "December"; }
new hour,minuite,second;
gettime(hour,minuite,second);
if (minuite < 10)
{
if (PlayerInfo[playerid][pMorganTime] > 0) format(totalstring, 128, "~y~%d %s~n~~g~|~w~%d:0%d~g~|~n~~w~Jail Time Left: %d sec", day, mtext, hour, minuite, PlayerInfo[playerid][pMorganTime]-10);
else format(totalstring, 127, "~y~%d %s~n~~g~|~w~%d:0%d~g~|", day, mtext, hour, minuite);
}
else
{
if (PlayerInfo[playerid][pMorganTime] > 0) format(totalstring, 128, "~y~%d %s~n~~g~|~w~%d:%d~g~|~n~~w~Jail Time Left: %d sec", day, mtext, hour, minuite, PlayerInfo[playerid][pMorganTime]-10);
else format(totalstring, 127, "~y~%d %s~n~~g~|~w~%d:%d~g~|", day, mtext, hour, minuite);
}
GameTextForPlayer(playerid, totalstring, 5000, 1);
ApplyAnimation(playerid,"COP_AMBIENT","Coplook_watch",4.1,0,0,0,0,0,1);
format(totalstring, 64, "%s взглянул(а) на часы", PlayerInfo[playerid][pSendername]);
ProxDetectorNew(playerid,30.0,COLOR_PURPLE,totalstring);
return true;
}