Ищу луа спавн транспорта ARZ

teddy bear

Активный
Автор темы
295
81
Доброго времени суток, уважаемые! Ищу Lua скрипт "Спавн тачек по клавише/сочетанию клавиш" для ARZ. Знаю есть такое клео у дапо Carfuncs, но хотелось бы на луа. Да и код бы интересно было глянуть, т.к. начинаю изучать луа. Кто может, знает, поделитесь ссылочкой, пожалуйста. Заранее Всем благодарен!
 
Решение
Вырезал из своего скрипта
Lua:
local sampev = require("samp.events")
local vkeys = require("vkeys")
carfixnumber = -1

function main()
   repeat wait(0) until isSampAvailable()
   while true do
      wait(0)
      if isKeyDown(vkeys.VK_MENU) then
         if isKeyJustPressed(vkeys.VK_1) then
              carfixnumber = 1
              sampSendChat("/cars")
         end
         if isKeyJustPressed(vkeys.VK_2) then
              carfixnumber = 2
              sampSendChat("/cars")
         end
         if isKeyJustPressed(vkeys.VK_3) then
              carfixnumber = 3
              sampSendChat("/cars")
         end
         if isKeyJustPressed(vkeys.VK_4) then
              carfixnumber = 4
              sampSendChat("/cars")...

neverlane

t.me/neverlane00
Друг
997
1,132
Вырезал из своего скрипта
Lua:
local sampev = require("samp.events")
local vkeys = require("vkeys")
carfixnumber = -1

function main()
   repeat wait(0) until isSampAvailable()
   while true do
      wait(0)
      if isKeyDown(vkeys.VK_MENU) then
         if isKeyJustPressed(vkeys.VK_1) then
              carfixnumber = 1
              sampSendChat("/cars")
         end
         if isKeyJustPressed(vkeys.VK_2) then
              carfixnumber = 2
              sampSendChat("/cars")
         end
         if isKeyJustPressed(vkeys.VK_3) then
              carfixnumber = 3
              sampSendChat("/cars")
         end
         if isKeyJustPressed(vkeys.VK_4) then
              carfixnumber = 4
              sampSendChat("/cars")
         end
         if isKeyJustPressed(vkeys.VK_5) then
              carfixnumber = 5
              sampSendChat("/cars")
         end
      end
   end
end
function sampev.onShowDialog(dialogId, dialogStyle, dialogTitle, okButtonText, cancelButtonText, dialogText)
    if carfixnumber ~= -1 then
        if dialogId == 162 then
            sampSendDialogResponse(162, 1, carfixnumber - 1, -1)
            return false
        end
        if dialogId == 163 then
            sampSendDialogResponse(163, 1, 9, -1)
            carfixnumber = -1
            return false
        end   
    end
end
 
  • Нравится
Реакции: teddy bear

teddy bear

Активный
Автор темы
295
81
Вырезал из своего скрипта
Lua:
local sampev = require("samp.events")
local vkeys = require("vkeys")
carfixnumber = -1

function main()
   repeat wait(0) until isSampAvailable()
   while true do
      wait(0)
      if isKeyDown(vkeys.VK_MENU) then
         if isKeyJustPressed(vkeys.VK_1) then
              carfixnumber = 1
              sampSendChat("/cars")
         end
         if isKeyJustPressed(vkeys.VK_2) then
              carfixnumber = 2
              sampSendChat("/cars")
         end
         if isKeyJustPressed(vkeys.VK_3) then
              carfixnumber = 3
              sampSendChat("/cars")
         end
         if isKeyJustPressed(vkeys.VK_4) then
              carfixnumber = 4
              sampSendChat("/cars")
         end
         if isKeyJustPressed(vkeys.VK_5) then
              carfixnumber = 5
              sampSendChat("/cars")
         end
      end
   end
end
function sampev.onShowDialog(dialogId, dialogStyle, dialogTitle, okButtonText, cancelButtonText, dialogText)
    if carfixnumber ~= -1 then
        if dialogId == 162 then
            sampSendDialogResponse(162, 1, carfixnumber - 1, -1)
            return false
        end
        if dialogId == 163 then
            sampSendDialogResponse(163, 1, 9, -1)
            carfixnumber = -1
            return false
        end  
    end
end
Спасибо большое! Очень благодарен! Есть над чем подумать xD