Oko TD-a tj sata

Započeo Carera
17. Avg. 2018. Zaključano
526
pregleda
4
postova
AdmirTM
4
Enforcer
17. Avg. 2018.
Problem(error/warning): Ovakav TD izgleda http://prntscr.com/kjqlde, a kada ga ubacim bude pomješan: https://prnt.sc/kjqjyw
Dio skripte:
task SyncTime()
{
new tmphour,
    tmpminute,
    tmpsecond,
year,
month,
day,
stringicc[ 20 ],stringicc1[ 30 ];

    getdate( year, month, day );
gettimeEx( tmphour, tmpminute, tmpsecond );
FixHour( tmphour );
tmphour = shifthour;

    format( stringicc, sizeof( stringicc ), "~w~%s%d~b~:~w~%s%d", (tmphour < 10) ? ("0") : (""), tmphour, (tmpminute < 10) ? ("0") : (""), tmpminute);
TextDrawSetString( UigriTD, stringicc );
    format( stringicc1, sizeof( stringicc1 ), "~w~%d~r~/~w~%d~r~/~w~%d", day, month, year );
    TextDrawSetString( UigriTD, stringicc1 );

task GlobalTimer()
{
    new id = -1;

    new tmphour,
    tmpminute,
    tmpsecond,
year,
month,
day,
stringicc[ 20 ],stringicc1[ 30 ];

    getdate( year, month, day );
gettimeEx( tmphour, tmpminute, tmpsecond );
FixHour( tmphour );
tmphour = shifthour;

    format( stringicc, sizeof( stringicc ), "~w~%s%d~b~:~w~%s%d", (tmphour < 10) ? ("0") : (""), tmphour, (tmpminute < 10) ? ("0") : (""), tmpminute);
TextDrawSetString( UigriTD, stringicc );
format( stringicc1, sizeof( stringicc1 ), "~w~%d~r~/~w~%d~r~/~w~%d", day, month, year );
    TextDrawSetString( UigriTD, stringicc1 );

if( realtime ) {
new tmphour,
    tmpminute,
    tmpsecond,
    stringicc[ 20 ],stringicc1[ 30 ];

gettimeEx( tmphour, tmpminute, tmpsecond );
FixHour( tmphour );
tmphour = shifthour;
SetWorldTime( tmphour );
GlobalniSat = tmphour;
ServerInfo[ VremeInGame ] = tmphour;

    format( stringicc, sizeof( stringicc ), "~w~%s%d~b~:~w~%s%d", (tmphour < 10) ? ("0") : (""), tmphour, (tmpminute < 10) ? ("0") : (""), tmpminute);
TextDrawSetString( UigriTD, stringicc );
  format( stringicc1, sizeof( stringicc1 ), "~w~%d~r~/~w~%d~r~/~w~%d", day, month, year );
    TextDrawSetString( UigriTD, stringicc1 );
}
return true;
}

Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): [ code ]vaš odgovor[ /code ]
Slika/video ingame problema(obavezno ako je ingame problem): link slike
muamerkadusic
5
Godfather
17. Avg. 2018.
#include < a_samp >

////

new Text:Vreme;
new Text:Datum;

////
ovo ubaci ispod ongamemodeinit
///
  SetTimer("VremeDatumTimer",1000,true);
    Vreme = TextDrawCreate(62.576492, 309.000030, "00:00:00");
    TextDrawLetterSize(Vreme, 0.280470, 1.354999);
    TextDrawAlignment(Vreme, 1);
    TextDrawColor(Vreme, -1);
    TextDrawSetShadow(Vreme, 0);
    TextDrawSetOutline(Vreme, 1);
    TextDrawBackgroundColor(Vreme, 255);
    TextDrawFont(Vreme, 1);
    TextDrawSetProportional(Vreme, 1);
    TextDrawSetShadow(Vreme, 0);

    SetTimer("VremeDatumTimer",1000,true);
    Datum = TextDrawCreate(85.505920, 322.416717, "00/00/2018");
    TextDrawLetterSize(Datum, 0.280470, 1.354999);
    TextDrawAlignment(Datum, 2);
    TextDrawColor(Datum, -1);
    TextDrawSetShadow(Datum, 0);
    TextDrawSetOutline(Datum, 1);
    TextDrawBackgroundColor(Datum, 255);
    TextDrawFont(Datum, 1);
    TextDrawSetProportional(Datum, 1);

///
onplayerdisconect
    TextDrawDestroy(Vreme);
    TextDrawDestroy(Datum);
///
onplayerspawn
TextDrawShowForPlayer(playerid, Vreme);
    TextDrawShowForPlayer(playerid, Datum);
//
na kraj skripte ili kod ostalih forwarda
//
forward VremeDatumTimer(playerid);
public VremeDatumTimer(playerid)
{
    new string,godina,mesec,dan,sati,minute,sekunde;
    getdate(godina, mesec, dan), gettime(sati, minute, sekunde);
    format(string, sizeof string, "%d/%s%d/%s%d", dan, ((mesec < 10) ? ("0") : ("")), mesec, (godina < 10) ? ("0") : (""), godina);
    TextDrawSetString(Datum, string);
    format(string, sizeof string, "%s%d:%s%d:%s%d", (sati < 10) ? ("0") : (""), sati, (minute < 10) ? ("0") : (""), minute, (sekunde < 10) ? ("0") : (""), sekunde);
    TextDrawSetString(Vreme, string);
}
James_SmithXDl
6
OG Legend
17. Avg. 2018.
	new tmphour,
    tmpminute,
    tmpsecond,
year,
month,
day,
stringicc[ 20 ],stringicc1[ 30 ];

    getdate( year, month, day );
gettimeEx( tmphour, tmpminute, tmpsecond );
FixHour( tmphour );
tmphour = shifthour;

    format( stringicc, sizeof( stringicc ), "~w~%02d~b~:~w~%02d~b~:~w~%02d", tmphour, tmpminute, tmpsecond);
TextDrawSetString( UigriTD, stringicc );
    format( stringicc1, sizeof( stringicc1 ), "~w~%02d~r~/~w~%02d~r~/~w~%02d", day, month, year );
    TextDrawSetString( UigriTD, stringicc1 );


i da ovo sto postavlja trenutni datum i trenutno vrijeme koristi samo na Global Timer jer izvrsava za 1 sekundu,zasto si stavio i na SyncTime ? nije potrebno znaci 2 put ce izvrsit jednu te istu naredbu kad prodje 1min (60 sekundi)... , a ovo pod 3 kodom sto si stavio je vjerovatno  u public OnGameModeInit,tu stavis moj kod umjesto svog,tako i kod GlobalTimera ( koji je svake sekunde) i to je to a u SyncTime obrises sto sam ti rekao, jer koliko sam vidio na textdrawu ti ima i sat i minuta i sekunda a u kodu samo sat i minutu izvrsava postavlja a nema sekundi a svake sekunde se poziva GlobalTimer i postavlja trenutni sat i trenutnu minutu i trenutni datum a tako i svake minute SyncTime  se poziva i postavlja trenutni sat i minutu.. - zasto bi 2put kad moze jednom.. , stavio sam ti i da trenutnu sekundu pokazuje
AdmirTM
4
Enforcer
21. Avg. 2018.
Ne razumijem zasto mi ne radi sat tj takav je kako sam vam poslao sliku,nije u normalnom formatu, jer imao sam prije tdove druge sat je bio na donjem TD radilo je sve ikao je imao i global tajmer i ovaj

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha