авто ввод команды в авто

godnameless

Участник
Автор темы
39
8
Версия MoonLoader
Другое
помогите плиз с маленьким кодом, чтобы после посадки в ат-99 автоматически прописывалась команда /style
 

sVor

Активный
135
85
Lua:
local ev = require("samp.events")

local inAT99 = false

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    while true do
        wait(0)
       
        if inAT99 and isCharInAnyHeli(PLAYER_PED) then
            local handle = storeCarCharIsInNoSave(PLAYER_PED)
            if getCarModel(handle) == 15964 then
                sampSendChat("/style")
            end
            inAT99 = false
        end
    end
end

function ev.onSendEnterVehicle(carID, isPas)
    if not isPas and not inAT99 then
        inAT99 = true
    end
end
 

godnameless

Участник
Автор темы
39
8
Lua:
local ev = require("samp.events")

local inAT99 = false

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    while true do
        wait(0)
      
        if inAT99 and isCharInAnyHeli(PLAYER_PED) then
            local handle = storeCarCharIsInNoSave(PLAYER_PED)
            if getCarModel(handle) == 15964 then
                sampSendChat("/style")
            end
            inAT99 = false
        end
    end
end

function ev.onSendEnterVehicle(carID, isPas)
    if not isPas and not inAT99 then
        inAT99 = true
    end
end
можешь также немного переписать чтобы только оно активировалось в любом авто? буду очень благодарен
 

sVor

Активный
135
85
можешь также немного переписать чтобы только оно активировалось в любом авто? буду очень благодарен
Lua:
local ev = require("samp.events")

local inCar = false

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    while true do
        wait(0)
     
        if inCar and isCharInAnyCar(PLAYER_PED) then
            sampSendChat("/style")
            inCar = false
        end
    end
end

function ev.onSendEnterVehicle(carID, isPas)
    if not isPas and not inCar then
        inCar = true
    end
end
 
  • Эм
Реакции: sdfy