• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Question] There is a problem with the output of messages to the server console.
#1
Information 
Hello, there is a problem with outputting arrays from include to the server console. I am using visual studio code, windows 10 x64.
The essence is the following, I have an include in which there is a stock to return arrays with a parameter, similar to:



Code:
stock GetNickName(playerid)
{
      new string[MAX_PLAYER_NAME];
      GetPlayerName(playerid, string, MAX_PLAYER_NAME);
      return string;
}


I use windows encoding 1251 on the main script file of the server and on the include, in my code there are functions that, roughly speaking, output messages from the array directly to the server console, this is what happens:

Code:
[2023-01-29T14:40:27+0300] [Info] [
[2023-01-29T14:40:27+0300] [Info] [
[2023-01-29T14:40:27+0300] [Info] Legacy Network started on port 7777


Instead of "[2023-01-29T14:40:27+0300] [Info] [" it should be "[БАЗА ДАННЫХ] reconnect 18 sec...".

I think the essence of the problem is clear, by the way - everything works fine on samp-server.exe, messages are output to the console on windows 1251 without any problems.



Здравствуйте, проблема с выводом массивов из инклуда в консоль сервера. Я пользуюсь visual studio code, windows 10 x64. 
Суть следующая, у меня есть инклуд в котором есть stock для возвращения массивов с параметром, на подобии:

Code:
stock GetNickName(playerid)
{
     new string[MAX_PLAYER_NAME];
     GetPlayerName(playerid, string, MAX_PLAYER_NAME); 
     return string;
}

Я использую кодировку windows 1251 на главном сценарном файле сервера и на инклуде, в моем коде есть функции, которые грубо говоря - выводят сообщения из массива прямо в консоль сервера, вот что получается:
Code:
[2023-01-29T14:40:27+0300] [Info] [
[2023-01-29T14:40:27+0300] [Info] [
[2023-01-29T14:40:27+0300] [Info] Legacy Network started on port 7777

Вместо "[2023-01-29T14:40:27+0300] [Info] [" должно быть "[БАЗА ДАННЫХ] reconnect 18 sec...".

Думаю, суть проблемы ясна, к слову - на samp-server.exe работает все нормально, сообщения в консоль выводятся на windows 1251 без каких либо проблем.
  Reply
#2
The first thing I thought about whas this post: https://github.com/sampctl/pawn-array-return-bug
Returning strings from functions can be problematic, at least when going deeper than a level.

However, I am not sure that is the issue here. Can you test another terminal (not using vscode embedded terminal)?
If that does not work, try to follow the thinking in the link above to test if it could be the case.
  Reply
#3
(2023-01-31, 08:23 AM)denNorske Wrote: The first thing I thought about whas this post: https://github.com/sampctl/pawn-array-return-bug
Returning strings from functions can be problematic, at least when going deeper than a level.

However, I am not sure that is the issue here. Can you test another terminal (not using vscode embedded terminal)?
If that does not work, try to follow the thinking in the link above to test if it could be the case.

it didn't help when I change the encoding to utf-8, everything seems to change, but still with the function that is in the include - some problems
  Reply


Forum Jump: