vehicle syncronization

ELTacoBanido

Новичок
Автор темы
29
1
Версия MoonLoader
.026-beta
Here is the code:


taskEnterCarAsDriver (PLAYER_PED, car, 10000)


So, on the client side iam in the car, but for the server side iam not, so i cant execute vehicle related commands on the server.
so i tryed:


local currentCar = getCarCharIsUsing (PLAYER_PED)
local carid = sampGetVehicleIdByCarHandle (currentCar)
sampForceVehicleSync (carid)

sampSendEnterVehicle (carid, false)


But again, it dindnt sync
 

ELTacoBanido

Новичок
Автор темы
29
1
force vechicle sync after sampSendEnterVehicle
@social enemy @FYP
Nope, dint work too.😫
Код:
function main()
  while true do
    wait(0)
    if isKeyJustPressed(0x4B) then
      local x, y, z = getCharCoordinates(playerPed)
     
      for i, car in ipairs(mad.get_all_vehicles(x, y, z, 30.0, false, false)) do
          if doesVehicleExist(car) then
              local ped = getDriverOfCar(car)
             
              if doesCharExist(ped) then
                  printStringNow("Com motorista", 300)
              else
                  taskEnterCarAsDriver(PLAYER_PED,car,90000)
                  sampSendEnterVehicle(sampGetVehicleIdByCarHandle(car),false)
                  sampForceVehicleSync(sampGetVehicleIdByCarHandle(car))
                 
              end
             
              wait(250)
          end
      end
    end
  end
end
 

FYP

Известный
Администратор
1,758
5,722
@social enemy @FYP
Nope, dint work too.😫
Код:
function main()
  while true do
    wait(0)
    if isKeyJustPressed(0x4B) then
      local x, y, z = getCharCoordinates(playerPed)
   
      for i, car in ipairs(mad.get_all_vehicles(x, y, z, 30.0, false, false)) do
          if doesVehicleExist(car) then
              local ped = getDriverOfCar(car)
           
              if doesCharExist(ped) then
                  printStringNow("Com motorista", 300)
              else
                  taskEnterCarAsDriver(PLAYER_PED,car,90000)
                  sampSendEnterVehicle(sampGetVehicleIdByCarHandle(car),false)
                  sampForceVehicleSync(sampGetVehicleIdByCarHandle(car))
               
              end
           
              wait(250)
          end
      end
    end
  end
end
sampGetVehicleIdByCarHandle returns two values, the second value is id.
 

FYP

Известный
Администратор
1,758
5,722
  • Клоун
  • Нравится
Реакции: Fott и ELTacoBanido