• Страница 1 из 1
  • 1
Форум » PAWNO » Уроки Pawno » Делаем Спидометр как на samp-rp (rls) by EblanStyle
Делаем Спидометр как на samp-rp (rls) by EblanStyle
Дмитрий Дата: Суббота, 19.05.2012, 11:32 | Сообщение # 1 | Сообщить о нерабочей теме


Аватар для Дмитрий

[moder]и так начнем.
Найдите вот Эти new[/moder]
Code
new Text:Box;//переменная главного бокса //   
new    Text:Speed;//Переменная текстдрава со словом Speed   
new    Text:SpeedShow[MAX_PLAYERS];//Переменная показывает скорость автомобиля(отдельна для каждого игрока)   
new Text:Fuel;//Переменная текстдрава со словом fuel   
new Text:FuelShow[MAX_PLAYERS];//Переменная текстдрава показывающая район(отдельна для каждого игрока)   
new Text:Status;//Переменная текстдрава со словом Status   
new Text:StatusShow[MAX_PLAYERS];//Переменная текстдрава показывающая status авто(отдельна для каждого игрока)   
new Text:KMShow[MAX_PLAYERS];//Переменная текстдрава показывающая status авто(отдельна для каждого игрока)   
new str1[64],str2[64],str3[64],str5[64];    


[moder]и замените на[/moder]

Code
new Text:Box;//переменная главного бокса //   
new    Text:Speed;//Переменная текстдрава со словом Speed   
new    Text:SpeedShow[MAX_PLAYERS];//Переменная показывает скорость автомобиля(отдельна для каждого игрока)   
new Text:Fuel;//Переменная текстдрава со словом fuel   
new Text:FuelShow[MAX_PLAYERS];//Переменная текстдрава показывающая район(отдельна для каждого игрока)   
new Text:Status;//Переменная текстдрава со словом Status   
new Text:StatusShow[MAX_PLAYERS];//Переменная текстдрава показывающая status авто(отдельна для каждого игрока)   
new Text:KMShow[MAX_PLAYERS];//Переменная текстдрава показывающая status авто(отдельна для каждого игрока)   
new Text:Fill[MAX_PLAYERS];//By EblanStyle   
new str1[64],str2[64],str3[64],str5[64],str4[64];    


[moder]далее ищите Ваши текстдравы Спидометра и заменяете на Эти[/moder]

Code
STimer[playerid] = SetTimerEx("UpdateSpeedometr", Update, 1, "d", playerid); // таймер!   
       SpeedShow[playerid] = TextDrawCreate(374.000000, 408.000000,"0"); //сам Text Draw km/h   
      TextDrawBackgroundColor(SpeedShow[playerid], 255);   
      TextDrawAlignment(SpeedShow[playerid], 2);   
      TextDrawLetterSize(SpeedShow[playerid],0.500000, 1.500000);//размер текста   
      TextDrawFont(SpeedShow[playerid],0);//стиль   
      TextDrawColor(SpeedShow[playerid],761773823);//цвет текста   
      TextDrawSetOutline(SpeedShow[playerid],1);//размер обводки   
      TextDrawSetProportional(SpeedShow[playerid],1);   
         
      StatusShow[playerid] = TextDrawCreate(451.000000, 414.000000, "_");//сам Text Draw Status   
      TextDrawBackgroundColor(StatusShow[playerid], 255);//обводка текста   
      TextDrawLetterSize(StatusShow[playerid],0.619998, 1.399999);//размер текста   
      TextDrawFont(StatusShow[playerid], 1);//стиль   
      TextDrawColor(StatusShow[playerid], 9896191);//цвет текста   
      TextDrawSetOutline(StatusShow[playerid], 1);//размер обводки   
      TextDrawSetProportional(StatusShow[playerid],1);   
         
      KMShow[playerid] = TextDrawCreate(393.000000, 410.000000, "_");//сам Text Draw Status   
      TextDrawBackgroundColor(KMShow[playerid], 255);   
      TextDrawLetterSize(KMShow[playerid],0.379999, 0.899999);//размер текста   
      TextDrawFont(KMShow[playerid], 2);//стиль   
      TextDrawColor(KMShow[playerid], 724790015);//цвет текста   
      TextDrawSetOutline(KMShow[playerid], 1);//размер обводки   
      TextDrawSetProportional(KMShow[playerid],1);   
         
      FuelShow[playerid] = TextDrawCreate(445.000000, 399.000000, "_");//сам Text Draw fuel   
      TextDrawBackgroundColor(FuelShow[playerid], 255);//обводка текста   
      TextDrawLetterSize(FuelShow[playerid],0.500000, 1.000000);//размер текста   
      TextDrawFont(FuelShow[playerid], 0);//стиль   
      TextDrawColor(FuelShow[playerid], -1165802241);//цвет текста   
      TextDrawSetOutline(FuelShow[playerid], 1);//размер обводки   
      TextDrawSetProportional(FuelShow[playerid],1);   
         
      Fill[playerid] = TextDrawCreate(487.000000, 396.000000, "_");   
      TextDrawBackgroundColor(Fill[playerid], 255);   
      TextDrawFont(Fill[playerid], 2);   
      TextDrawLetterSize(Fill[playerid], 0.310000, 1.500000);   
      TextDrawColor(Fill[playerid], -1677721345);   
      TextDrawSetOutline(Fill[playerid], 1);   
      TextDrawSetProportional(Fill[playerid], 1);    


[moder]ищите[/moder]

Code
TextDrawHideForPlayer(playerid,Box);   
      TextDrawHideForPlayer(playerid,Speed);   
      TextDrawHideForPlayer(playerid,SpeedShow[playerid]);   
      TextDrawHideForPlayer(playerid,Fuel);   
      TextDrawHideForPlayer(playerid,FuelShow[playerid]);   
      TextDrawHideForPlayer(playerid,Status);   
      TextDrawHideForPlayer(playerid,StatusShow[playerid]);   
      TextDrawHideForPlayer(playerid,KMShow[playerid]);    


[moder]и заменяете на:[/moder]

Code
 TextDrawHideForPlayer(playerid,Box);   
      TextDrawHideForPlayer(playerid,Speed);   
      TextDrawHideForPlayer(playerid,SpeedShow[playerid]);   
      TextDrawHideForPlayer(playerid,Fuel);   
      TextDrawHideForPlayer(playerid,FuelShow[playerid]);   
      TextDrawHideForPlayer(playerid,Status);   
      TextDrawHideForPlayer(playerid,StatusShow[playerid]);   
      TextDrawHideForPlayer(playerid,KMShow[playerid]);   
      TextDrawHideForPlayer(playerid,Fill[playerid]);


[moder]так же ищите[/moder]

Code
TextDrawDestroy(SpeedShow[playerid]);   
      TextDrawDestroy(FuelShow[playerid]);   
      TextDrawDestroy(StatusShow[playerid]);   
      TextDrawDestroy(KMShow[playerid]);    


[moder]и заменяете на:[/moder]

Code
TextDrawDestroy(SpeedShow[playerid]);   
      TextDrawDestroy(FuelShow[playerid]);   
      TextDrawDestroy(StatusShow[playerid]);   
      TextDrawDestroy(KMShow[playerid]);   
      TextDrawDestroy(Fill[playerid]);    


[admin]теперь ищите все что связоно с:[/admin]

Code
TextDrawHideForPlayer(playerid,Box);   
          TextDrawHideForPlayer(playerid,Speed);   
          TextDrawHideForPlayer(playerid,SpeedShow[playerid]);   
          TextDrawHideForPlayer(playerid,Fuel);   
          TextDrawHideForPlayer(playerid,FuelShow[playerid]);   
          TextDrawHideForPlayer(playerid,Status);   
          TextDrawHideForPlayer(playerid,StatusShow[playerid]);   
          TextDrawHideForPlayer(playerid,KMShow[playerid]);    


[moder]и заменяете на:[/moder]

Code
   TextDrawHideForPlayer(playerid,Box);   
          TextDrawHideForPlayer(playerid,Speed);   
          TextDrawHideForPlayer(playerid,SpeedShow[playerid]);   
          TextDrawHideForPlayer(playerid,Fuel);   
          TextDrawHideForPlayer(playerid,FuelShow[playerid]);   
          TextDrawHideForPlayer(playerid,Status);   
          TextDrawHideForPlayer(playerid,StatusShow[playerid]);   
          TextDrawHideForPlayer(playerid,KMShow[playerid]);   
          TextDrawHideForPlayer(playerid,Fill[playerid]);    


[moder]теперь ищите:[/moder]

Code
TextDrawShowForPlayer(playerid,Box);   
                  TextDrawShowForPlayer(playerid,Speed);   
                  TextDrawShowForPlayer(playerid,SpeedShow[playerid]);   
                  TextDrawShowForPlayer(playerid,Fuel);   
                  TextDrawShowForPlayer(playerid,FuelShow[playerid]);   
                  TextDrawShowForPlayer(playerid,Status);   
                  TextDrawShowForPlayer(playerid,StatusShow[playerid]);   
                  TextDrawShowForPlayer(playerid,KMShow[playerid]);    


[moder]и заменяете на:[/moder]

Code
TextDrawShowForPlayer(playerid,Box);   
                  TextDrawShowForPlayer(playerid,Speed);   
                  TextDrawShowForPlayer(playerid,SpeedShow[playerid]);   
                  TextDrawShowForPlayer(playerid,Fuel);   
                  TextDrawShowForPlayer(playerid,FuelShow[playerid]);   
                  TextDrawShowForPlayer(playerid,Status);   
                  TextDrawShowForPlayer(playerid,StatusShow[playerid]);   
                  TextDrawShowForPlayer(playerid,KMShow[playerid]);   
                  TextDrawShowForPlayer(playerid,Fill[playerid]);    


[moder]и внизу под этим должно быть:[/moder]

Code
    else if(newstate == PLAYER_STATE_ONFOOT)//выходит скрываем   
      {   
          TextDrawHideForPlayer(playerid,Box);   
          TextDrawHideForPlayer(playerid,Speed);   
          TextDrawHideForPlayer(playerid,SpeedShow[playerid]);   
          TextDrawHideForPlayer(playerid,Fuel);   
          TextDrawHideForPlayer(playerid,FuelShow[playerid]);   
          TextDrawHideForPlayer(playerid,Status);   
          TextDrawHideForPlayer(playerid,StatusShow[playerid]);   
          TextDrawHideForPlayer(playerid,KMShow[playerid]);   
      }    


[moder]замените на:[/moder]

Code
else if(newstate == PLAYER_STATE_ONFOOT)//выходит скрываем   
      {   
          TextDrawHideForPlayer(playerid,Box);   
          TextDrawHideForPlayer(playerid,Speed);   
          TextDrawHideForPlayer(playerid,SpeedShow[playerid]);   
          TextDrawHideForPlayer(playerid,Fuel);   
          TextDrawHideForPlayer(playerid,FuelShow[playerid]);   
          TextDrawHideForPlayer(playerid,Status);   
          TextDrawHideForPlayer(playerid,StatusShow[playerid]);   
          TextDrawHideForPlayer(playerid,KMShow[playerid]);   
          TextDrawHideForPlayer(playerid,Fill[playerid]);   
      }    


[moder]теперь идем в паблик UpdateSpeedometr(playerid):
и заменяем его на:[/moder]

Code
public UpdateSpeedometr(playerid)//обновляем каждую секунду наш текстдрав   
{   
      if(IsPlayerInAnyVehicle(playerid))   
      {   
          new vehicleid;   
          vehicleid = GetPlayerVehicleID(playerid);   
          new locked[32];   
          new maxx[15];   
          if(Max[playerid] == 1) { maxx = "~b~Min"; } else { maxx = "~R~Max"; }   
          if(IsLocked[GetPlayerVehicleID(playerid)] == 1)   
          {   
          locked = "~r~~h~Lock";   
             }   
             else   
             {   
            locked = "~g~~h~Unlock";   
          }   
          format(str4, sizeof(str4), "FUEL");   
          format(str1, sizeof(str2),"%d",SpeedVehicle(playerid));   
          if(Fuell[vehicleid] <= 45)  format(str2, sizeof(str2),"~r~%.0f",Fuell[vehicleid]);   
          else if(Fuell[vehicleid] <= 100)  format(str2, sizeof(str2),"~y~%.0f",Fuell[vehicleid]);   
          else if(Fuell[vehicleid] <= 300)  format(str2, sizeof(str2),"~g~%.0f",Fuell[vehicleid]);   
          format(str5, sizeof(str5), "%s",locked);   
          format(str3, sizeof(str3), "KM/H");   
          if(PlayerInfo[playerid][pAdmin] == 0)   
          if(SpeedVehicle(playerid) >= 150)   
          {   
              SendClientMessage(playerid, COLOR_LIGHTRED, "Вы были кикнуты по подозрению в читерстве. (Код ошибки: 2888)");   
              SendClientMessage(playerid, COLOR_LIGHTRED, "Удалите чит программу, чтобы продолжить игру на сервере");   
              Kick(playerid);   
          }   
          if(SpeedVehicle(playerid) !=0)   
          {   
              Fuell[vehicleid] -= 0.003;   
              if(GetPlayerVehicleID(playerid) == caridhouse[playerid])   
              {   
                  PlayerInfo[playerid][pFuelcar] -= 0.003;   
              }   
          }   
          new carid = GetPlayerVehicleID(playerid);   
          if(SuperGt(carid))   
          {   
              if(SpeedVehicle(playerid) !=0)   
              {   
                  Fuell[vehicleid] -= 0.005;   
                  if(GetPlayerVehicleID(playerid) == caridhouse[playerid])   
                  {   
                      PlayerInfo[playerid][pFuelcar] -=0.005;   
                  }   
              }   
          }   
          TextDrawSetString(SpeedShow[playerid],str1);   
          TextDrawSetString(FuelShow[playerid],str2);   
          TextDrawSetString(StatusShow[playerid],str5);   
          TextDrawSetString(KMShow[playerid],str3);   
          TextDrawSetString(Fill[playerid],str4);   
      }   
}    


[moder]так же ищите бокс спидометра примерно должен выгледить так:[/moder]

Code
Box = TextDrawCreate(533.000000, 393.000000, "____");   
      TextDrawBackgroundColor(Box, 255);   
      TextDrawFont(Box, 1);   
      TextDrawLetterSize(Box, 1.309998, 4.499999);   
      TextDrawColor(Box, -1);   
      TextDrawSetOutline(Box, 0);   
      TextDrawSetProportional(Box, 1);   
      TextDrawSetShadow(Box, 1);   
      TextDrawUseBox(Box, 1);   
      TextDrawBoxColor(Box, COLOR_BOX);   
      TextDrawTextSize(Box, 348.000000, 27.000000);    


[moder]и замените его на:[/moder]

Code
Box = TextDrawCreate(533.000000, 393.000000, "____");   
      TextDrawBackgroundColor(Box, 255);   
      TextDrawFont(Box, 1);   
      TextDrawLetterSize(Box, 1.309998, 4.499999);   
      TextDrawColor(Box, -1);   
      TextDrawSetOutline(Box, 0);   
      TextDrawSetProportional(Box, 1);   
      TextDrawSetShadow(Box, 1);   
      TextDrawUseBox(Box, 1);   
      TextDrawBoxColor(Box, COLOR_BOX);   
      TextDrawTextSize(Box, 348.000000, 27.000000);   
      Speed = TextDrawCreate(533.000000, 393.000000, "____");   
      TextDrawBackgroundColor(Speed, 255);   
      TextDrawFont(Speed, 1);   
      TextDrawLetterSize(Speed, 1.309998, 4.499999);   
      TextDrawColor(Speed, -1);   
      TextDrawSetOutline(Speed, 0);   
      TextDrawSetProportional(Speed, 1);   
      TextDrawSetShadow(Speed, 1);   
      TextDrawUseBox(Speed, 1);   
      TextDrawBoxColor(Speed, COLOR_BOX);   
      TextDrawTextSize(Speed, 348.000000, 27.000000);    


From Russia With Love!
Форум » PAWNO » Уроки Pawno » Делаем Спидометр как на samp-rp (rls) by EblanStyle
  • Страница 1 из 1
  • 1
Поиск: