Jump to content

[Sistema] Data si ora pe server


khain.dev

Recommended Posts

Buna astazi o sa va prezint un sistem simplu care este binevenit pentru toti, data si ora practic este pe toate serverele si am decis sa public vrianta mea.

Citat

//variabile

new time[2];

//ongamemodeinit

time[0] = TextDrawCreate(549.500000, 23.625000, "22:35");
TextDrawLetterSize(time[0], 0.596499, 1.910626);
TextDrawAlignment(time[0], 1);
TextDrawColor(time[0], -1646626373);
TextDrawSetShadow(time[0], 0);
TextDrawSetOutline(time[0], -1);
TextDrawBackgroundColor(time[0], 51);
TextDrawFont(time[0], 2);
TextDrawSetProportional(time[0], 1);

time[1] = TextDrawCreate(551.500000, 39.062500, "01.01.2019");
TextDrawLetterSize(time[1], 0.322499, 0.987501);
TextDrawAlignment(time[1], 1);
TextDrawColor(time[1], -1646626373);
TextDrawSetShadow(time[1], 0);
TextDrawSetOutline(time[1], -1);
TextDrawBackgroundColor(time[1], 51);
TextDrawFont(time[1], 2);
TextDrawSetProportional(time[1], 1);

//in orice loc al modului

forward timpul(playerid);

public timpul() 

    new hour,minute,second; 
    gettime(hour,minute,second); 
    new string[256]; 
    new string2[256]; 
    format(string, sizeof(string), "%02d:%02d", hour, minute); 
    new day,month,year; 
    getdate(year,month,day); 
    format(string2, sizeof(string2), "%02d.%02d.%d",day,month,year); 
    SetWorldTime( hour ); 
    for(new i=0;i<MAX_PLAYERS;i++) 
    { 
        TextDrawSetString(time[0],string); 
        TextDrawSetString(time[1],string2); 
        TextDrawShowForPlayer(i,time[0]); 
        TextDrawShowForPlayer(i,time[1]); 
    } 
    return 1; 
}

//onplayerconnect

for(new i; i < 2; i++) TextDrawShowForPlayer(playerid, time);

 

 

 

 

sa-mp-098.png

Edited by #Yudin
  • Thanks 2
Link to comment
Share on other sites

  • 9 months later...
  • 4 years later...
On 2/22/2019 at 10:01 PM, khain.dev said:

Buna astazi o sa va prezint un sistem simplu care este binevenit pentru toti, data si ora practic este pe toate serverele si am decis sa public vrianta mea.

 

 

 

 

sa-mp-098.png

La mine e cu 3 ore in urmă ... Nu mi pot da seama de ce .. :( am incercat tot felul de scripturi pentru data și timp

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.