someone to help? Car

Fayar

Новичок
Автор темы
2
0
Версия MoonLoader
.027.0-preview
hello, i wanna help with this script.
When i reach first checkpoint (Coordinates) car stoped how i can make to reaching "step by step" coord to coord and repeat all again?


123:
script_name('test')
script_author('headcliff')
script_moonloader(026)

local ScriptState                 = false

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
    sampAddChatMessage('{FB7B1F}[test]{FFFFFF}: Скрипт включен/перезагружен.', -1)
    sampRegisterChatCommand('test', ChangeScriptState)
    while true do
        wait(0)
        if ScriptState then
            taskCarDriveToCoord(PLAYER_PED, -1, 581.9133,-1723.7729,13.2408, 15, 2, null, 4)
            taskCarDriveToCoord(PLAYER_PED, -1, 679.1086,-1745.6455,13.1916, 15, 2, null, 4)
            taskCarDriveToCoord(PLAYER_PED, -1, 741.8875,-1763.4609,13.2531, 15, 2, null, 4)
            taskCarDriveToCoord(PLAYER_PED, -1, 756.3154,-1721.0554,7.7801, 15, 2, null, 4)
        end
    end
end

function ChangeScriptState()
    if isCharSittingInAnyCar(PLAYER_PED) then
        ScriptState = not ScriptState
        if ScriptState then
            sampAddChatMessage('{FB7B1F}[test]{FFFFFF}: Скрипт активирован.', -1)
        else
            sampAddChatMessage('{FB7B1F}[test]{FFFFFF}: Скрипт деактивирован.', -1)
        end
    else
        sampAddChatMessage('{FB7B1F}[test]{FFFFFF}: Сядьте в машину.', -1)
    end
end

what to do ? i searching but i cant find, im not coder i try to learn
 
Последнее редактирование:
Решение
Lua:
script_name('test')
script_author('headcliff')
script_moonloader(026)
sms = sampAddChatMessage
local ScriptState = false
local time = 0
local zx, zy, zz = 63.458324432373, -1525.6649169922, 4.6288232803345 -- post

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
    sampAddChatMessage('{FB7B1F}[test]{FFFFFF}: Скрипт включен/перезагружен.', -1)
    sampRegisterChatCommand('ttt', function() X,Y,Z = getCharCoordinates(PLAYER_PED) print(X..' '..Y..' '..Z) end)
    sampRegisterChatCommand('test', ChangeScriptState)
    while true do wait(0)
        local res = isCharInArea2d(PLAYER_PED, 68.658218383789, 59.4485206604, -1520.5054931641, -1529.5200195313...

qdIbp

Автор темы
Проверенный
1,386
1,141
Lua:
script_name('test')
script_author('headcliff')
script_moonloader(026)
sms = sampAddChatMessage
local ScriptState = false
local time = 0
local zx, zy, zz = 63.458324432373, -1525.6649169922, 4.6288232803345 -- post

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
    sampAddChatMessage('{FB7B1F}[test]{FFFFFF}: Скрипт включен/перезагружен.', -1)
    sampRegisterChatCommand('ttt', function() X,Y,Z = getCharCoordinates(PLAYER_PED) print(X..' '..Y..' '..Z) end)
    sampRegisterChatCommand('test', ChangeScriptState)
    while true do wait(0)
        local res = isCharInArea2d(PLAYER_PED, 68.658218383789, 59.4485206604, -1520.5054931641, -1529.5200195313, false) -- post x1 x2, y1 y2
       
        if ScriptState then
            taskCarDriveToCoord(PLAYER_PED, -1, zx, zy, zz, 15, 0, null, 4)
            if res then
                if time == 0 then time = os.clock() + 5 print(time..'    '..os.clock())end
                if time > os.clock() then
                    setGameKeyState(18,255) wait(50) print('+++++')
                elseif time <= os.clock() then
                    zx, zy, zz =  -34.933017730713, -1590.8715820313, 3.0385892391205 --coast
                end
                   
            end
        end
    end
end

function ChangeScriptState()
    if isCharSittingInAnyCar(PLAYER_PED) then
        ScriptState = not ScriptState
        if ScriptState then
            sampAddChatMessage('{FB7B1F}[test]{FFFFFF}: Скрипт активирован.', -1)
        else
            sampAddChatMessage('{FB7B1F}[test]{FFFFFF}: Скрипт деактивирован.', -1)
            clearCharTasks(PLAYER_PED) taskWarpCharIntoCarAsDriver(PLAYER_PED, storeCarCharIsInNoSave(PLAYER_PED))
        end
    else
        sampAddChatMessage('{FB7B1F}[test]{FFFFFF}: Сядьте в машину.', -1)
    end
end
Only I made for myself
И ты по скрипту вроде русский
 
  • Нравится
Реакции: Pinkic

Pinkic

Участник
32
0
[CODE = lua] script_name ('test')
script_author ('headcliff')
script_moonloader (026)
sms = sampAddChatMessage
local ScriptState = false
local time = 0
local zx, zy, zz = 63.458324432373, -1525.6649169922, 4.6288232803345 - post

function main ()
if not isSampfuncsLoaded () or not isSampLoaded () then return end
while not isSampAvailable () do wait (100) end
sampAddChatMessage ('{FB7B1F} [test] {FFFFFF}: Script enabled / reloaded.', -1)
sampRegisterChatCommand ('ttt', function () X, Y, Z = getCharCoordinates (PLAYER_PED) print (X .. '' ..Y .. '' ..Z) end)
sampRegisterChatCommand ('test', ChangeScriptState)
while true do wait (0)
local res = isCharInArea2d (PLAYER_PED, 68.658218383789, 59.4485206604, -1520.5054931641, -1529.5200195313, false) - post x1 x2, y1 y2

if ScriptState then
taskCarDriveToCoord (PLAYER_PED, -1, zx, zy, zz, 15, 0, null, 4)
if res then
if time == 0 then time = os.clock () + 5 print (time .. '' ..os.clock ()) end
if time> os.clock () then
setGameKeyState (18,255) wait (50) print ('+++++')
elseif time <= os.clock () then
zx, zy, zz = -34.933017730713, -1590.8715820313, 3.0385892391205 --coast
end

end
end
end
end

function ChangeScriptState ()
if isCharSittingInAnyCar (PLAYER_PED) then
ScriptState = not ScriptState
if ScriptState then
sampAddChatMessage ('{FB7B1F} [test] {FFFFFF}: Script activated.', -1)
else
sampAddChatMessage ('{FB7B1F} [test] {FFFFFF}: Script deactivated.', -1)
clearCharTasks (PLAYER_PED) taskWarpCharIntoCarAsDriver (PLAYER_PED, storeCarCharIsInNoSave (PLAYER_PED))
end
else
sampAddChatMessage ('{FB7B1F} [test] {FFFFFF}: Get in the car.', -1)
end
end [/ CODE]
[MEDIA = imgur] ZHxQstH [/ MEDIA] Only I made for myself
And you are in a script like Russian
Very nice and thanks very much.