23.09.2010, 19:48
I don't know how to show it for a certain time, but I know how to create the clock on your screen (high on the right)
pawn Код:
new Clock[MAX_PLAYERS];
forward UpdateClock(playerid);
public UpdateClock(playerid)
{
gettime(Shour, Sminute, Ssecond);
new string[56];
if(Sminute < 10) {
if(Shour <10) {
if(Ssecond <10) {
format(string,sizeof(string),"%s~n~0%d:0%d:0%d",string2,Shour,Sminute, Ssecond);
} else {
format(string,sizeof(string),"%s~n~0%d:0%d:%d",string2,Shour,Sminute, Ssecond);
}
} else {
if(Ssecond <10) {
format(string,sizeof(string),"%s~n~%d:0%d:0%d",string2,Shour,Sminute, Ssecond);
} else {
format(string,sizeof(string),"%s~n~%d:0%d:%d",string2,Shour,Sminute, Ssecond);
}
}
} else {
if(Shour < 10) {
if(Ssecond <10) {
format(string,sizeof(string),"%s~n~0%d:%d:0%d",string2,Shour,Sminute,Ssecond);
} else {
format(string,sizeof(string),"%s~n~0%d:%d:%d",string2,Shour,Sminute,Ssecond);
}
} else {
if(Ssecond <10) {
format(string,sizeof(string),"%s~n~%d:%d:0%d",string2,Shour,Sminute, Ssecond);
} else {
format(string,sizeof(string),"%s~n~%d:%d:%d",string2,Shour,Sminute, Ssecond);
}
}
}
Clock[playerid] = TextDrawCreate(543.0, 22.0, string);
TextDrawSetShadow(Clock[playerid], 0);
TextDrawSetOutline(Clock[playerid], 2);
TextDrawLetterSize(Clock[playerid], 0.6, 1.8);
TextDrawFont(Clock[playerid], 3);
TextDrawShowForPlayer(playerid, Clock[playerid]);
}