Halli Hallo, wollte fragen ob mir jemand eine Uhr machen könnte, die ich dann in mein Script übernehmen muss, die uhr soll etwa so aussehn: 
Würde mich freuen wenn mir da jemand weiter helfen könnte ![]()
Halli Hallo, wollte fragen ob mir jemand eine Uhr machen könnte, die ich dann in mein Script übernehmen muss, die uhr soll etwa so aussehn: 
Würde mich freuen wenn mir da jemand weiter helfen könnte ![]()
Vielleicht meinst du ja soetwas hier, hoffe das hilft dir :>
forward time();
forward weather();
public OnPlayerSpawn(playerid)
{
time();
return 1;
}
public weather()
{
SetWeather(random(18));
}
public time()
{
new Text:Clock;
new hour,minute,second;
new string[256];
new string2[256];
new Text:Datum;
new day,month,year;
getdate(day,month,year);
gettime(hour,minute,second);
if (minute <= 9){format(string,25,"%d:0%d",hour,minute);}
else {format(string,25,"%d:%d",hour,minute);}
if (day <= 9){format(string2,25,"0%d.%d.%d",year,month,day);}
else if (month <= 9 && day >= 9) {format(string2,25,"%d.0%d.%d",year,month,day);}
else {format(string2,25,"%d.%d.%d",year,month,day);}
if (hour == 0){SetWorldTime(0);}
if (hour == 1){SetWorldTime(1);}
if (hour == 2){SetWorldTime(2);}
if (hour == 3){SetWorldTime(3);}
if (hour == 4){SetWorldTime(4);}
if (hour == 5){SetWorldTime(5);}
if (hour == 6){SetWorldTime(6);}
if (hour == 7){SetWorldTime(7);}
if (hour == 8){SetWorldTime(8);}
if (hour == 9){SetWorldTime(9);}
if (hour == 10){SetWorldTime(10);}
if (hour == 11){SetWorldTime(11);}
if (hour == 12){SetWorldTime(12);}
if (hour == 13){SetWorldTime(13);}
if (hour == 14){SetWorldTime(14);}
if (hour == 15){SetWorldTime(15);}
if (hour == 16){SetWorldTime(16);}
if (hour == 17){SetWorldTime(17);}
if (hour == 18){SetWorldTime(18);}
if (hour == 19){SetWorldTime(19);}
if (hour == 20){SetWorldTime(20);}
if (hour == 21){SetWorldTime(21);}
if (hour == 22){SetWorldTime(22);}
if (hour == 23){SetWorldTime(23);}
if (hour == 24){SetWorldTime(24);}
TextDrawHideForAll(Clock);
Clock=TextDrawCreate(549,24,string);
TextDrawLetterSize(Clock,0.55,2);
TextDrawFont(Clock,3);
TextDrawBackgroundColor(Clock,0x000000AA);
TextDrawSetOutline(Clock,2);
TextDrawShowForAll(Clock);
SetTimer("time",30000,0);
SetTimer("weather",11000000,true);
TextDrawHideForAll(Datum);
Datum=TextDrawCreate(500,3,string2);
TextDrawLetterSize(Datum,0.55,2);
TextDrawFont(Datum,3);
TextDrawBackgroundColor(Datum,0x000000AA);
TextDrawSetOutline(Datum,2);
TextDrawShowForAll(Datum);
return 1;
}
der will aber nur eine uhr ![]()
Das Datum kann man rausbauen xD
Oben:
new Text:RealClock,Timer;
forward UpdateClock();
public OnGameModeInit()
{
SetGameModeText("***SA AiO***"); //Brauchste net
SetTimer("PayDay",600000,1); // Das auch net
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);
Ganz unten:
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, "Willkommen auf dem [WS] Gang AiO Server! (0.3.5)");
SendClientMessage(playerid,COLOR_RED, "Um die Commands zu sehen tippe /cmd ein.");
SendClientMessage(playerid,COLOR_YELLOW,"Bevor du spielst lese die Regeln, dazu tippe /regeln ein.");
printf("OnPlayerConnect(%d)", playerid);
TextDrawShowForPlayer(playerid,RealClock); //////DAS HIER//////////////////
return 1;
}
du hast forward UpdateClock(); vergessen;)
Oh, Danke ![]()
hihi, Danke Silent und an den Rest, mal noch ne Frage, weist du auch wie ich das Datum Unten Rechts hinmache Silent *lieb guck*
MFG. Fabi
PS: es kommt ein warning: C warning 204: symbol is assigned a value that is never used: "Timer"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Warning.
du hast forward UpdateClock(); vergessen;)
Ne Hat er nicht^^
Timer = SetTimer("UpdateClock",300,1);
SetTimer("UpdateClock",300,1); Reicht auch
LG SureShot
warum willste genau die uhr? weil die Nova auch hat?
Ist doch egal oder?
Er will eben ne Uhr haben....OMG
Alles anzeigenOben:
new Text:RealClock,Timer;
forward UpdateClock();
public OnGameModeInit()
{
SetGameModeText("***SA AiO***"); //Brauchste net
SetTimer("PayDay",600000,1); // Das auch net
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);
Ganz unten:
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;
}
funzt bei mir net
Soory was vergessen:
public OnPlayerConnect(playerid)
{
CreateCheckpoint(-2652.6660,1407.0936,906.2771, 2.0);
SendClientMessage(playerid,COLOR_GREEN, "Willkommen auf dem [WS] Gang AiO Server! (0.3.5)");
SendClientMessage(playerid,COLOR_RED, "Um die Commands zu sehen tippe /cmd ein.");
SendClientMessage(playerid,COLOR_YELLOW,"Bevor du spielst lese die Regeln, dazu tippe /regeln ein.");
printf("OnPlayerConnect(%d)", playerid);
TextDrawShowForPlayer(playerid,RealClock); //////DAS HIER//////////////////
return 1;
}
on N!ck benutze bekomme ich diese Errors:(Mache Non-GF)
D:\PROGRA~1\GTASA-~1\DERSER~1\Server.pwn(184) : error 021: symbol already defined: "OnPlayerSpawn"
D:\PROGRA~1\GTASA-~1\DERSER~1\Server.pwn(190) : warning 235: public function lacks forward declaration (symbol "weather")
D:\PROGRA~1\GTASA-~1\DERSER~1\Server.pwn(195) : warning 235: public function lacks forward declaration (symbol "time")
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
Niran dann hast du public OnPlayerSpawn(playerid) mehrmals drin stehen!
Die anderen beiden Errors kenne ich nicht =S^^
D:\PROGRA~1\GTASA-~1\DERSER~1\Server.pwn(190) : warning 235: public function lacks forward declaration (symbol "weather")
D:\PROGRA~1\GTASA-~1\DERSER~1\Server.pwn(195) : warning 235: public function lacks forward declaration (symbol "time")
das
forward weather(XX)
und das
public weather(XX)
sind unterschiedlich (nicht gleich )
du musst Überprüfen ob das was ich XX bezeichne bei den zwei dingen gleich ist