Pycckue-Bnepeg / samp-cef

Client and server plugins for SA:MP to embed CEF.
GNU General Public License v3.0
100 stars 46 forks source link

Какая функция отвечает за то, чтобы видео показывалось для всех игроков одновременно #11

Closed KrasavaX closed 2 years ago

KrasavaX commented 2 years ago

Возьмем в пример кинотеатр, кто-то пишет команду и нужно чтобы проигрывалось для всех. Как это реализовывается? В данный момент только локально. Через цикл видео вообще пропадает и только звук, если подходит к экрану другой игрок. Использую windows server 2019

Rams25 commented 2 years ago

Don't use loop, use DynamicArea (CreateDynamicAreaCircle or other) and OnPlayerEnterDynamicArea/OnPlayerExitDynamicArea, it's better than loop

KrasavaX commented 2 years ago

Не используйте цикл, используйте DynamicArea (CreateDynamicAreaCircle или другой) и OnPlayerEnterDynamicArea/OnPlayerExitDynamicArea, это лучше, чем цикл

Can I use an example? I just don't fully understand. I just started to just study it all. Можно на примере? Просто не до конца не понимаю. Я только начал просто изучать это все.

KrasavaX commented 2 years ago

Не используйте цикл, используйте DynamicArea (CreateDynamicAreaCircle или другой) и OnPlayerEnterDynamicArea/OnPlayerExitDynamicArea, это лучше, чем цикл

And another question is there a plugin .so? Just don't run on hosting.

Rams25 commented 2 years ago

And another question is there a plugin .so? Just don't run on hosting.

https://github.com/ZOTTCE/samp-cef/releases/download/9999/libserver.so (built from Ubuntu 18.04, you have to place this on "plugins" folder)

Не используйте цикл, используйте DynamicArea (CreateDynamicAreaCircle или другой) и OnPlayerEnterDynamicArea/OnPlayerExitDynamicArea, это лучше, чем цикл

Can I use an example? I just don't fully understand. I just started to just study it all. Можно на примере? Просто не до конца не понимаю. Я только начал просто изучать это все.

Yes, for sure :

#include <streamer> // Include streamer
#include <cef> // Include the plugin

new CinemaArea,
    CinemaObject;

public OnGameModeInit()
{
    CinemaArea = CreateDynamicCircle(Float:x, Float:y, 20.0, -1, -1, -1); // Float:x, Float:y = your X & Y coords
    return true;
}

public OnPlayerEnterDynamicArea(playerid, areaid)
{
    if (areaid == CinemaArea)
    {
        CinemaObject = CreatePlayerObject(playerid, 14772, Float:x, Float:y, Float:z, 0.0, 0.0, 0.0); // Create object, change id to your cinema ID
        cef_create_ext_browser(playerid, 1, "CJ_TV_SCREEN", "https://www.youtube.com/embed/Gqa8_5bWzQQ?autoplay=1&controls=0", 7); // Create the browser instance
        cef_append_to_object(playerid, 1, object); // Append CEF browser instance to your object
        cef_set_audio_settings(playerid, 1, 30.0, 20.0); // Set audio settings, 30.0 is max, 20.0 is reference
        return true;
    }
    return true;
}

public OnPlayerLeaveDynamicArea(playerid, areaid)
{
    if (areaid == CinemaArea)
    {
        cef_remove_from_object(playerid, 1, CinemaObject);
        return true;
    }
    return true;
}
KrasavaX commented 2 years ago

И еще один вопрос, есть ли плагин .so? Только не запускайте на хостинге.

https://github.com/ZOTTCE/samp-cef/releases/download/9999/libserver.so (построенная из Ubuntu 18.04, вы должны поместить ее в папку «плагины»)

Не используйте цикл, используйте DynamicArea (CreateDynamicAreaCircle или другой) и OnPlayerEnterDynamicArea/OnPlayerExitDynamicArea, это лучше, чем цикл

Могу ли я использовать пример? Я просто не до конца понимаю. Я просто начал просто изучать все это. Можно на примере? Просто не до конца не понимаю. Я только начал просто изучать это все.

Да, конечно:


new CinemaArea;

public OnGameModeInit()
{
  CinemaArea = CreateDynamicCircle(Float:x, Float:y, 20.0, -1, -1, -1); // Float:x, Float:y = your X & Y coords
  return true;
}

public OnPlayerEnterDynamicArea(playerid, areaid)
{
  if (areaid == CinemaArea)
  {
      new object = CreatePlayerObject(playerid, 14772, Float:x, Float:y, Float:z, 0.0, 0.0, 0.0); // Create object, change id to your cinema ID
      cef_create_ext_browser(playerid, 1, "CJ_TV_SCREEN", "https://www.youtube.com/embed/Gqa8_5bWzQQ?autoplay=1&controls=0", 7); // Create the browser instance
      cef_append_to_object(playerid, 1, object); // Append CEF browser instance to your object
      cef_set_audio_settings(playerid, 1, 30.0, 20.0); // Set audio settings, 30.0 is max, 20.0 is reference
      return true;
  }
  return true;
}```

Don't you need a cef.so?

Rams25 commented 2 years ago

Don't you need a cef.so?

cef.so is for server.cfg (plugins line), you have to include cef only, but you have to download cef.inc (https://github.com/ZOTTCE/samp-cef/blob/master/server/cef.inc)

KrasavaX commented 2 years ago

Вам не нужна cef.so?

cef.so для сервера.cfg (строка плагинов), вы должны включить только cef, но вы должны скачать cef.inc (https://github.com/ZOTTCE/samp-cef/blob/master/server/cef.inc)

Changed the version streamer to 2.9.1, removed the cef.so in the cfg, recompiled the mod with the new version of the streamer. There are no errors in the plugins, but the server does not start, unknown mod.

Вам не нужна cef.so?

cef.so для сервера.cfg (строка плагинов), вы должны включить только cef, но вы должны скачать cef.inc (https://github.com/ZOTTCE/samp-cef/blob/master/server/cef.inc)

added plugin libserver.so to directory

Rams25 commented 2 years ago

Вам не нужна cef.so?

cef.so для сервера.cfg (строка плагинов), вы должны включить только cef, но вы должны скачать cef.inc (https://github.com/ZOTTCE/samp-cef/blob/master/server/cef.inc)

Changed the version streamer to 2.9.1, removed the cef.so in the cfg, recompiled the mod with the new version of the streamer. There are no errors in the plugins, but the server does not start, unknown mod.

Вам не нужна cef.so?

cef.so для сервера.cfg (строка плагинов), вы должны включить только cef, но вы должны скачать cef.inc (https://github.com/ZOTTCE/samp-cef/blob/master/server/cef.inc)

added plugin libserver.so to directory

send ur server.cfg ?

KrasavaX commented 2 years ago

Вам не нужна cef.so?

cef.so для сервера.cfg (строка плагинов), вы должны включить только cef, но вы должны скачать cef.inc (https://github.com/ZOTTCE/samp-cef/blob/master/server/cef.inc)

Changed the version streamer to 2.9.1, removed the cef.so in the cfg, recompiled the mod with the new version of the streamer. There are no errors in the plugins, but the server does not start, unknown mod.

Вам не нужна cef.so?

cef.so для сервера.cfg (строка плагинов), вы должны включить только cef, но вы должны скачать cef.inc (https://github.com/ZOTTCE/samp-cef/blob/master/server/cef.inc)

added plugin libserver.so to directory

send ur server.cfg ?

Do you have Yandex available in your country? I'll put the logs there, I don't know how to add it here.

Rams25 commented 2 years ago

Вам не нужна cef.so?

cef.so для сервера.cfg (строка плагинов), вы должны включить только cef, но вы должны скачать cef.inc (https://github.com/ZOTTCE/samp-cef/blob/master/server/cef.inc)

Changed the version streamer to 2.9.1, removed the cef.so in the cfg, recompiled the mod with the new version of the streamer. There are no errors in the plugins, but the server does not start, unknown mod.

Вам не нужна cef.so?

cef.so для сервера.cfg (строка плагинов), вы должны включить только cef, но вы должны скачать cef.inc (https://github.com/ZOTTCE/samp-cef/blob/master/server/cef.inc)

added plugin libserver.so to directory

send ur server.cfg ?

Do you have Yandex available in your country? I'll put the logs there, I don't know how to add it here.

yes I have ;) in France

KrasavaX commented 2 years ago

Вам не нужна cef.so?

cef.so для сервера.cfg (строка плагинов), вы должны включить только cef, но вы должны скачать cef.inc (https://github.com/ZOTTCE/samp-cef/blob/master/server/cef.inc)

Changed the version streamer to 2.9.1, removed the cef.so in the cfg, recompiled the mod with the new version of the streamer. There are no errors in the plugins, but the server does not start, unknown mod.

Вам не нужна cef.so?

cef.so для сервера.cfg (строка плагинов), вы должны включить только cef, но вы должны скачать cef.inc (https://github.com/ZOTTCE/samp-cef/blob/master/server/cef.inc)

added plugin libserver.so to directory

send ur server.cfg ?

Do you have Yandex available in your country? I'll put the logs there, I don't know how to add it here.

yes I have ;) in France

https://disk.yandex.ru/d/Epf-Iy9Snp0w1w

My hosting says that the version of the hosting plugin is needed for CentOS 7

KrasavaX commented 2 years ago

image

Вам не нужна cef.so?

cef.so для сервера.cfg (строка плагинов), вы должны включить только cef, но вы должны скачать cef.inc (https://github.com/ZOTTCE/samp-cef/blob/master/server/cef.inc)

Changed the version streamer to 2.9.1, removed the cef.so in the cfg, recompiled the mod with the new version of the streamer. There are no errors in the plugins, but the server does not start, unknown mod.

Вам не нужна cef.so?

cef.so для сервера.cfg (строка плагинов), вы должны включить только cef, но вы должны скачать cef.inc (https://github.com/ZOTTCE/samp-cef/blob/master/server/cef.inc)

added plugin libserver.so to directory

send ur server.cfg ?

Do you have Yandex available in your country? I'll put the logs there, I don't know how to add it here.

yes I have ;) in France

Rams25 commented 2 years ago

Вам не нужна cef.so?

cef.so для сервера.cfg (строка плагинов), вы должны включить только cef, но вы должны скачать cef.inc (https://github.com/ZOTTCE/samp-cef/blob/master/server/cef.inc)

Changed the version streamer to 2.9.1, removed the cef.so in the cfg, recompiled the mod with the new version of the streamer. There are no errors in the plugins, but the server does not start, unknown mod.

Вам не нужна cef.so?

cef.so для сервера.cfg (строка плагинов), вы должны включить только cef, но вы должны скачать cef.inc (https://github.com/ZOTTCE/samp-cef/blob/master/server/cef.inc)

added plugin libserver.so to directory

send ur server.cfg ?

Do you have Yandex available in your country? I'll put the logs there, I don't know how to add it here.

yes I have ;) in France

https://disk.yandex.ru/d/Epf-Iy9Snp0w1w

My hosting says that the version of the hosting plugin is needed for CentOS 7

I let plugin's author help you, I can't build plugin from centos 7 :/

Rams25 commented 2 years ago

Вам не нужна cef.so?

cef.so для сервера.cfg (строка плагинов), вы должны включить только cef, но вы должны скачать cef.inc (https://github.com/ZOTTCE/samp-cef/blob/master/server/cef.inc)

Changed the version streamer to 2.9.1, removed the cef.so in the cfg, recompiled the mod with the new version of the streamer. There are no errors in the plugins, but the server does not start, unknown mod.

Вам не нужна cef.so?

cef.so для сервера.cfg (строка плагинов), вы должны включить только cef, но вы должны скачать cef.inc (https://github.com/ZOTTCE/samp-cef/blob/master/server/cef.inc)

added plugin libserver.so to directory

send ur server.cfg ?

Do you have Yandex available in your country? I'll put the logs there, I don't know how to add it here.

yes I have ;) in France

https://disk.yandex.ru/d/Epf-Iy9Snp0w1w

My hosting says that the version of the hosting plugin is needed for CentOS 7

Oh ok, you have to edit plugins line to

plugins pawncmd.so streamer.so fmt.so libserver.so

KrasavaX commented 2 years ago

https://drive.google.com/file/d/1CJWkF3yM-IdoFe1m-8SUrwdM8Zn0dP4J/view?usp=sharing

What's wrong? The picture does not appear. I did everything according to the model.

Вам не нужна cef.so?

cef.so для сервера.cfg (строка плагинов), вы должны включить только cef, но вы должны скачать cef.inc (https://github.com/ZOTTCE/samp-cef/blob/master/server/cef.inc)

Изменена версия стримера на 2.9.1, убрана cef.so в cfg, перекомпилирован мод с новой версией стримера. Ошибок в плагинах нет, но сервер не запускается, неизвестный мод.

Вам не нужна cef.so?

cef.so для сервера.cfg (строка плагинов), вы должны включить только cef, но вы должны скачать cef.inc (https://github.com/ZOTTCE/samp-cef/blob/master/server/cef.inc)

добавлен плагин libserver.so в каталог

отправить ваш сервер.cfg ?

Есть ли у вас Яндекс, доступный в вашей стране? Я поставлю туда журналы, я не знаю, как добавить их сюда.

Да, у меня есть ;) во Франции

https://disk.yandex.ru/d/Epf-Iy9Snp0w1w Мой хостинг говорит, что версия плагина хостинга нужна для CentOS 7

О, хорошо, вы должны отредактировать строку плагинов, чтобы

плагины pawncmd.so streamer.so fmt.so libserver.so

https://drive.google.com/file/d/1CJWkF3yM-IdoFe1m-8SUrwdM8Zn0dP4J/view?usp=sharing What's wrong? The picture does not appear. I did everything according to the model.

KrasavaX commented 2 years ago

Вам не нужна cef.so?

cef.so для сервера.cfg (строка плагинов), вы должны включить только cef, но вы должны скачать cef.inc (https://github.com/ZOTTCE/samp-cef/blob/master/server/cef.inc)

Changed the version streamer to 2.9.1, removed the cef.so in the cfg, recompiled the mod with the new version of the streamer. There are no errors in the plugins, but the server does not start, unknown mod.

Вам не нужна cef.so?

cef.so для сервера.cfg (строка плагинов), вы должны включить только cef, но вы должны скачать cef.inc (https://github.com/ZOTTCE/samp-cef/blob/master/server/cef.inc)

added plugin libserver.so to directory

send ur server.cfg ?

Do you have Yandex available in your country? I'll put the logs there, I don't know how to add it here.

yes I have ;) in France

https://disk.yandex.ru/d/Epf-Iy9Snp0w1w My hosting says that the version of the hosting plugin is needed for CentOS 7

Oh ok, you have to edit plugins line to

plugins pawncmd.so streamer.so fmt.so libserver.so

I'm sorry for not understanding

KrasavaX commented 2 years ago

Вам не нужна cef.so?

cef.so для сервера.cfg (строка плагинов), вы должны включить только cef, но вы должны скачать cef.inc (https://github.com/ZOTTCE/samp-cef/blob/master/server/cef.inc)

Changed the version streamer to 2.9.1, removed the cef.so in the cfg, recompiled the mod with the new version of the streamer. There are no errors in the plugins, but the server does not start, unknown mod.

Вам не нужна cef.so?

cef.so для сервера.cfg (строка плагинов), вы должны включить только cef, но вы должны скачать cef.inc (https://github.com/ZOTTCE/samp-cef/blob/master/server/cef.inc)

added plugin libserver.so to directory

send ur server.cfg ?

Do you have Yandex available in your country? I'll put the logs there, I don't know how to add it here.

yes I have ;) in France

https://disk.yandex.ru/d/Epf-Iy9Snp0w1w

My hosting says that the version of the hosting plugin is needed for CentOS 7

Oh ok, you have to edit plugins line to

plugins pawncmd.so streamer.so fmt.so libserver.so

Please help me build a working script.

KrasavaX commented 2 years ago

Вам не нужна cef.so?

cef.so для сервера.cfg (строка плагинов), вы должны включить только cef, но вы должны скачать cef.inc (https://github.com/ZOTTCE/samp-cef/blob/master/server/cef.inc)

Changed the version streamer to 2.9.1, removed the cef.so in the cfg, recompiled the mod with the new version of the streamer. There are no errors in the plugins, but the server does not start, unknown mod.

Вам не нужна cef.so?

cef.so для сервера.cfg (строка плагинов), вы должны включить только cef, но вы должны скачать cef.inc (https://github.com/ZOTTCE/samp-cef/blob/master/server/cef.inc)

added plugin libserver.so to directory

send ur server.cfg ?

Do you have Yandex available in your country? I'll put the logs there, I don't know how to add it here.

yes I have ;) in France

https://disk.yandex.ru/d/Epf-Iy9Snp0w1w My hosting says that the version of the hosting plugin is needed for CentOS 7

Oh ok, you have to edit plugins line to

plugins pawncmd.so streamer.so fmt.so libserver.so

Hi friend, everything works well. Only the video is not played for two or more players in the radius. What to do?