Hey, ich habe eine frage und zwar, wie kann ich zu dieser uhr eine Sekundenanzeige hinzufügen?
Hab suFu genutzt und nicht gefunden was mir helfen konnte.
Habe diese Uhr eingebaut:
new Text:RealClock,Timer;
forward UpdateClock();
public OnGameModeInit()
{
RealClock = TextDrawCreate(547.000000,22.000000," ");
TextDrawAlignment(RealClock,0);
TextDrawBackgroundColor(RealClock,0x000000ff);
TextDrawFont(RealClock,3);
TextDrawLetterSize(RealClock,0.599999,2.299999);
TextDrawColor(RealClock,0xffffffff);
TextDrawSetOutline(RealClock,1);
TextDrawSetProportional(RealClock,1);
TextDrawSetShadow(RealClock,10);
Timer = SetTimer("UpdateClock",300,1);
public UpdateClock()
{
new Hour,Minute,Sec,String[256];
gettime(Hour,Minute,Sec);
if(Hour<9 && Minute<9){format(String,sizeof(String),"0%d:0%d",Hour,Minute);}
else if(Hour>9 && Minute<9){format(String,sizeof(String),"%d:0%d",Hour,Minute);}
else if(Hour<9 && Minute>9){format(String,sizeof(String),"0%d:%d",Hour,Minute);}
else{format(String,sizeof(String),"%d:%d",Hour,Minute);}
TextDrawSetString(RealClock,String);
return 1;
}
stock strget(strx[], pos, search = ' ') {
new arg, ret[128], idxx;
for (new i = 0; i < strlen(strx); i++) {
if(strx[i] == search || i == strlen(strx) || strx[i + 1] == 10) {
arg++;
if (arg == pos + 1){
ret[i-idxx] = EOS;
return ret;
} else if (arg == pos)
idxx= i+1;
}
else if (arg == pos)
ret[i - idxx] = strx[i];
}
return ret;
}
public OnPlayerConnect(playerid)
{
CreateCheckpoint(-2652.6660,1407.0936,906.2771, 2.0);
SendClientMessage(playerid,COLOR_GREEN, "---------------");
SendClientMessage(playerid,COLOR_RED, "---------------");
SendClientMessage(playerid,COLOR_YELLOW,"---------------");
printf("OnPlayerConnect(%d)", playerid);
TextDrawShowForPlayer(playerid,RealClock); //<<---
return 1;
}
Würde mich für eure hilfe sehr freuen