Lua [ARZ] Car Jack

Крипер

Известный
328
177
так он в бесконечный цикл регестрацию команды запихал, из-за этого он постоянно регестрирует уже зарегестрированную команду и выдает ошибку, что такая команда уже есть.
ps:
Пытался объяснить максимально понятно, но поход шляпа вышла)
 
  • Ха-ха
Реакции: LoManuL Corporation

123user_

Участник
Автор темы
36
32
Lua:
-- https://www.blast.hk/threads/159127/

tag = '{FFC000}[Car Jack]: {FFFFFF}'

function main()
    repeat wait(0) until isSampAvailable()
    sampAddChatMessage(tag..'Загружен!', -1)
    sampAddChatMessage(tag..'Команда: {C0FF00}/seat & /pseat [CarID]', -1)
    sampAddChatMessage(tag..'Автор: {C0FF00}123user_', -1)
    sampRegisterChatCommand('seat', seat)
    sampRegisterChatCommand('pseat', pseat)
    while true do wait(0) end
end

function seat(id)
    lua_thread.create(function()
        if tonumber(id) then
            local streamzone, veh = sampGetCarHandleBySampVehicleId(id)
            if streamzone then
                if getCarDoorLockStatus(veh) == 0 then
                    --if not getCarModel(veh) == 481 and 509 and 510 then
                    local cX, cY, cZ = getCarCoordinates(veh)
                    local pX, pY, pZ = getCharCoordinates(PLAYER_PED)
                    if getDistanceBetweenCoords3d(cX, cY, cZ, pX, pY, pZ) < 80 then
                        if isCharInAnyCar(PLAYER_PED) then
                            sampSendExitVehicle(id)
                            local pX, pY, pZ = getCharCoordinates(PLAYER_PED)
                            warpCharFromCarToCoord(PLAYER_PED, pX, pY, pZ - 4)
                            wait(100)
                            sampSendEnterVehicle(id, true)
                            wait(300)
                            local cX, cY, cZ = getCarCoordinates(veh)
                            local pX, pY, pZ = getCharCoordinates(PLAYER_PED)
                            if getDistanceBetweenCoords3d(cX, cY, cZ, pX, pY, pZ) < 80 then
                                freezeCharPosition(PLAYER_PED, true)
                                warpCharIntoCarAsPassenger(PLAYER_PED, veh)
                                restoreCameraJumpcut()
                                wait(100)
                                sampSendExitVehicle(id)
                                local cX, cY, cZ = getCarCoordinates(veh)
                                warpCharFromCarToCoord(PLAYER_PED, cX, cY, cZ - 4)
                                wait(200)
                                sampSendEnterVehicle(id, false)
                                local cX, cY, cZ = getCarCoordinates(veh)
                                warpCharFromCarToCoord(PLAYER_PED, cX, cY, cZ - 4)
                                wait(200)
                                local cX, cY, cZ = getCarCoordinates(veh)
                                warpCharFromCarToCoord(PLAYER_PED, cX, cY, cZ - 4)
                                wait(200)
                                warpCharIntoCar(PLAYER_PED, veh)
                                restoreCameraJumpcut()
                                freezeCharPosition(PLAYER_PED, false)
                                local pX, pY, pZ = getCharCoordinates(PLAYER_PED)
                                setCharCoordinates(PLAYER_PED, pX, pY, pZ - 1)
                                printStyledString('~g~Car Jacked~w~!', 2000, 5)
                                sampAddChatMessage(tag..'Вы успешно сели на место водителя! {C0FF00}[ID: '..id..']', -1)
                            end
                        end
                        if not isCharInAnyCar(PLAYER_PED) then
                            freezeCharPosition(PLAYER_PED, true)
                            sampSendEnterVehicle(id, true)
                            wait(300)
                            local cX, cY, cZ = getCarCoordinates(veh)
                            local pX, pY, pZ = getCharCoordinates(PLAYER_PED)
                            if getDistanceBetweenCoords3d(cX, cY, cZ, pX, pY, pZ) < 80 then
                                warpCharIntoCarAsPassenger(PLAYER_PED, veh)
                                restoreCameraJumpcut()
                                wait(100)
                                sampSendExitVehicle(id)
                                local cX, cY, cZ = getCarCoordinates(veh)
                                warpCharFromCarToCoord(PLAYER_PED, cX, cY, cZ - 4)
                                wait(200)
                                sampSendEnterVehicle(id, false)
                                local cX, cY, cZ = getCarCoordinates(veh)
                                warpCharFromCarToCoord(PLAYER_PED, cX, cY, cZ - 4)
                                wait(200)
                                local cX, cY, cZ = getCarCoordinates(veh)
                                warpCharFromCarToCoord(PLAYER_PED, cX, cY, cZ - 4)
                                wait(200)
                                warpCharIntoCar(PLAYER_PED, veh)
                                restoreCameraJumpcut()
                                freezeCharPosition(PLAYER_PED, false)
                                local pX, pY, pZ = getCharCoordinates(PLAYER_PED)
                                setCharCoordinates(PLAYER_PED, pX, pY, pZ - 1)
                                printStyledString('~g~Car Jacked~w~!', 2000, 5)
                                sampAddChatMessage(tag..'Вы успешно сели на место водителя! {C0FF00}[ID: '..id..']', -1)
                            else
                                freezeCharPosition(PLAYER_PED, false)
                                sampAddChatMessage(tag..'Вы находитесь далеко от авто! {C0FF00}[ID: '..id..']', -1)
                            end
                        end
                    else
                        sampAddChatMessage(tag..'Вы находитесь далеко от авто! {C0FF00}[ID: '..id..']', -1)
                    end
                else
                    sampAddChatMessage(tag..'Авто закрыто! {C0FF00}[ID: '..id..']', -1)
                end
            else
                sampAddChatMessage(tag..'Авто не в зоне стрима! {C0FF00}[ID: '..id..']', -1)
            end
        else
            sampAddChatMessage(tag..'Используйте: {C0FF00}/seat [CarID]', -1)
        end
    end)
end

function pseat(id)
    lua_thread.create(function()
        if tonumber(id) then
            local streamzone, veh = sampGetCarHandleBySampVehicleId(id)
            if streamzone then
                local cX, cY, cZ = getCarCoordinates(veh)
                local pX, pY, pZ = getCharCoordinates(PLAYER_PED)
                if getDistanceBetweenCoords3d(cX, cY, cZ, pX, pY, pZ) < 80 then
                    if isCharInAnyCar(PLAYER_PED) then
                        freezeCharPosition(PLAYER_PED, true)
                        sampSendExitVehicle(id)
                        local pX, pY, pZ = getCharCoordinates(PLAYER_PED)
                        warpCharFromCarToCoord(PLAYER_PED, pX, pY, pZ - 4)
                        wait(100)
                        sampSendEnterVehicle(id, true)
                        wait(200)
                        freezeCharPosition(PLAYER_PED, false)
                        local cX, cY, cZ = getCarCoordinates(veh)
                        local pX, pY, pZ = getCharCoordinates(PLAYER_PED)
                        if getDistanceBetweenCoords3d(cX, cY, cZ, pX, pY, pZ) < 80 then
                            warpCharIntoCarAsPassenger(PLAYER_PED, veh)
                            restoreCameraJumpcut()
                            printStyledString('~g~Car Jacked~w~!', 2000, 5)
                            sampAddChatMessage(tag..'Вы успешно сели на место пассажира! {C0FF00}[ID: '..id..']', -1)
                        else
                            sampAddChatMessage(tag..'Вы находитесь далеко от авто! {C0FF00}[ID: '..id..']', -1)
                        end
                    end
                    if not isCharInAnyCar(PLAYER_PED) then
                        sampSendEnterVehicle(id, true)
                        wait(200)
                        local cX, cY, cZ = getCarCoordinates(veh)
                        local pX, pY, pZ = getCharCoordinates(PLAYER_PED)
                        if getDistanceBetweenCoords3d(cX, cY, cZ, pX, pY, pZ) < 80 then
                            warpCharIntoCarAsPassenger(PLAYER_PED, veh)
                            restoreCameraJumpcut()
                            printStyledString('~g~Car Jacked~w~!', 2000, 5)
                            sampAddChatMessage(tag..'Вы успешно сели на место пассажира! {C0FF00}[ID: '..id..']', -1)
                        else
                            sampAddChatMessage(tag..'Вы находитесь далеко от авто! {C0FF00}[ID: '..id..']', -1)
                        end
                    end
                else
                    sampAddChatMessage(tag..'Вы находитесь далеко от авто! {C0FF00}[ID: '..id..']', -1)
                end
            else
                sampAddChatMessage(tag..'Авто не в зоне стрима! {C0FF00}[ID: '..id..']', -1)
            end
        else
            sampAddChatMessage(tag..'Используйте: {C0FF00}/pseat [CarID]', -1)
        end
    end)
end
 

Крипер

Известный
328
177
Lua:
-- https://www.blast.hk/threads/159127/

tag = '{FFC000}[Car Jack]: {FFFFFF}'

function main()
    repeat wait(0) until isSampAvailable()
    sampAddChatMessage(tag..'Загружен!', -1)
    sampAddChatMessage(tag..'Команда: {C0FF00}/seat & /pseat [CarID]', -1)
    sampAddChatMessage(tag..'Автор: {C0FF00}123user_', -1)
    sampRegisterChatCommand('seat', seat)
    sampRegisterChatCommand('pseat', pseat)
    while true do wait(0) end
end

function seat(id)
    lua_thread.create(function()
        if tonumber(id) then
            local streamzone, veh = sampGetCarHandleBySampVehicleId(id)
            if streamzone then
                if getCarDoorLockStatus(veh) == 0 then
                    --if not getCarModel(veh) == 481 and 509 and 510 then
                    local cX, cY, cZ = getCarCoordinates(veh)
                    local pX, pY, pZ = getCharCoordinates(PLAYER_PED)
                    if getDistanceBetweenCoords3d(cX, cY, cZ, pX, pY, pZ) < 80 then
                        if isCharInAnyCar(PLAYER_PED) then
                            sampSendExitVehicle(id)
                            local pX, pY, pZ = getCharCoordinates(PLAYER_PED)
                            warpCharFromCarToCoord(PLAYER_PED, pX, pY, pZ - 4)
                            wait(100)
                            sampSendEnterVehicle(id, true)
                            wait(300)
                            local cX, cY, cZ = getCarCoordinates(veh)
                            local pX, pY, pZ = getCharCoordinates(PLAYER_PED)
                            if getDistanceBetweenCoords3d(cX, cY, cZ, pX, pY, pZ) < 80 then
                                freezeCharPosition(PLAYER_PED, true)
                                warpCharIntoCarAsPassenger(PLAYER_PED, veh)
                                restoreCameraJumpcut()
                                wait(100)
                                sampSendExitVehicle(id)
                                local cX, cY, cZ = getCarCoordinates(veh)
                                warpCharFromCarToCoord(PLAYER_PED, cX, cY, cZ - 4)
                                wait(200)
                                sampSendEnterVehicle(id, false)
                                local cX, cY, cZ = getCarCoordinates(veh)
                                warpCharFromCarToCoord(PLAYER_PED, cX, cY, cZ - 4)
                                wait(200)
                                local cX, cY, cZ = getCarCoordinates(veh)
                                warpCharFromCarToCoord(PLAYER_PED, cX, cY, cZ - 4)
                                wait(200)
                                warpCharIntoCar(PLAYER_PED, veh)
                                restoreCameraJumpcut()
                                freezeCharPosition(PLAYER_PED, false)
                                local pX, pY, pZ = getCharCoordinates(PLAYER_PED)
                                setCharCoordinates(PLAYER_PED, pX, pY, pZ - 1)
                                printStyledString('~g~Car Jacked~w~!', 2000, 5)
                                sampAddChatMessage(tag..'Вы успешно сели на место водителя! {C0FF00}[ID: '..id..']', -1)
                            end
                        end
                        if not isCharInAnyCar(PLAYER_PED) then
                            freezeCharPosition(PLAYER_PED, true)
                            sampSendEnterVehicle(id, true)
                            wait(300)
                            local cX, cY, cZ = getCarCoordinates(veh)
                            local pX, pY, pZ = getCharCoordinates(PLAYER_PED)
                            if getDistanceBetweenCoords3d(cX, cY, cZ, pX, pY, pZ) < 80 then
                                warpCharIntoCarAsPassenger(PLAYER_PED, veh)
                                restoreCameraJumpcut()
                                wait(100)
                                sampSendExitVehicle(id)
                                local cX, cY, cZ = getCarCoordinates(veh)
                                warpCharFromCarToCoord(PLAYER_PED, cX, cY, cZ - 4)
                                wait(200)
                                sampSendEnterVehicle(id, false)
                                local cX, cY, cZ = getCarCoordinates(veh)
                                warpCharFromCarToCoord(PLAYER_PED, cX, cY, cZ - 4)
                                wait(200)
                                local cX, cY, cZ = getCarCoordinates(veh)
                                warpCharFromCarToCoord(PLAYER_PED, cX, cY, cZ - 4)
                                wait(200)
                                warpCharIntoCar(PLAYER_PED, veh)
                                restoreCameraJumpcut()
                                freezeCharPosition(PLAYER_PED, false)
                                local pX, pY, pZ = getCharCoordinates(PLAYER_PED)
                                setCharCoordinates(PLAYER_PED, pX, pY, pZ - 1)
                                printStyledString('~g~Car Jacked~w~!', 2000, 5)
                                sampAddChatMessage(tag..'Вы успешно сели на место водителя! {C0FF00}[ID: '..id..']', -1)
                            else
                                freezeCharPosition(PLAYER_PED, false)
                                sampAddChatMessage(tag..'Вы находитесь далеко от авто! {C0FF00}[ID: '..id..']', -1)
                            end
                        end
                    else
                        sampAddChatMessage(tag..'Вы находитесь далеко от авто! {C0FF00}[ID: '..id..']', -1)
                    end
                else
                    sampAddChatMessage(tag..'Авто закрыто! {C0FF00}[ID: '..id..']', -1)
                end
            else
                sampAddChatMessage(tag..'Авто не в зоне стрима! {C0FF00}[ID: '..id..']', -1)
            end
        else
            sampAddChatMessage(tag..'Используйте: {C0FF00}/seat [CarID]', -1)
        end
    end)
end

function pseat(id)
    lua_thread.create(function()
        if tonumber(id) then
            local streamzone, veh = sampGetCarHandleBySampVehicleId(id)
            if streamzone then
                local cX, cY, cZ = getCarCoordinates(veh)
                local pX, pY, pZ = getCharCoordinates(PLAYER_PED)
                if getDistanceBetweenCoords3d(cX, cY, cZ, pX, pY, pZ) < 80 then
                    if isCharInAnyCar(PLAYER_PED) then
                        freezeCharPosition(PLAYER_PED, true)
                        sampSendExitVehicle(id)
                        local pX, pY, pZ = getCharCoordinates(PLAYER_PED)
                        warpCharFromCarToCoord(PLAYER_PED, pX, pY, pZ - 4)
                        wait(100)
                        sampSendEnterVehicle(id, true)
                        wait(200)
                        freezeCharPosition(PLAYER_PED, false)
                        local cX, cY, cZ = getCarCoordinates(veh)
                        local pX, pY, pZ = getCharCoordinates(PLAYER_PED)
                        if getDistanceBetweenCoords3d(cX, cY, cZ, pX, pY, pZ) < 80 then
                            warpCharIntoCarAsPassenger(PLAYER_PED, veh)
                            restoreCameraJumpcut()
                            printStyledString('~g~Car Jacked~w~!', 2000, 5)
                            sampAddChatMessage(tag..'Вы успешно сели на место пассажира! {C0FF00}[ID: '..id..']', -1)
                        else
                            sampAddChatMessage(tag..'Вы находитесь далеко от авто! {C0FF00}[ID: '..id..']', -1)
                        end
                    end
                    if not isCharInAnyCar(PLAYER_PED) then
                        sampSendEnterVehicle(id, true)
                        wait(200)
                        local cX, cY, cZ = getCarCoordinates(veh)
                        local pX, pY, pZ = getCharCoordinates(PLAYER_PED)
                        if getDistanceBetweenCoords3d(cX, cY, cZ, pX, pY, pZ) < 80 then
                            warpCharIntoCarAsPassenger(PLAYER_PED, veh)
                            restoreCameraJumpcut()
                            printStyledString('~g~Car Jacked~w~!', 2000, 5)
                            sampAddChatMessage(tag..'Вы успешно сели на место пассажира! {C0FF00}[ID: '..id..']', -1)
                        else
                            sampAddChatMessage(tag..'Вы находитесь далеко от авто! {C0FF00}[ID: '..id..']', -1)
                        end
                    end
                else
                    sampAddChatMessage(tag..'Вы находитесь далеко от авто! {C0FF00}[ID: '..id..']', -1)
                end
            else
                sampAddChatMessage(tag..'Авто не в зоне стрима! {C0FF00}[ID: '..id..']', -1)
            end
        else
            sampAddChatMessage(tag..'Используйте: {C0FF00}/pseat [CarID]', -1)
        end
    end)
end
у тебя файл другой прикреплен
1669849958947.png
 
  • Ха-ха
Реакции: 123user_

leverett

Новичок
4
2
Было бы круто, если б можно было садиться именно в закрытый личный и рабочий транспорт, ибо в основном их закрывают.
Есть вариант такое сделать? Тогда бы цены скрипту не было
 

PanSeek

t.me/dailypanseek
Всефорумный модератор
899
1,745
Было бы круто, если б можно было садиться именно в закрытый личный и рабочий транспорт, ибо в основном их закрывают.
Есть вариант такое сделать? Тогда бы цены скрипту не было
Цены и так нет, он бесплатный.
 
  • Клоун
Реакции: Fott

yukar

Участник
23
7

Это оригинал
 
  • Влюблен
Реакции: 123user_

VRush

https://t.me/vrushscript
Проверенный
2,341
1,088
Запомни, если какой-то код повторяется, его можно сократить
 

GRACHOVE

Известный
542
187
Было бы круто, если б можно было садиться именно в закрытый личный и рабочий транспорт, ибо в основном их закрывают.
Есть вариант такое сделать? Тогда бы цены скрипту не было
в рабочий не получится кикнет даже если ты из автопарка семьи берешь маверик а у тебя нет лицензии на полеты то тебя кикнет