GTAvision.com - Forum - Grand Theft Auto News, Downloads, Community and more...

Position: Grand Theft Auto: San Andreas » Multiplayer » Scripte und kleine Codes » [SA-MP v2]Realtime Uhr » Druckansicht
TwIsTeR, 19.10.2007, 04:00
Hi Leute ich wollte mal Fragen ob jemand ein Filterscript hat für eine Realtime Uhr, mit Real meine
ich auch Real nicht so wie im Sinfle Player sonder richtig Synchon mit der Welt :P

Hat jemand was? Ich suche es finde es auch aber für das Normale Script und naja :-( Verbugt Crash und
Time Outs hoffe mir kann jemand helfen

thx

PS: Jetzt kein Terror schieben sonder einfach sagen Ja oder nein ob ihr es habt ich will euch nicht
zwingen sowas zu scripten :-D so einer bin ich nicht ich frage :-O
Sh3LteR, 19.10.2007, 09:25
Code:
1
2
3
4
5
6
7
8
9
10
11
12
public Realtime()
{
         new Hours;
            new Minutes;
            new Seconds;
            new i;
            new string[256];
          gettime(Hours, Minutes, Seconds);
         format(zeitstr, sizeof(zeitstr), "Zeit: %d:%d:%d", Hours,Minutes,Seconds);
         GameTextForPlayer(i, string, 1000, 5);
            return 1;
}


Achtung!! Es funktioniert nicht!!



So weit bin ich mal aber es wird nichts angezeigt weiß nichtmehr weiter. Kann wer helfen?? *anbet*
MFG DS
dödel, 19.10.2007, 11:05
Darauf hättest du auch mal achten können:

format(zeitstr, sizeof(zeitstr), "Zeit: %d:%d:%d", Hours,Minutes,Seconds);

Du hast mit format die variable zeitstr definiert,

GameTextForPlayer(i, string, 1000, 5);

willst aber hier string ausgeben lassen.


Außerdem ist deine variable i sinlos, da sie nicht mal auf alle ID´s gestellt wurde.
Lass es also lieber so aussehen:

Code:
1
2
3
4
5
6
7
8
9
10
11
public Realtime()
{
            new Hours;
            new Minutes;
            new Seconds;
            new string[256];  //sry, musst noch aus den public rausnehmen
            gettime(Hours, Minutes, Seconds);
            format(zeitstr, sizeof(zeitstr), "Zeit: %d:%d:%d", Hours,Minutes,Seconds);
            GameTextForAll(zeitstr, 1000, 5);
            return 1;
}


Aber das zeigt auch nur die Zeit an, wenn du willst das die IngameZeit auch Realtime ist,
baue das hier einfach über das return 1; :

Code:
1
2
3
4
5
6
7
for (new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
SetPlayerTime(i,hours,minutes);
}
}



Sh3LteR, 19.10.2007, 11:24
Code:

1
2
C:\Users\Dominik\Desktop\SanAndreas\Server\Der srever\SAMP 0.2.2 server[Windows]\gamemodes\PWN\LSSFL
V - Kopie.pwn(80) : warning 204: symbol is assigned a value that is never used: "string"
C:\Users\Dominik\Desktop\SanAndreas\Server\Der srever\SAMP 0.2.2 server[Windows]\gamemodes\PWN\LSSFL
V - Kopie.pwn(1137) : warning 204: symbol is assigned a value that is never used: "string"

bekomme das einfach nich weg
Nico, 19.10.2007, 11:29
dann hast du zu oft new string[256];
mach die mal in den angegebenen Zeilen weg!

dödel, 19.10.2007, 11:29
Außerdem hoffe ich das du den Timer auch drin hast, ansonsten ist das eh sinnlos ;)

SetTimer("Realtime", 3000, 1);

In OnGameModeInit

Edit:

Und wenn du jetz ganz lieb bist und keine Fehler mehr machst, schenke ich dir sogar das hier:
TwIsTeR, 19.10.2007, 12:06
OK ich habs soweit als Filterscript hinbekommen aber ich hab nen Bug entdeckt und weiß nicht wie
ich den rausbekommen

Normal müsste es so stehen: z.B. 15:04

Aber bei mir ist: 15:4

kann jemand nachschauen und helfen?
Nico, 19.10.2007, 12:25
also ich habs mal ausprobiert... bei mir klappts!

Mit deinem Filterscript!

EDIT:

Nein doch nicht. Ich schau mal drüber!
TwIsTeR, 19.10.2007, 12:27
Es funzt auch nur es steht bei unter 10 min immer nur eine Zahl wenn es z.B. 13:05 ist steht da
aber 13:5 das ist das komische ich weiß nicht ob das Normal ist :-(
Nico, 19.10.2007, 12:35
Hab die Lösung =)


Zeile 86:
Code:
1
    Clock=TextDrawCreate(552,28,SystemTime);
TwIsTeR, 19.10.2007, 12:48
thx ich glaube dann ist es hier fertig :D

Uhr im Anhang :D
dödel, 19.10.2007, 13:57
Na da hat sich doch was geklärt, ich hab vorhin zu DS gesagt,
im laufe des Tages bau ich ne TextDraw Uhr, aber nu hat sich das ja jetz erledigt.
TwIsTeR, 19.10.2007, 14:02
Und sie funzt Perfekt ich hab die auch eingebaut bei gelegenheit könnt ihr euch mal Blicken lassen :P
FloRaX, 29.10.2007, 17:04
ZitatZitat:
TogglePlayerClock(playerid,1);


Das ist ja auch ein realltime für san andreas^^
Rafioso, 29.10.2007, 21:18
Nicht wirklich ;)
Das stoppt lediglich die Zeit.

=) =) :D :D =) =)
FloRaX, 12.11.2007, 16:24
jo stimmt,so einer lässt sie realler ausehen.Das hab ich mal inem forum gefunden

Code:
1
2
3
4
new SystemTime[12];
forward RealTimeUpdate();
forward TimeUpdate();
main()


Code:
1
2
3
4
5
6
OnGameModeInit()
{
SetTimer("RealTimeUpdate",1,0); 
SetTimer("TimeUpdate",10000, 1);
return 1;
}


Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
public RealTimeUpdate()
{
   new h=0, m=0, s=0;
   //new string[256]; 
   SetWorldTime(h); 
   //new Text:Clock;
   gettime(h,m,s);
   /*if (m <= 9){format(string,25,"%d:%d",h,m);
   } else {format(string,25,"%d:%d",h,m);}
   TextDrawHideForAll(Clock);
   Clock=TextDrawCreate(552,28,string);
   TextDrawLetterSize(Clock,0.5,1.8);
   TextDrawFont(Clock,3);
   TextDrawBackgroundColor(Clock,0x000000AA);
   TextDrawSetOutline(Clock,2);
   TextDrawShowForAll(Clock);*/
   if (h == 0){SetWorldTime(0);}
   if (h == 1){SetWorldTime(1);}
   if (h == 2){SetWorldTime(2);}
   if (h == 3){SetWorldTime(3);}
   if (h == 4){SetWorldTime(4);}
   if (h == 5){SetWorldTime(5);}
   if (h == 6){SetWorldTime(6);}
   if (h == 7){SetWorldTime(7);}
   if (h == 8){SetWorldTime(8);}
   if (h == 9){SetWorldTime(9);}
   if (h == 10){SetWorldTime(10);}
   if (h == 11){SetWorldTime(11);}
   if (h == 12){SetWorldTime(12);}
   if (h == 13){SetWorldTime(13);}
   if (h == 14){SetWorldTime(14);}
   if (h == 15){SetWorldTime(15);}
   if (h == 16){SetWorldTime(16);}
   if (h == 17){SetWorldTime(17);}
   if (h == 18){SetWorldTime(18);}
   if (h == 19){SetWorldTime(19);}
   if (h == 20){SetWorldTime(20);}
   if (h == 21){SetWorldTime(21);}
   if (h == 22){SetWorldTime(22);}
   if (h == 23){SetWorldTime(23);}
   if (h == 24){SetWorldTime(24);}
   SetTimer("RealTimeUpdate",3000,0);
   //format(string, sizeof(string), "The time is updated - %d:%d:%d", h, m, s);
   //print(string);
   return 1;
   }

   public TimeUpdate() {
   new Hour, Minute, Seconds;
   new strings[256];
   new string[256];
   new Text:Clock;
   gettime(Hour, Minute, Seconds);
   if(Hour < 10) {
   format(SystemTime, sizeof(SystemTime), "0%d",Hour);
   } else {
   format(SystemTime, sizeof(SystemTime), "%d",Hour);
   }
   if(Minute < 10) {
   format(SystemTime, sizeof(SystemTime), "%s:0%d",SystemTime,Minute);
   } else {
   format(SystemTime, sizeof(SystemTime), "%s:%d",SystemTime,Minute);
   }
   if (Minute <= 9) {
   format(string,25,"%d:%0d",Hour,Minute);
   } else {
   format(string,25,"%d:%d",Hour,Minute);}
   TextDrawHideForAll(Clock);
   Clock=TextDrawCreate(552,28,SystemTime);
   TextDrawLetterSize(Clock,0.5,1.8);
   TextDrawFont(Clock,3);
   TextDrawBackgroundColor(Clock,0x000000AA);
   TextDrawSetOutline(Clock,2);
   TextDrawShowForAll(Clock);
   format(strings, sizeof(strings), "System time: %s", SystemTime);
   printf(strings);
   return 1;
   }


So hab ichs und es funkt richtig gut bei mir.Der script is nich von mir das hab ich vonem forum :P
Tobi.bw, 12.11.2007, 16:27
Hi!

Ich find es Super von dir, dass du endlich mal sagst, dass das nicht von dir ist :-) =) ;-) :D :D :D
*DaumenHoch*


schönen Tach noch
Tobi
Rafioso, 12.11.2007, 17:37
Warum sucht ihr immernoch nach einem Realtime-Code?
Eine Seite vor dieser, steht doch die Lösung.....

=) =) :D :D =) =)
FloRaX, 12.11.2007, 20:19
LOL Achso :D hab ich wohl übersehen :)
GTAvision.com :: Forumregeln :: FAQ :: Impressum :: Kontakt :: RDRvision.com :: LANOIREvision.com :: MaxPayneVision.com
NetVisionWork.NET
.: © 2006-2014 by GTAvision.com :.

Rockstar GamesTake-Two Interactive Deutschland

Free Grand Theft Auto Downloads