• Страница 1 из 1
  • 1
Форум » Программирование в Pawno » Готовые решения » Создание Часов и Даты
Создание Часов и Даты
Добавлено 31.03.2016 в 05:30 | Сообщение №1
Сообщений: 265 Репутация: 0
Администраторы


Часы и дата вырезаны из мода GRAND RPG может кому пригодяться)
Ко всем new:
Код
new Text:Times;
new Text:Date;
new Text:lbt;
new Text:lbb;

Ко всем new и Forward:
Код
new text: Textdraw0;
forward settime(playerid);

В public OnPlayerConnect(playerid):
Код
TextDrawShowForPlayer(playerid,Text:Date);
TextDrawShowForPlayer(playerid,Text:Times);
TextDrawShowForPlayer(playerid,Text:Textdraw0);

В public OnGameModeInit():
Код
SetTimer("settime",1000,true);
Date = TextDrawCreate(630.000000,420.000000,"--");
TextDrawLetterSize(Date,0.399999,1.600000);
TextDrawFont(Date,3);
TextDrawUseBox(Date, 0);
TextDrawSetShadow(Date,0);
TextDrawSetOutline(Date,2);
TextDrawBackgroundColor(Date,0x66ff00FF);
TextDrawColor(Date,0x000000FF);
TextDrawAlignment(Date,3);

SetTimer("settime",1000,true);
Times = TextDrawCreate(547.000000,23.000000,"--");
TextDrawLetterSize(Times,0.399999,2.000000);
TextDrawFont(Times,3);
TextDrawColor(Times,0xffffffff);
SetTimer("settime",1000,true);

DisableInteriorEnterExits();
EnableStuntBonusForAll(0);
ManualVehicleEngineAndLights();
lbt = TextDrawCreate(-1.000000,2.000000,"---");
lbb = TextDrawCreate(0.000000,337.000000,"---");
TextDrawUseBox(lbt,1);
TextDrawBoxColor(lbt,0x000000ff);
TextDrawTextSize(lbt,640.000000,-69.000000);
TextDrawUseBox(lbb,1);
TextDrawBoxColor(lbb,0x000000ff);
TextDrawTextSize(lbb,638.000000,-60.000000);
TextDrawAlignment(lbt,0);
TextDrawAlignment(lbb,0);
TextDrawBackgroundColor(lbt,0x000000ff);
TextDrawBackgroundColor(lbb,0x000000ff);
TextDrawFont(lbt,3);
TextDrawLetterSize(lbt,1.000000,12.199999);
TextDrawFont(lbb,3);
TextDrawLetterSize(lbb,0.899999,15.000000);
TextDrawColor(lbt,0x000000ff);
TextDrawColor(lbb,0x000000ff);
TextDrawSetOutline(lbt,1);
TextDrawSetOutline(lbb,1);
TextDrawSetProportional(lbt,1);
TextDrawSetProportional(lbb,1);
TextDrawSetShadow(lbt,1);
TextDrawSetShadow(lbb,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(Times, string);
}

Автор: Неизвестен


Программист любитель :)
Форум » Программирование в Pawno » Готовые решения » Создание Часов и Даты
  • Страница 1 из 1
  • 1
Поиск: