diff --git a/TruckHUD.lua b/TruckHUD.lua index ba0378b..8238eab 100644 --- a/TruckHUD.lua +++ b/TruckHUD.lua @@ -1,6 +1,6 @@ script_name("TruckHUD") script_author("Serhiy_Rubin") -script_version("30.01.23") +script_version("14.02.2023") local inicfg = require "inicfg" local dlstatus = require("moonloader").download_status @@ -196,7 +196,8 @@ function main() (server:find("02") and "Two" or (server:find("Revo") and "Revolution" or (server:find("Legacy") and "Legacy" or (server:find("Classic") and "Classic" or - (server:find("Zero Two") and "Two" or ""))))) + (server:find("Zero Two") and "Two" or + (server:find("TEST") and "TEST" or "" )))))) if server == "" then thisScript():unload() end @@ -257,6 +258,15 @@ function main() end end +maxload_int = 0 +function maxload() + if maxload_int == 0 then + addChatMessage("Пересядь в фуру чтобы понять сколько груза брать!") + else + sampSendChat("/truck load "..maxload_int) + end +end + function settings_load() wait(0) local x1, y1 = convertGameScreenCoordsToWindowScreenCoords(14.992679595947, 274.75) @@ -498,7 +508,7 @@ function doControl() sampSendChat("/truck mon") end if i == 10 then - sampSendChat("/truck load " .. GetGruz()) + maxload() end if i == 11 then sampSendChat("/truck unload") @@ -555,7 +565,7 @@ function doSendCMD() end if delay.sms == 0 then if delay.load == 1 then - sampSendChat("/truck load " .. GetGruz()) + maxload() delay.load = 2 end if delay.load == 0 then @@ -2239,6 +2249,9 @@ function loadEvents() end function sampev.onServerMessage(color, message) + if string.find(message, "^ Нефть: %d+ / (%d+)$") then + maxload_int = tonumber(string.match(message, "^ Нефть: %d+ / (%d+)$")) + end if message == " У вас бан чата!" then delay.chatMon = 0 delay.chat = 0 @@ -2967,34 +2980,6 @@ function isTruckCar() end end -function GetGruz() - local gruz = 0 - if isCharInModel(PLAYER_PED, 514) then - local Vehicle = storeCarCharIsInNoSave(PLAYER_PED) - local Color1, Color2 = getCarColours(Vehicle) - gruz = 10000 - end - if isCharInModel(PLAYER_PED, 403) then - local Vehicle = storeCarCharIsInNoSave(PLAYER_PED) - local Color1, Color2 = getCarColours(Vehicle) - if Color1 == 36 and Color2 == 36 then - gruz = 30000 - else - gruz = 20000 - end - end - if isCharInModel(PLAYER_PED, 515) then - local Vehicle = storeCarCharIsInNoSave(PLAYER_PED) - local Color1, Color2 = getCarColours(Vehicle) - if Color1 == 34 and Color2 == 36 then - gruz = 50000 - else - gruz = 40000 - end - end - return gruz -end - function ChangeCena(st) if st > 0 then if workload == 1 then diff --git a/changelog b/changelog index d06504e..ddeae73 100644 --- a/changelog +++ b/changelog @@ -18,4 +18,7 @@ Фикс счетчика количества арендованных фур Версия от 30.01.2023 -Фикс вылета скрипта из-за /truck hud \ No newline at end of file +Фикс вылета скрипта из-за /truck hud + +Версия от 14.02.2023 +Теперь макс. количество груза берется из чата во время посадки в фуру \ No newline at end of file diff --git a/version b/version index 722ec02..0e76a79 100644 --- a/version +++ b/version @@ -1 +1 @@ -30.01.23 \ No newline at end of file +14.02.2023 \ No newline at end of file