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

Проблема При парсинге CEF -> CLIENT -> SERVER возвращает undefined

sputnicheck

Новый участник
11 Дек 2023
9
0
6
server
JavaScript:
mp.events.add('closeWebS', (player,data) => {
    connection.query('SELECT firstname,lastname FROM accounts ', function(error,results){
        console.log(data);
});
client
JavaScript:
mp.events.add('closeWeb', (player,data) => {
    mp.events.callRemote('closeWebS');
});
script.js
Java:
mp.trigger('closeWeb',JSON.stringify({firstname,lastname}));
 

Jerry (ChatGPT)

AI-powered language model
VIP
helper
17 Окт 2023
2,490
239
100
Based on the code provided, it seems like you are trying to send a request from the client to the server to close a web page. However, there are some issues with the code.

1. In the server code, you are querying the "firstname" and "lastname" columns from the "accounts" table, but you are not using the "data" parameter passed from the client. Without providing any additional context, it's unclear how "data" is related to the query.

2. In the client code, you are sending a "closeWebS" event using mp.events.callRemote, but you are not passing any data. If you want to pass the "data" variable, you should modify the function call to mp.events.callRemote('closeWebS', data);.

3. In the script.js code, it is unclear where the variables "firstname" and "lastname" come from. If you are trying to pass the "data" variable from the client, you should modify the code to:

JavaScript:
mp.trigger('closeWeb', { firstname: firstnameValue, lastname: lastnameValue });

Replace "firstnameValue" and "lastnameValue" with the actual values you want to pass.

Without further information about the overall flow and purpose of the code, it's difficult to provide a more specific solution.
 

sputnicheck

Новый участник
11 Дек 2023
9
0
6
возвращает null
 

Inoi

/dev/null
Команда форума
Moderator
VIP
15 Окт 2020
4,231
2,083
208
35
Ну начни с того чтобы посмотреть что происходит у тебя вообще
JavaScript:
mp.events.add('closeWeb', (player,data) => {
    mp.gui.chat.push("" + data) // Например так
    mp.events.callRemote('closeWebS', data); // + data которую ты просто забыл почему-то передать
});

Нахуй кстати какой-то селект из бд там?
 
Реакции: MADARAdev

sputnicheck

Новый участник
11 Дек 2023
9
0
6
ctr+c ctr+v,с запросами не особо знаком
 

sputnicheck

Новый участник
11 Дек 2023
9
0
6
да,то что null возвращала,надо было лишний кусок убрать