onSendVehicleSync

Rice.

Известный
Автор темы
Модератор
1,753
1,660
Версия MoonLoader
.026-beta
Как можно телепортировать персонажа через данную функцию samp.events?
Код:
Lua:
function sampev.onSendVehicleSync(data)
    if ena then
        if isCharInAnyCar(PLAYER_PED) then
            local carhandle = storeCarCharIsInNoSave(PLAYER_PED)
            local px, py, pz = getCarCoordinates(carhandle)
            data.position.x = px-20
            data.position.y = py+20
            data.position.z = pz-20
        end
    end
end

Желаемый результат:

Lua:
sampRegisterChatCommand('ver', function()
    setCharCoordinates(PLAYER_PED, data.position.x, data.position.y, data.position.z)
    sampAddChatMessage('gotovo', -1)
end)