This is a mobile optimized page that loads fast, if you want to load the real page, click this text.

Проблема Не работает фрагмент CEF

hun1yy

Новый участник
2 Авг 2022
248
3
33
Всем привет, я хочу сделать такси в телефоне, но ничего не работает
client
JavaScript:
mp.events.add('loadTaxiOffers',(list) => {
  if(phone){
    phone.call('loadTaxiOffers',list);
  }
});
server
JavaScript:
let taxiList = [];
mp.events.add('getTaxiOffersList',(player) => {
  player.call('loadTaxiOffers',[taxiList]);
});
cef
JavaScript:
mp.events.add('loadTaxiOffers',(offers) => {
// function loadTaxi(offers){
  let data = JSON.parse(offers);
  document.querySelector("#list").remove();
  document.querySelector("#carButton").style = "display: none";
  document.querySelector("#taxi").style = "display: none";
  let exit = document.createElement('button');
  exit.innerHTML = "Назад";
  exit.setAttribute("onclick",`
  document.querySelector("#selected").remove();
  document.querySelector("#carButton").style = "display: inline";
  workForJob();
  `);
  let c = document.createElement('div');
  c.id = "list";
  data.forEach((item, i) => {
    let off = document.createElement('button');
    off.innerHTML = "Принять";
    off.onclick = function() {acceptTaxi(JSON.stringify(item))};
    c.appendChild(off);
  });
// }
});
 

FireFeed

⚡️Frontend Developer
Команда форума
Moderator
17 Дек 2020
200
66
127
20
Попробуй через execute https://wiki.rage.mp/index.php?title=Browser::execute
 

vpn

Начинающий специалист
29 Май 2022
124
50
85
FIX
JavaScript:
mp.events.add('loadTaxiOffers',(list) => { //object //object //object //object //object
  if(phone){
    phone.call('loadTaxiOffers', JSON.stringify(list));
  }
});
 
Последнее редактирование: