Помогите с скриптом

Ph.D

Участник
Автор темы
211
11
local sampev = require('lib.samp.events')

function main()
if not isSampfuncsLoaded() or not isSampLoaded() then return end
repeat wait(0) until isSampAvailable()
sampRegisterChatCommand('ss', function() on = not on sampAddChatMessage(on and "activated" or 'deactivated', -1) end)
end

function sampev.onSendVehicleSync(data)
local vx,vy, vz = getCarCoordinates(storeCarCharIsInNoSave(PLAYER_PED))
if on then
if isCharInAnyCar(playerPed) then
data.position(vx-50, vy-50, vz-50)
data.surfingOffsets(1, 1, 1)
else
sampAddChatMessage('Not in cars')
end
end
end

почему выдает ошибку и не работает.
В общем должно показывать что позиция машины на 50 метров позади чем настоящая
 

krim

Известный
299
132
Lua:
local sampev = require('lib.samp.events')

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end
    repeat wait(0) until isSampAvailable()
    sampRegisterChatCommand('ss', function()
            if isCharInAnyCar(PLAYER_PED) then
                on = not on
                sampAddChatMessage(on and 'Active' or 'Deactive', -1)
            end
        end)
    while true do wait(0)
         if on then
               if not isCharInAnyCar(PLAYER_PED) then
                   sampAddChatMessage('Ты вышел, выключаю',-1)
                   on = false
               end
         end
    end
end

function sampev.onSendVehicleSync(data)
    if on then
        local x,y,z = getCarCoordinates(storeCarCharIsInNoSave(PLAYER_PED))
        data.position = {x-50,y-50,z-50}
    end
end
 
Последнее редактирование:

Sidney31

Известный
1,115
385
data.position(vx-50, vy-50, vz-50)
Ты её ставишь на -50 метров, относительно каждой координаты. Имеешь представление о трёхмерном пространстве хоть?
1653155094715.png

В общем должно показывать что позиция машины на 50 метров позади чем настоящая