Server Time
#1

I looked for that bu could not find it, is there any way to make server week or something like that so when new player connect he will have same day and time like me.
Reply
#2

https://sampwiki.blast.hk/wiki/Gettime
https://sampwiki.blast.hk/wiki/Getdate
are those what you mean?
Reply
#3

I want to make time in server that will be same for all players, if im online and for me is 15PM ingame and another player connect he will also have same time as me, did you get it?
Reply
#4

Here's a code by Luxurion, it fits your requesting description.

pawn Код:
/*
Credits to Luxurion and SeifWatch, I didn't make this code.
*/


#include <a_samp>

#define GREEN           0x21DD00FF
#define RED             0xE60000FF
#define YELLOW          0xFFFF00FF
#define ORANGE          0xF97804FF
#define LIGHTRED        0xFF8080FF
#define LIGHTBLUE       0x00C2ECFF
#define PURPLE          0xB360FDFF
#define BLUE            0x1229FAFF
#define LIGHTGREEN      0x38FF06FF
#define DARKPINK        0xE100E1FF
#define DARKGREEN       0x008040FF
#define ANNOUNCEMENT    0x6AF7E1FF
#define GREY            0xCECECEFF
#define PINK            0xD52DFFFF
#define DARKGREY        0x626262FF
#define AQUAGREEN       0x03D687FF
#define WHITE           0xFFFFFFFF

new Tstring[12][2];
new DelTime;

new Text: LuxClock_Center;
new Text: LuxClock[12];
new Text: LText1;
new Text: LText2;
new Text: LText3;
new Text: LText4;
new Text: LText5;
new Text: LText6;
new Text: LText7;
new Text: LHour;
new Text: LInfo;
new Text: LCategory;
new Text: LMonth;
new Text: LDay;
new Text: LMsg;

forward L_UpdateTime (playerid);
forward L_UpdateClock();


public OnFilterScriptInit()
{

//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// -> Clock Functions <-
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
LHour = TextDrawCreate(493.000000,411.000000,"  ");
TextDrawAlignment(LHour,0);
TextDrawBackgroundColor(LHour,0x000000ff);
TextDrawFont(LHour,1);
TextDrawLetterSize(LHour,0.399999,1.000000);
TextDrawColor(LHour,0xffffffff);
TextDrawSetOutline(LHour,1);
TextDrawSetProportional(LHour,1);
TextDrawSetShadow(LHour,1);

LInfo = TextDrawCreate(555.000000,357.000000,"Digital Clock");
TextDrawAlignment(LInfo,0);
TextDrawBackgroundColor(LInfo,0x000000ff);
TextDrawFont(LInfo,1);
TextDrawLetterSize(LInfo,0.299999,1.000000);
TextDrawColor(LInfo,0xffffff66);
TextDrawSetOutline(LInfo,1);
TextDrawSetProportional(LInfo,1);
TextDrawSetShadow(LInfo,1);

LCategory = TextDrawCreate(567.000000,369.000000,"Information");
TextDrawAlignment(LCategory,0);
TextDrawBackgroundColor(LCategory,0x000000ff);
TextDrawFont(LCategory,1);
TextDrawLetterSize(LCategory,0.199999,0.899999);
TextDrawColor(LCategory,0xffffffff);
TextDrawSetOutline(LCategory,1);
TextDrawSetProportional(LCategory,1);
TextDrawSetShadow(LCategory,1);

LMonth = TextDrawCreate(550.000000,385.000000,"  ");
TextDrawAlignment(LMonth,0);
TextDrawBackgroundColor(LMonth,0x000000ff);
TextDrawFont(LMonth,1);
TextDrawLetterSize(LMonth,0.199999,0.899999);
TextDrawColor(LMonth,0xffffffff);
TextDrawSetOutline(LMonth,1);
TextDrawSetProportional(LMonth,1);
TextDrawSetShadow(LMonth,1);

LDay = TextDrawCreate(551.000000,396.000000,"  ");
TextDrawAlignment(LDay,0);
TextDrawBackgroundColor(LDay,0x000000ff);
TextDrawFont(LDay,1);
TextDrawLetterSize(LDay,0.199999,1.000000);
TextDrawColor(LDay,0xffffffff);
TextDrawSetOutline(LDay,1);
TextDrawSetProportional(LDay,1);
TextDrawSetShadow(LDay,1);

LMsg = TextDrawCreate(552.000000,413.000000," ");
TextDrawAlignment(LMsg,0);
TextDrawBackgroundColor(LMsg,0x000000ff);
TextDrawFont(LMsg,1);
TextDrawLetterSize(LMsg,0.199999,0.899999);
TextDrawColor(LMsg,0xffffffff);
TextDrawSetOutline(LMsg,1);
TextDrawSetProportional(LMsg,1);
TextDrawSetShadow(LMsg,1);

//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// -> Background Desing <-
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

LText1 = TextDrawCreate(635.000000,352.000000,"TB");
LText2 = TextDrawCreate(485.000000,352.000000,"L");
LText3 = TextDrawCreate(632.000000,352.000000,"T");
LText4 = TextDrawCreate(633.000000,428.000000,"T");
LText5 = TextDrawCreate(546.000000,356.000000,"T2");
LText6 = TextDrawCreate(546.000000,410.000000,"T2");
LText7 = TextDrawCreate(631.000000,356.000000,"TB");

TextDrawUseBox(   LText1,1);
TextDrawBoxColor(LText1,0x00000099);
TextDrawTextSize(LText1,625.000000,0.000000);

TextDrawUseBox(   LText2,1);
TextDrawBoxColor( LText2,0x00000099);
TextDrawTextSize( LText2,475.000000,0.000000);

TextDrawUseBox(   LText3,1);
TextDrawBoxColor( LText3,0x00000099);
TextDrawTextSize( LText3,479.000000,0.000000);

TextDrawUseBox(   LText4,1);
TextDrawBoxColor( LText4,0x00000099);
TextDrawTextSize( LText4,478.000000,0.000000);

TextDrawUseBox(   LText5,1);
TextDrawBoxColor( LText5,0x00000066);
TextDrawTextSize( LText5,480.000000,0.000000);

TextDrawUseBox(   LText6,1);
TextDrawBoxColor( LText6,0x00000066);
TextDrawTextSize( LText6,480.000000,0.000000);

TextDrawUseBox(   LText7,1);
TextDrawBoxColor( LText7,0x00000066);
TextDrawTextSize( LText7,541.000000,0.000000);

TextDrawAlignment( LText1,0);
TextDrawAlignment( LText2,0);
TextDrawAlignment( LText3,0);
TextDrawAlignment( LText4,0);
TextDrawAlignment( LText5,0);
TextDrawAlignment( LText6,0);
TextDrawAlignment( LText7,0);

TextDrawBackgroundColor( LText1,0x000000ff);
TextDrawBackgroundColor( LText2,0x000000ff);
TextDrawBackgroundColor( LText3,0x000000ff);
TextDrawBackgroundColor( LText4,0x000000ff);
TextDrawBackgroundColor( LText5,0x000000ff);
TextDrawBackgroundColor( LText6,0x000000ff);
TextDrawBackgroundColor( LText7,0x000000ff);

TextDrawFont(LText1,3);
TextDrawLetterSize(LText1,-0.000000,8.199998);
TextDrawFont(LText2,3);
TextDrawLetterSize(LText2,-0.000000,8.200001);
TextDrawFont(LText3,3);
TextDrawLetterSize(LText3,-0.000000,-0.300000);
TextDrawFont(LText4,3);
TextDrawLetterSize(LText4,-0.000000,-0.200000);
TextDrawFont(LText5,3);
TextDrawLetterSize(LText5,-0.000000,5.300001);
TextDrawFont(LText6,3);
TextDrawLetterSize(LText6,-0.000000,1.300000);
TextDrawFont(LText7,3);
TextDrawLetterSize(LText7,-0.000000,7.299998);

TextDrawColor( LText1,0xffffffff);
TextDrawColor( LText2,0xffffffff);
TextDrawColor( LText3,0xffffffff);
TextDrawColor( LText4,0xffffffff);
TextDrawColor( LText5,0xffffffff);
TextDrawColor( LText6,0xffffffff);
TextDrawColor( LText7,0xffffffff);

TextDrawSetOutline( LText1,1);
TextDrawSetOutline( LText2,1);
TextDrawSetOutline( LText3,1);
TextDrawSetOutline( LText4,1);
TextDrawSetOutline( LText5,1);
TextDrawSetOutline( LText6,1);
TextDrawSetOutline( LText7,1);

TextDrawSetProportional( LText1,1);
TextDrawSetProportional( LText2,1);
TextDrawSetProportional( LText3,1);
TextDrawSetProportional( LText4,1);
TextDrawSetProportional( LText5,1);
TextDrawSetProportional( LText6,1);
TextDrawSetProportional( LText7,1);

TextDrawSetShadow( LText1,1);
TextDrawSetShadow( LText2,1);
TextDrawSetShadow( LText3,1);
TextDrawSetShadow( LText4,1);
TextDrawSetShadow( LText5,1);
TextDrawSetShadow( LText6,1);
TextDrawSetShadow( LText7,1);

//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// -> Hours Desing <-
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

LuxClock_Center = TextDrawCreate(510.000000,373.000000,"o");
TextDrawAlignment(LuxClock_Center,0);
TextDrawFont(LuxClock_Center,1);
TextDrawLetterSize(LuxClock_Center,0.399999,1.200000);
TextDrawColor(LuxClock_Center,0xffffff66);
TextDrawSetOutline(LuxClock_Center,1);
TextDrawSetProportional(LuxClock_Center,1);
TextDrawSetShadow(LuxClock_Center,1);
TextDrawSetShadow(LuxClock_Center,1);

LuxClock[0] = TextDrawCreate(521.000000,359.000000,"~w~1");
TextDrawAlignment(LuxClock[0],0);
TextDrawBackgroundColor(LuxClock[0],0x000000ff);
TextDrawFont(LuxClock[0],1);
TextDrawLetterSize(LuxClock[0],0.399999,1.000000);
TextDrawColor(LuxClock[0],0xffffffff);
TextDrawSetOutline(LuxClock[0],1);
TextDrawSetProportional(LuxClock[0],1);
TextDrawSetShadow(LuxClock[0],1);

LuxClock[1] = TextDrawCreate(528.000000,368.000000,"~w~2");
TextDrawAlignment(LuxClock[1],0);
TextDrawBackgroundColor(LuxClock[1],0x000000ff);
TextDrawFont(LuxClock[1],1);
TextDrawLetterSize(LuxClock[1],0.299999,0.899999);
TextDrawColor(LuxClock[1],0xffffffff);
TextDrawSetOutline(LuxClock[1],1);
TextDrawSetProportional(LuxClock[1],1);
TextDrawSetShadow(LuxClock[1],1);

LuxClock[2] = TextDrawCreate(532.000000,377.000000,"~w~3");
TextDrawAlignment(LuxClock[2],0);
TextDrawBackgroundColor(LuxClock[2],0x000000ff);
TextDrawFont(LuxClock[2],1);
TextDrawLetterSize(LuxClock[2],0.299999,0.899999);
TextDrawColor(LuxClock[2],0xffffffff);
TextDrawSetOutline(LuxClock[2],1);
TextDrawSetProportional(LuxClock[2],1);
TextDrawSetShadow(LuxClock[2],1);

LuxClock[3] = TextDrawCreate(529.000000,386.000000,"~w~4");
TextDrawAlignment(LuxClock[3],0);
TextDrawBackgroundColor(LuxClock[3],0x000000ff);
TextDrawFont(LuxClock[3],1);
TextDrawLetterSize(LuxClock[3],0.299999,0.899999);
TextDrawColor(LuxClock[3],0xffffffff);
TextDrawSetOutline(LuxClock[3],1);
TextDrawSetProportional(LuxClock[3],1);
TextDrawSetShadow(LuxClock[3],1);

LuxClock[4] = TextDrawCreate(523.000000,394.000000,"~w~5");
TextDrawAlignment(LuxClock[4],0);
TextDrawBackgroundColor(LuxClock[4],0x000000ff);
TextDrawFont(LuxClock[4],1);
TextDrawLetterSize(LuxClock[4],0.299999,0.899999);
TextDrawColor(LuxClock[4],0xffffffff);
TextDrawSetOutline(LuxClock[4],1);
TextDrawSetProportional(LuxClock[4],1);
TextDrawSetShadow(LuxClock[4],1);

LuxClock[5] = TextDrawCreate(511.000000,397.000000,"~w~6");
TextDrawAlignment(LuxClock[5],0);
TextDrawBackgroundColor(LuxClock[5],0x000000ff);
TextDrawFont(LuxClock[5],1);
TextDrawLetterSize(LuxClock[5],0.299999,0.899999);
TextDrawColor(LuxClock[5],0xffffffff);
TextDrawSetOutline(LuxClock[5],1);
TextDrawSetProportional(LuxClock[5],1);
TextDrawSetShadow(LuxClock[5],1);

LuxClock[6] = TextDrawCreate(503.000000,394.000000,"~w~7");
TextDrawAlignment(LuxClock[6],0);
TextDrawBackgroundColor(LuxClock[6],0x000000ff);
TextDrawFont(LuxClock[6],1);
TextDrawLetterSize(LuxClock[6],0.199999,0.899999);
TextDrawColor(LuxClock[6],0xffffffff);
TextDrawSetOutline(LuxClock[6],1);
TextDrawSetProportional(LuxClock[6],1);
TextDrawSetShadow(LuxClock[6],1);

LuxClock[7] = TextDrawCreate(494.000000,387.000000,"~w~8");
TextDrawAlignment(LuxClock[7],0);
TextDrawBackgroundColor(LuxClock[7],0x000000ff);
TextDrawFont(LuxClock[7],1);
TextDrawLetterSize(LuxClock[7],0.299999,0.899999);
TextDrawColor(LuxClock[7],0xffffffff);
TextDrawSetOutline(LuxClock[7],1);
TextDrawSetProportional(LuxClock[7],1);
TextDrawSetShadow(LuxClock[7],1);

LuxClock[8] = TextDrawCreate(489.000000,378.000000,"~w~9");
TextDrawAlignment(LuxClock[8],0);
TextDrawBackgroundColor(LuxClock[8],0x000000ff);
TextDrawFont(LuxClock[8],1);
TextDrawLetterSize(LuxClock[8],0.199999,0.899999);
TextDrawColor(LuxClock[8],0xffffffff);
TextDrawSetOutline(LuxClock[8],1);
TextDrawSetProportional(LuxClock[8],1);
TextDrawSetShadow(LuxClock[8],1);

LuxClock[9] = TextDrawCreate(490.000000,368.000000,"~w~10");
TextDrawAlignment(LuxClock[9],0);
TextDrawBackgroundColor(LuxClock[9],0x000000ff);
TextDrawFont(LuxClock[9],1);
TextDrawLetterSize(LuxClock[9],0.199999,0.899999);
TextDrawColor(LuxClock[9],0xffffffff);
TextDrawSetOutline(LuxClock[9],1);
TextDrawSetProportional(LuxClock[9],1);
TextDrawSetShadow(LuxClock[9],1);

LuxClock[10] = TextDrawCreate(498.000000,359.000000,"~w~11");
TextDrawAlignment(LuxClock[10],0);
TextDrawBackgroundColor(LuxClock[10],0x000000ff);
TextDrawFont(LuxClock[10],1);
TextDrawLetterSize(LuxClock[10],0.199999,0.899999);
TextDrawColor(LuxClock[10],0xffffffff);
TextDrawSetOutline(LuxClock[10],1);
TextDrawSetProportional(LuxClock[10],1);
TextDrawSetShadow(LuxClock[10],1);

LuxClock[11] = TextDrawCreate(508.000000,356.000000,"~w~12");
TextDrawAlignment(LuxClock[11],0);
TextDrawBackgroundColor(LuxClock[11],0x000000ff);
TextDrawFont(LuxClock[11],1);
TextDrawLetterSize(LuxClock[11],0.299999,0.899999);
TextDrawColor(LuxClock[11],0xffffffff);
TextDrawSetOutline(LuxClock[11],1);
TextDrawSetProportional(LuxClock[11],1);
TextDrawSetShadow(LuxClock[11],1);

for(new t; t < 12; t++) format(Tstring[t], sizeof Tstring, "%d", t+1);
   
new Hour, Min, Second;

gettime(Hour, Min, Second);

if (Hour > 12) Hour -= 12;
if (Hour == 0) Hour = 12;

DelTime = Hour-1;

L_UpdateClock();

SetTimer("L_UpdateClock",60000,1);
SetTimer("L_UpdateTime" ,1000, 1);

print( "\n");
print( " **********************************");
print( " *                                *");
print( " *        ---------------         *");
print( " *         -> LuX TDC <-          *");
print( " *        ---------------         *");
print( " *     The Digital Clock v1.0     *");
print( " *          By LuxurioN           *");
print( " *                                *");
print( " **********************************");
print("\n");
return 1;
}

public OnFilterScriptExit()
{
    TextDrawDestroy(LuxClock_Center);
    TextDrawDestroy(LText1);
    TextDrawDestroy(LText2);
    TextDrawDestroy(LText3);
    TextDrawDestroy(LText4);
    TextDrawDestroy(LText5);
    TextDrawDestroy(LText6);
    TextDrawDestroy(LText7);
   
    TextDrawDestroy(LHour);
    TextDrawDestroy(LDay);
    TextDrawDestroy(LMonth);
    TextDrawDestroy(LInfo);
    TextDrawDestroy(LCategory);
    TextDrawDestroy(LMsg);

    for(new t; t < 12; t++) TextDrawDestroy(LuxClock[t]);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    L_UpdateClock();
    return 1;
}

//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// -> Update Clock Functions <-
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
public L_UpdateTime(playerid)
{
    new string[256];
    new Hour, Minute, Second;
    new Year, Month, Day;
    gettime(Hour,Minute,Second);
    getdate(Year, Month, Day);
    format(string, sizeof(string), "%02d:%02d", Hour,Minute);
    TextDrawSetString(LHour, string);
    format(string, sizeof(string), "Day: %02d (%02d/%d/%d)", Day,Day, Month, Year);
    TextDrawSetString(LDay, string);

    if(Month == 1){
    format(string, sizeof(string), "Month: January");
    TextDrawSetString(LMonth, string);
    }
    else if(Month == 2)
    {
    format(string, sizeof(string), "Month: February");
    TextDrawSetString(LMonth, string);
    }
    else if(Month == 3){
    format(string, sizeof(string), "Month: March");
    TextDrawSetString(LMonth, string);
    }
    else if(Month == 4){
    format(string, sizeof(string), "Month: April");
    TextDrawSetString(LMonth, string);
    }
    else if(Month == 5){
    format(string, sizeof(string), "Month: May");
    TextDrawSetString(LMonth, string);
    }
    else if(Month == 6){
    format(string, sizeof(string), "Month: June");
    TextDrawSetString(LMonth, string);
    }
    else if(Month == 7){
    format(string, sizeof(string), "Month: July");
    TextDrawSetString(LMonth, string);
    }
    else if(Month == 8){
    format(string, sizeof(string), "Month: August");
    TextDrawSetString(LMonth, string);
    }
    else if(Month == 9){
    format(string, sizeof(string), "Month: September");
    TextDrawSetString(LMonth, string);
    }
    else if(Month == 10){
    format(string, sizeof(string), "Month: Oktober");
    TextDrawSetString(LMonth, string);
    }
    else if(Month == 11){
    format(string, sizeof(string), "Month: November");
    TextDrawSetString(LMonth, string);
    }
    else if(Month == 12){
    format(string, sizeof(string), "Month: December");
    TextDrawSetString(LMonth, string);
    }
    switch(Hour){
    case 0..5:{
    format(string, sizeof(string), "~y~Good Morning!");
    TextDrawSetString(LMsg, string);
    }
    case 6..11:{
    format(string, sizeof(string), "~y~Good Morning!");
    TextDrawSetString(LMsg, string);
    }
    case 12..17:{
    format(string, sizeof(string), "~g~Good Afternoon!");
    TextDrawSetString(LMsg, string);
    }
    case 18..23:{
    format(string, sizeof(string), "~b~Good Evening!");
    TextDrawSetString(LMsg, string);
    }
    }
    return 1;
}

//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// -> Update Clock Hours <-
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
public L_UpdateClock()
{
    new Year,Month;
    new Day,Hour;
    new Min,Second;
    new nstring[5];
    getdate(Year, Month, Day);
    gettime(Hour, Min, Second);
    TextDrawShowForAll(LHour);
    TextDrawShowForAll(LDay);
    TextDrawShowForAll(LMonth);
    TextDrawShowForAll(LInfo);
    TextDrawShowForAll(LCategory);
    TextDrawShowForAll(LMsg);
    TextDrawShowForAll(LText1);
    TextDrawShowForAll(LText2);
    TextDrawShowForAll(LText3);
    TextDrawShowForAll(LText4);
    TextDrawShowForAll(LText5);
    TextDrawShowForAll(LText6);
    TextDrawShowForAll(LText7);
    TextDrawShowForAll(LuxClock_Center);
   
    for(new l; l < 12; l++) TextDrawShowForAll(LuxClock[l]);
    if (Hour > 12) Hour -= 12;
    if (Hour == 0) Hour = 12;
    for(new l; l < 12; l++){
    if (Hour-1 == l){
    format(nstring, sizeof nstring, "~w~%s", Tstring[DelTime]);
    TextDrawSetString(LuxClock[DelTime], nstring);
    TextDrawShowForAll(LuxClock[DelTime]);
    //SetWorldTime(Hour);
    format(nstring, sizeof nstring, "~r~%d", l+1);
    TextDrawSetString(LuxClock[l], nstring);
    TextDrawShowForAll(LuxClock[l]); DelTime = l;
    break;
    }
    }
    }
Reply
#5

put it in a FS or in ur gamemode in u will see clock = date and time (global = everyone) same time and data try it out
pawn Код:
#include <a_samp>


new Text:Time, Text:Date;

forward settime(playerid);

public OnFilterScriptInit()


    SetTimer("settime",1000,true);

    Date = TextDrawCreate(547.000000,11.000000,"--");

    TextDrawFont(Date,3);
    TextDrawLetterSize(Date,0.399999,1.600000);
    TextDrawColor(Date,0xffffffff);

    Time = TextDrawCreate(547.000000,28.000000,"--");

    TextDrawFont(Time,3);
    TextDrawLetterSize(Time,0.399999,1.600000);
    TextDrawColor(Time,0xffffffff);


    SetTimer("settime",1000,true);
    return 1;
}

public OnFilterScriptExit()
{

    return 1;
}

public OnPlayerSpawn(playerid)
{
    TextDrawShowForPlayer(playerid, Time), TextDrawShowForPlayer(playerid, Date);


    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    TextDrawHideForPlayer(playerid, Time), TextDrawHideForPlayer(playerid, Date);
    return 1;
}

public settime(playerid)
{
    new string[256],year,month,day,hours,minutes,seconds;
    getdate(year, month, day), gettime(hours, minutes, seconds);
    format(string, sizeof string, "%d/%s%d/%s%d", day, ((month < 10) ? ("0") : ("")), month, (year < 10) ? ("0") : (""), year);
    TextDrawSetString(Date, string);
    format(string, sizeof string, "%s%d:%s%d:%s%d", (hours < 10) ? ("0") : (""), hours, (minutes < 10) ? ("0") : (""), minutes, (seconds < 10) ? ("0") : (""), seconds);
    TextDrawSetString(Time, string);
}
Reply
#6

this is worldtime not ingame time
Reply
#7

did you guys ever play on crazybob's? if yes you could see clock ingame its not global time its ingame time! dont you get it lol
Reply
#8

Quote:
Originally Posted by Beljulji
Посмотреть сообщение
this is worldtime not ingame time
The code I posted isn't?
Reply
#9

Quote:
Originally Posted by Dzines4SAMP
Посмотреть сообщение
The code I posted isn't?
Thats Global Time Not Ingame Time
Reply
#10

Quote:
Originally Posted by Glad2BeHere
Посмотреть сообщение
put it in a FS or in ur gamemode in u will see clock = date and time (global = everyone) same time and data try it out
pawn Код:
#include <a_samp>


new Text:Time, Text:Date;

forward settime(playerid);

public OnFilterScriptInit()


    SetTimer("settime",1000,true);

    Date = TextDrawCreate(547.000000,11.000000,"--");

    TextDrawFont(Date,3);
    TextDrawLetterSize(Date,0.399999,1.600000);
    TextDrawColor(Date,0xffffffff);

    Time = TextDrawCreate(547.000000,28.000000,"--");

    TextDrawFont(Time,3);
    TextDrawLetterSize(Time,0.399999,1.600000);
    TextDrawColor(Time,0xffffffff);


    SetTimer("settime",1000,true);
    return 1;
}

public OnFilterScriptExit()
{

    return 1;
}

public OnPlayerSpawn(playerid)
{
    TextDrawShowForPlayer(playerid, Time), TextDrawShowForPlayer(playerid, Date);


    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    TextDrawHideForPlayer(playerid, Time), TextDrawHideForPlayer(playerid, Date);
    return 1;
}

public settime(playerid)
{
    new string[256],year,month,day,hours,minutes,seconds;
    getdate(year, month, day), gettime(hours, minutes, seconds);
    format(string, sizeof string, "%d/%s%d/%s%d", day, ((month < 10) ? ("0") : ("")), month, (year < 10) ? ("0") : (""), year);
    TextDrawSetString(Date, string);
    format(string, sizeof string, "%s%d:%s%d:%s%d", (hours < 10) ? ("0") : (""), hours, (minutes < 10) ? ("0") : (""), minutes, (seconds < 10) ? ("0") : (""), seconds);
    TextDrawSetString(Time, string);
}
i used this one in my stunt server and that is global time not ingame time
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)