Доступ к архиву

Переход в группу "Пользователь"

300.00 ₽
Одноразовый платёж
Быстрый переход в группу "Пользователи", без надобности написания постов и ожидания.

Покупка дает возможность:
Быть полноправным участником форума
Нормальное копирование кода
Создавать темы
Скачивать файлы
Доступ к архиву Pawno-Info

Часы на TextDraw-ах

Статус
В этой теме нельзя размещать новые ответы.

Sleek_Free

Ученик
Сделал часы более Рп-шные.
Скрин:

Ко всем new:
PHP:
new Text:Datum;
new Text:Datumm;
new Text:Datummm;
В public OnGameModeInit:
PHP:
Datumm = TextDrawCreate(561.000000, 257.000000, "19040");
TextDrawBackgroundColor(Datumm, -256);
TextDrawFont(Datumm, 5);
TextDrawLetterSize(Datumm, 0.500000, 1.000000);
TextDrawColor(Datumm, -1);
TextDrawSetOutline(Datumm, 0);
TextDrawSetProportional(Datumm, 1);
TextDrawSetShadow(Datumm, 1);
TextDrawUseBox(Datumm, 1);
TextDrawBoxColor(Datumm, -256);
TextDrawTextSize(Datumm, 111.000000, 111.000000);
TextDrawSetPreviewModel(Datumm, 19040);
TextDrawSetPreviewRot(Datumm, 10.000000, 91.000000, 10.000000, 0.400000);
TextDrawSetSelectable(Datumm, 1);

Datum = TextDrawCreate(589.000000, 308.000000, "20:20");
TextDrawBackgroundColor(Datum, 255);
TextDrawFont(Datum, 3);
TextDrawLetterSize(Datum, 0.469999, 1.299999);
TextDrawColor(Datum, -1);
TextDrawSetOutline(Datum, 0);
TextDrawSetProportional(Datum, 1);
TextDrawSetShadow(Datum, 1);
TextDrawSetSelectable(Datum, 0);

Datummm = TextDrawCreate(575.000000, 276.000000, "LD_BEAT:chit");
TextDrawBackgroundColor(Datummm, 255);
TextDrawFont(Datummm, 4);
TextDrawLetterSize(Datummm, 0.500000, 2.000000);
TextDrawColor(Datummm, 255);
TextDrawSetOutline(Datummm, 0);
TextDrawSetProportional(Datummm, 1);
TextDrawSetShadow(Datummm, 1);
TextDrawUseBox(Datummm, 1);
TextDrawBoxColor(Datummm, -1);
TextDrawTextSize(Datummm, 72.000000, 78.000000);
TextDrawSetSelectable(Datummm, 0);
В public OnPlayerCommandText:

PHP:
if(strcmp(cmd, "/time", true) == 0) 
    { 
    if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) { ApplyAnimation(playerid, "COP_AMBIENT", "Coplook_watch",4.1,0,0,0,0,0); } 
    GetPlayerName(playerid, sendername, sizeof(sendername)); 
    format(string, sizeof(string), "%s взглянул на часы", sendername); 
    new hours,minutes,seconds; gettime(hours, minutes, seconds); 
    ProxDetector(25.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); 
    format(string, sizeof string, "%s%d:%s%d", (hours < 10) ? ("0") : (""), hours, (minutes < 10) ? ("0") : (""), minutes, (seconds < 10) ? ("0") : (""), seconds); 
    TextDrawSetString(Datum, string); 
    TextDrawShowForPlayer(playerid, Datum); TextDrawShowForPlayer(playerid, Datumm); TextDrawShowForPlayer(playerid, Datummm); 
    SetTimerEx( "Vsystem",5000,false, "i", playerid);
    }
PHP:
    CMD:time(playerid, params[]) 
    { 
    if(!IsPlayerConnected(playerid)) return true; 
    if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) ApplyAnimation(playerid, "COP_AMBIENT", "Coplook_watch",4.1,0,0,0,0,0); 
    format(LIFECMDstr, sizeof(LIFECMDstr), "%s взглянул на часы",Name(playerid)); 
    new hours,minutes,seconds; gettime(hours, minutes, seconds); 
    ProxDetector(25.0, playerid, LIFECMDstr, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); 
    format(LIFECMDstr, sizeof LIFECMDstr, "%s%d:%s%d", (hours < 10) ? ("0") : (""), hours, (minutes < 10) ? ("0") : (""), minutes, (seconds < 10) ? ("0") : (""), seconds); 
    TextDrawSetString(Datum, LIFECMDstr); 
    TextDrawShowForPlayer(playerid, Datum); TextDrawShowForPlayer(playerid, Datumm); TextDrawShowForPlayer(playerid, Datummm); 
    SetTimerEx( "Vsystem",5000,false, "i", playerid);
    return true; 
    }
В конец мода:
PHP:
forward Vsystem(playerid);
public Vsystem(playerid)  { TextDrawHideForPlayer(playerid,Datum); TextDrawHideForPlayer(playerid,Datumm); TextDrawHideForPlayer(playerid,Datummm); return 1; }
Автор Я Barry_Trigger(Sleek_Free)
Что-то не понятно пишите ниже помогу.
Спасибо DexieD за оптимизацию кода.
 
Последнее редактирование:
Статус
В этой теме нельзя размещать новые ответы.
Сверху Снизу