__NEW__ |
Дата: Пятница, 29.07.2016, 00:28 | Сообщение # 1
|
Боец
Сообщений: 57
Статус: Offline
|
Для начала ко всем new Код new Text:SpeedForServer[3]; new PlayerText:SpeedForPlayer[MAX_PLAYERS][3]; Далее в OnGameModeInit Код SpeedForServer[0] = TextDrawCreate(345.000, 381.000, "_"); TextDrawLetterSize(SpeedForServer[0], 0.500, 4.600); TextDrawTextSize(SpeedForServer[0], 513.000, 104.000); TextDrawColor(SpeedForServer[0], 0); TextDrawUseBox(SpeedForServer[0], 1); TextDrawBoxColor(SpeedForServer[0], 0x00000066); TextDrawSetShadow(SpeedForServer[0], 1); TextDrawSetOutline(SpeedForServer[0], 1); TextDrawBackgroundColor(SpeedForServer[0], 0); TextDrawFont(SpeedForServer[0], 3); TextDrawSetProportional(SpeedForServer[0], 1); SpeedForServer[1] = TextDrawCreate(390.000, 396.000, "KM/H"); TextDrawLetterSize(SpeedForServer[1], 0.300, 1.100); TextDrawColor(SpeedForServer[1], 0x0C354EAA); TextDrawUseBox(SpeedForServer[1], 0); TextDrawBoxColor(SpeedForServer[1], 0x80808080); TextDrawSetShadow(SpeedForServer[1], 1); TextDrawSetOutline(SpeedForServer[1], 1); TextDrawBackgroundColor(SpeedForServer[1], 0x00000066); TextDrawFont(SpeedForServer[1], 2); TextDrawSetProportional(SpeedForServer[1], 1); SpeedForServer[2] = TextDrawCreate(475.000, 389.000, "FUEL"); TextDrawLetterSize(SpeedForServer[2], 0.300, 1.100); TextDrawColor(SpeedForServer[2], 0x7F0000AA); TextDrawUseBox(SpeedForServer[1], 0); TextDrawBoxColor(SpeedForServer[1], 0x80808080); TextDrawSetShadow(SpeedForServer[2], 1); TextDrawSetOutline(SpeedForServer[2], 1); TextDrawBackgroundColor(SpeedForServer[2], 0x00000066); TextDrawFont(SpeedForServer[2], 2); TextDrawSetProportional(SpeedForServer[2], 1); Далее в OnPlayerConnect Код SpeedForPlayer[playerid][0] = CreatePlayerTextDraw(playerid, 358.000, 395.000, "_"); PlayerTextDrawLetterSize(playerid, SpeedForPlayer[playerid][0], 0.600, 1.400); PlayerTextDrawAlignment(playerid, SpeedForPlayer[playerid][0], 0); PlayerTextDrawColor(playerid, SpeedForPlayer[playerid][0], 0x0D689FAA); PlayerTextDrawUseBox(playerid, SpeedForPlayer[playerid][0], 0); PlayerTextDrawBoxColor(playerid, SpeedForPlayer[playerid][0], 0x80808080); PlayerTextDrawSetShadow(playerid, SpeedForPlayer[playerid][0], 1); PlayerTextDrawSetOutline(playerid, SpeedForPlayer[playerid][0], 1); PlayerTextDrawBackgroundColor(playerid, SpeedForPlayer[playerid][0], 0x00000066); PlayerTextDrawFont(playerid, SpeedForPlayer[playerid][0], 0); PlayerTextDrawSetProportional(playerid, SpeedForPlayer[playerid][0], 1); SpeedForPlayer[playerid][1] = CreatePlayerTextDraw(playerid, 441.000, 391.000, "~y~50"); PlayerTextDrawLetterSize(playerid, SpeedForPlayer[playerid][1], 0.600, 0.800); PlayerTextDrawAlignment(playerid, SpeedForPlayer[playerid][1], 0); PlayerTextDrawColor(playerid, SpeedForPlayer[playerid][1], 0x0D689FAA); PlayerTextDrawUseBox(playerid, SpeedForPlayer[playerid][1], 0); PlayerTextDrawBoxColor(playerid, SpeedForPlayer[playerid][1], 0x80808080); PlayerTextDrawSetShadow(playerid, SpeedForPlayer[playerid][1], 1); PlayerTextDrawSetOutline(playerid, SpeedForPlayer[playerid][1], 1); PlayerTextDrawBackgroundColor(playerid, SpeedForPlayer[playerid][1], 0x00000066); PlayerTextDrawFont(playerid, SpeedForPlayer[playerid][1], 0); PlayerTextDrawSetProportional(playerid, SpeedForPlayer[playerid][1], 1);
SpeedForPlayer[playerid][2] = CreatePlayerTextDraw(playerid, 450.000, 404.000, "Unlock"); PlayerTextDrawLetterSize(playerid, SpeedForPlayer[playerid][2], 0.500, 1.000); PlayerTextDrawAlignment(playerid, SpeedForPlayer[playerid][2], 0); PlayerTextDrawColor(playerid, SpeedForPlayer[playerid][2], 0x00D900AA); PlayerTextDrawUseBox(playerid, SpeedForPlayer[playerid][2], 0); PlayerTextDrawBoxColor(playerid, SpeedForPlayer[playerid][2], 0x80808080); PlayerTextDrawSetShadow(playerid, SpeedForPlayer[playerid][2], 1); PlayerTextDrawSetOutline(playerid, SpeedForPlayer[playerid][2], 1); PlayerTextDrawBackgroundColor(playerid, SpeedForPlayer[playerid][2], 0x00000066); PlayerTextDrawFont(playerid, SpeedForPlayer[playerid][2], 1); PlayerTextDrawSetProportional(playerid, SpeedForPlayer[playerid][2], 1); Далее если у вас нету stock для проверки скорости автомобиля то ко всем stock Создадим таймер... В OnGameModeInit Код SetTimer("SpeedTimer", 100, true); Ко всем пабликам Код forward SpeedTimer(); public SpeedTimer() { foreach(new i:Player) { if(GetPlayerState(i) == PLAYER_STATE_DRIVER) { new string[5]; format(string, sizeof(string), "%d", SpeedVehicle(i)); PlayerTextDrawSetString(playerid, SpeedForPlayer[playerid][0], string); } } return 1; } А в OnPlayerStateChange Тут нету системы дверей, лимита скорости и бензина. Поэтому берите из других уроков
Сообщение отредактировал __NEW__ - Пятница, 29.07.2016, 21:25 |
|
|
|