• Страница 1 из 1
  • 1
Модератор форума: [east_side]_trane, drifter-dron, valych, admin  
pawno урок время
adminДата: Суббота, 27.08.2011, 16:18:35 | Сообщение # 1

Группа: Администраторы
Сообщений: 3869

И так начнем уроку!
верху мода:
Code
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xFF0000AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_VIOLETBLUE 0x8A2BE2AA
#define COLOR_DEADCONNECT 0x808080AA
#define COLOR_BLUE 0x0000FFAA
#define COLOR_FORESTGREEN 0x228B22AA
#define COLOR_DODGERBLUE 0x1E90FFAA
#define COLOR_DARKOLIVEGREEN 0x556B2FAA
#define COLOR_ORANGE 0xFFA500AA
#define COLOR_PURPLE 0x800080AA
#define COLOR_ROYALBLUE 0x4169FFAA
#define COLOR_ERROR 0xD2691EAA
#define COLOR_PINK 0xFF0080FF
#define COLOR_SEXYGREEN 0x00FF00FF
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_LIME 0x10F441AA
#define COLOR_ADMIN 0x10F441AA
#define COLOR_CYAN 0x40FFFFFF
#define COLOR_ORANGERED 0xFF4500AA
forward IncreaseTime(playerid);
new Text:time;
new gametime;
new h=0;
new m=0;
new d=1;
new Text:monday;

После этого ищем public OnGameModeInit() и туда добавляем:
Code
    SetWorldTime(0);
  time = TextDrawCreate(605.0,25.0,"00:00");
  TextDrawUseBox(time, 0);
  TextDrawFont(time, 3);
  TextDrawSetShadow(time,0);  
  TextDrawSetOutline(time,2);  
     TextDrawBackgroundColor(time,0x000000FF);
     TextDrawColor(time,0xFFFFFFFF);
     TextDrawAlignment(time,3);
  TextDrawLetterSize(time,0.5,1.5);
  KillTimer(gametime);
     gametime = SetTimer("IncreaseTime", 1000, true);
     monday = TextDrawCreate(610.000000,7.000000,"VREMYA");
  TextDrawUseBox(monday,0);
  TextDrawFont(monday,1);
  TextDrawLetterSize(monday,0.6,1.5);
  TextDrawSetShadow(monday,1);
  TextDrawSetOutline(monday ,0);
  TextDrawBackgroundColor(monday, 0x000000FF);
  TextDrawBoxColor(monday ,0x00000066);
  TextDrawColor(monday,0xFFFFFFFF);
  TextDrawTextSize(monday , -1880.0, -1880.0);
  TextDrawAlignment(monday,3);
  TextDrawSetOutline(monday,1);

После этого ищем public OnPlayerConnect(playerid) и туда добавляем:
Code
TextDrawShowForPlayer(playerid,monday);
  GetPlayerTimeEx(playerid, h, m);
  TextDrawShowForPlayer(playerid, time);

После этого добавим функцию и public сам времени.Вставляем в любое место:
Code
public IncreaseTime(playerid)
{

     new string[20];
     GetPlayerTimeEx(playerid, h, m);
     TextDrawShowForPlayer(playerid, time);
     m++;

     if(m == 60)
     {
         h++;
         m = 0;
     }
     if(h == 24)
     {
         h = 0;
     }
     if(h == 0 && m == 0)
  {
   d ++;
  }
  if(h == 0 && d == 8 && m == 0)
  {
   SendRconCommand("gmx");//рестарт времени для ркон
  }
     if(h == 0 && d == 2 && m ==0)
  {
   SendClientMessageToAll(COLOR_WHITE,"[День] Понедельник");
   TextDrawSetString(monday,"Понедельник");
  }
  if(h == 0 && d == 3 && m ==0)
  {
   SendClientMessageToAll(COLOR_WHITE,"[ДЕнь] Вторник");
   TextDrawSetString(monday,"Вторник");
  }
  if(h == 0 && d == 4 && m ==0)
  {
   SendClientMessageToAll(COLOR_WHITE,"[День] Среда");
   TextDrawSetString(monday,"Среда");
  }
  if(h == 0 && d == 5 && m ==0)
  {
   SendClientMessageToAll(COLOR_WHITE,"[День] Четверг");
   TextDrawSetString(monday,"×Четверг");
  }
  if(h == 0 && d == 6 && m ==0)
  {
   SendClientMessageToAll(COLOR_WHITE,"[День] Пятница");
   TextDrawSetString(monday,"Пятница");
  }
  if(h == 0 && d == 7 && m ==0)
  {
   SendClientMessageToAll(COLOR_WHITE,"[День] Суббота");
   TextDrawSetString(monday,"Суббота");
  }
  if(h == 0 && d == 1 && m ==0)
   {
   SendClientMessageToAll(COLOR_WHITE,"[День] Воскресенье");
   TextDrawSetString(monday,"Воскресенье");
  }
  format(string, sizeof(string), "%d", h);
  TextDrawShowForPlayer(playerid, monday);
     SetPlayerTimeEx(playerid, h, m);
  if(h >= 0 && h < 10 && m >= 0&&m < 10)
     {
         format(string, sizeof(string), "0%d:0%d", h, m);
         TextDrawSetString(time,string);
     }
  else if(h >= 10 && m >= 10)
     {
         format(string, sizeof(string), "%d:%d", h, m);
         TextDrawSetString(time,string);
     }
     else if(h >= 10 && m >= 0&&m < 10)
     {
         format(string, sizeof(string), "%d:0%d", h, m);
         TextDrawSetString(time,string);
     }
     else if(h >= 0 && h < 10 && m >= 10)
     {
         format(string, sizeof(string), "0%d:%d", h, m);
         TextDrawSetString(time,string);
     }
     if(h== 1 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 1:00");
   SetWorldTime(1);
   return 1;
  }
  if(h== 2 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 2:00");
   SetWorldTime(2);
   return 1;
  }
  if(h== 3 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 3:00");
   SetWorldTime(3);
   return 1;
  }
  if(h== 4 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 4:00");
   SetWorldTime(4);
   return 1;
  }
  if(h== 5 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 5:00");
   SetWorldTime(5);
   return 1;
  }
  if(h== 6 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 6:00");
   SetWorldTime(6);
   return 1;
  }
  if(h== 7 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 7:00");
   SetWorldTime(7);
   return 1;
  }
  if(h== 8 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 8:00");
   SetWorldTime(8);
   return 1;
  }
     if(h== 0 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 0:00");
   SetWorldTime(0);
   return 1;
  }
   if(h== 9 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 9:00");
   SetWorldTime(9);
   return 1;
  }
  if(h== 10 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 10:00");
   SetWorldTime(10);
   return 1;
  }
  if(h== 11 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 11:00");
   SetWorldTime(11);
   return 1;
  }
  if(h== 12 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 12:00");
   SetWorldTime(12);
   return 1;
  }
  if(h== 13 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 13:00");
   SetWorldTime(13);
   return 1;
  }
  if(h== 14 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 14:00");
   SetWorldTime(14);
   return 1;
  }
  if(h== 15 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 15:00");
   SetWorldTime(15);
   return 1;
  }
  if(h== 16 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 16:00");
   SetWorldTime(16);
   return 1;
  }
     if(h== 17 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 17:00");
   SetWorldTime(17);
   return 1;
  }
   if(h== 18 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 18:00");
   SetWorldTime(18);
   return 1;
  }
  if(h== 19 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 19:00");
   SetWorldTime(19);
   return 1;
  }
  if(h== 20 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 20:00");
   SetWorldTime(20);
   return 1;
  }
  if(h== 21 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 21:00");
   SetWorldTime(21);
   return 1;
  }
  if(h== 22 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 22:00");
   SetWorldTime(22);
   return 1;
  }
  if(h== 23 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 23:00");
   SetWorldTime(23);
   return 1;
  }
     return 1;
}
stock SetToNull(playerid)
{
     SetPlayerTimeEx(playerid, 0, 0);
     return 1;
}
stock SetPlayerTimeEx(playerid, hour, minute)
{
     SetPVarInt(playerid, "hours", hour);
     SetPVarInt(playerid, "minutes", minute);
     return 1;
}
stock GetPlayerTimeEx(playerid, &hour, &minute)
{
     hour = GetPVarInt(playerid, "hours");
     minute = GetPVarInt(playerid, "minutes");
     return 1;
}

Урок by - 26_RUSSS


zm-jail.ru

Разработка сайта samp-pawno.ru


 
Сообщение
И так начнем уроку!
верху мода:
Code
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xFF0000AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_VIOLETBLUE 0x8A2BE2AA
#define COLOR_DEADCONNECT 0x808080AA
#define COLOR_BLUE 0x0000FFAA
#define COLOR_FORESTGREEN 0x228B22AA
#define COLOR_DODGERBLUE 0x1E90FFAA
#define COLOR_DARKOLIVEGREEN 0x556B2FAA
#define COLOR_ORANGE 0xFFA500AA
#define COLOR_PURPLE 0x800080AA
#define COLOR_ROYALBLUE 0x4169FFAA
#define COLOR_ERROR 0xD2691EAA
#define COLOR_PINK 0xFF0080FF
#define COLOR_SEXYGREEN 0x00FF00FF
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_LIME 0x10F441AA
#define COLOR_ADMIN 0x10F441AA
#define COLOR_CYAN 0x40FFFFFF
#define COLOR_ORANGERED 0xFF4500AA
forward IncreaseTime(playerid);
new Text:time;
new gametime;
new h=0;
new m=0;
new d=1;
new Text:monday;

После этого ищем public OnGameModeInit() и туда добавляем:
Code
    SetWorldTime(0);
  time = TextDrawCreate(605.0,25.0,"00:00");
  TextDrawUseBox(time, 0);
  TextDrawFont(time, 3);
  TextDrawSetShadow(time,0);  
  TextDrawSetOutline(time,2);  
     TextDrawBackgroundColor(time,0x000000FF);
     TextDrawColor(time,0xFFFFFFFF);
     TextDrawAlignment(time,3);
  TextDrawLetterSize(time,0.5,1.5);
  KillTimer(gametime);
     gametime = SetTimer("IncreaseTime", 1000, true);
     monday = TextDrawCreate(610.000000,7.000000,"VREMYA");
  TextDrawUseBox(monday,0);
  TextDrawFont(monday,1);
  TextDrawLetterSize(monday,0.6,1.5);
  TextDrawSetShadow(monday,1);
  TextDrawSetOutline(monday ,0);
  TextDrawBackgroundColor(monday, 0x000000FF);
  TextDrawBoxColor(monday ,0x00000066);
  TextDrawColor(monday,0xFFFFFFFF);
  TextDrawTextSize(monday , -1880.0, -1880.0);
  TextDrawAlignment(monday,3);
  TextDrawSetOutline(monday,1);

После этого ищем public OnPlayerConnect(playerid) и туда добавляем:
Code
TextDrawShowForPlayer(playerid,monday);
  GetPlayerTimeEx(playerid, h, m);
  TextDrawShowForPlayer(playerid, time);

После этого добавим функцию и public сам времени.Вставляем в любое место:
Code
public IncreaseTime(playerid)
{

     new string[20];
     GetPlayerTimeEx(playerid, h, m);
     TextDrawShowForPlayer(playerid, time);
     m++;

     if(m == 60)
     {
         h++;
         m = 0;
     }
     if(h == 24)
     {
         h = 0;
     }
     if(h == 0 && m == 0)
  {
   d ++;
  }
  if(h == 0 && d == 8 && m == 0)
  {
   SendRconCommand("gmx");//рестарт времени для ркон
  }
     if(h == 0 && d == 2 && m ==0)
  {
   SendClientMessageToAll(COLOR_WHITE,"[День] Понедельник");
   TextDrawSetString(monday,"Понедельник");
  }
  if(h == 0 && d == 3 && m ==0)
  {
   SendClientMessageToAll(COLOR_WHITE,"[ДЕнь] Вторник");
   TextDrawSetString(monday,"Вторник");
  }
  if(h == 0 && d == 4 && m ==0)
  {
   SendClientMessageToAll(COLOR_WHITE,"[День] Среда");
   TextDrawSetString(monday,"Среда");
  }
  if(h == 0 && d == 5 && m ==0)
  {
   SendClientMessageToAll(COLOR_WHITE,"[День] Четверг");
   TextDrawSetString(monday,"×Четверг");
  }
  if(h == 0 && d == 6 && m ==0)
  {
   SendClientMessageToAll(COLOR_WHITE,"[День] Пятница");
   TextDrawSetString(monday,"Пятница");
  }
  if(h == 0 && d == 7 && m ==0)
  {
   SendClientMessageToAll(COLOR_WHITE,"[День] Суббота");
   TextDrawSetString(monday,"Суббота");
  }
  if(h == 0 && d == 1 && m ==0)
   {
   SendClientMessageToAll(COLOR_WHITE,"[День] Воскресенье");
   TextDrawSetString(monday,"Воскресенье");
  }
  format(string, sizeof(string), "%d", h);
  TextDrawShowForPlayer(playerid, monday);
     SetPlayerTimeEx(playerid, h, m);
  if(h >= 0 && h < 10 && m >= 0&&m < 10)
     {
         format(string, sizeof(string), "0%d:0%d", h, m);
         TextDrawSetString(time,string);
     }
  else if(h >= 10 && m >= 10)
     {
         format(string, sizeof(string), "%d:%d", h, m);
         TextDrawSetString(time,string);
     }
     else if(h >= 10 && m >= 0&&m < 10)
     {
         format(string, sizeof(string), "%d:0%d", h, m);
         TextDrawSetString(time,string);
     }
     else if(h >= 0 && h < 10 && m >= 10)
     {
         format(string, sizeof(string), "0%d:%d", h, m);
         TextDrawSetString(time,string);
     }
     if(h== 1 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 1:00");
   SetWorldTime(1);
   return 1;
  }
  if(h== 2 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 2:00");
   SetWorldTime(2);
   return 1;
  }
  if(h== 3 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 3:00");
   SetWorldTime(3);
   return 1;
  }
  if(h== 4 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 4:00");
   SetWorldTime(4);
   return 1;
  }
  if(h== 5 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 5:00");
   SetWorldTime(5);
   return 1;
  }
  if(h== 6 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 6:00");
   SetWorldTime(6);
   return 1;
  }
  if(h== 7 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 7:00");
   SetWorldTime(7);
   return 1;
  }
  if(h== 8 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 8:00");
   SetWorldTime(8);
   return 1;
  }
     if(h== 0 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 0:00");
   SetWorldTime(0);
   return 1;
  }
   if(h== 9 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 9:00");
   SetWorldTime(9);
   return 1;
  }
  if(h== 10 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 10:00");
   SetWorldTime(10);
   return 1;
  }
  if(h== 11 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 11:00");
   SetWorldTime(11);
   return 1;
  }
  if(h== 12 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 12:00");
   SetWorldTime(12);
   return 1;
  }
  if(h== 13 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 13:00");
   SetWorldTime(13);
   return 1;
  }
  if(h== 14 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 14:00");
   SetWorldTime(14);
   return 1;
  }
  if(h== 15 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 15:00");
   SetWorldTime(15);
   return 1;
  }
  if(h== 16 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 16:00");
   SetWorldTime(16);
   return 1;
  }
     if(h== 17 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 17:00");
   SetWorldTime(17);
   return 1;
  }
   if(h== 18 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 18:00");
   SetWorldTime(18);
   return 1;
  }
  if(h== 19 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 19:00");
   SetWorldTime(19);
   return 1;
  }
  if(h== 20 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 20:00");
   SetWorldTime(20);
   return 1;
  }
  if(h== 21 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 21:00");
   SetWorldTime(21);
   return 1;
  }
  if(h== 22 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 22:00");
   SetWorldTime(22);
   return 1;
  }
  if(h== 23 && m==0)
     {
         SendClientMessageToAll(COLOR_WHITE,"[Время] 23:00");
   SetWorldTime(23);
   return 1;
  }
     return 1;
}
stock SetToNull(playerid)
{
     SetPlayerTimeEx(playerid, 0, 0);
     return 1;
}
stock SetPlayerTimeEx(playerid, hour, minute)
{
     SetPVarInt(playerid, "hours", hour);
     SetPVarInt(playerid, "minutes", minute);
     return 1;
}
stock GetPlayerTimeEx(playerid, &hour, &minute)
{
     hour = GetPVarInt(playerid, "hours");
     minute = GetPVarInt(playerid, "minutes");
     return 1;
}

Урок by - 26_RUSSS

Автор - admin
Дата добавления - 27.08.2011 в 16:18:35
  • Страница 1 из 1
  • 1
Поиск:
Загрузка страницы, займет меньше минуты...
Загрузка...

Статистика Форума
Последнии темы Читаемые темы Лучшие пользователи Новые пользователи
Система телефонов поломалась
Не в себе
фильм скалайн
Трансформеры 3
форсаж 6
Ищу [FS]Для админок на сервер
нужны координаты карты для отметки зон...
Помогите найти мод
pawno урок автоматические ворота
обращение к скриптерам.
Вопросы по скриптингу
Ваши ошибки при компиляции GM/FS

Вопросы по скриптингу

(1081)

Считаем до 1000

(274)

Ваши ошибки при компиляция gm

(260)

Набор в команду

(80)

Ваши ошибки при компиляции GM/FS

(71)

вопроосы по скриптингу от 22.04.2013

(64)

Баннеробмен

(64)

несколько команд на samp 0.3 c

(64)

Оценки сайта samp-pawno.ru

(55)

Заказ хостинга

(51)

Набор в команду(форум)

(45)

Урок №61 по созданию системы авто для GodFather

(45)

admin

(3869)

[east_side]_trane

(443)

TWiX

(316)

valych

(501)

drifter-dron

(477)

danik_rok

(317)

Dimka_71rus

(360)

Drifter96

(300)

MaNb9K

(220)

[MTA]MaPeR5518

(181)

Dima_Tkach

(107)

Nik_Ull

(184)

system32xzxz

(Четверг 09:25:24)

torbin169

(Суббота 23:09:29)

kuchuk_00

(Суббота 17:10:14)

artem_boyko_3

(Суббота 15:57:37)

greggelbak

(Среда 18:29:37)

vladisvlavs

(Среда 13:51:57)

add02102002

(Понедельник 22:37:15)

Диман221

(Понедельник 18:12:45)

almas051004

(Воскресенье 11:05:32)

megasuccessms

(Суббота 14:15:36)

nawe

(Пятница 22:25:23)

swoysb

(Пятница 14:55:29)

Вверх
01:57:56
ОбновитьСмайлыУправление мини-чатом
ЧАТ-PAWNO
2010-2025

vkontakte :samp-pawno.ru: