Half-Life и Adrenaline Gamer форум

Всё об игре в Халф-Лайф и АГ
Текущее время: 28 мар 2024, 17:09

Часовой пояс: UTC + 5 часов [ Летнее время ]




Начать новую тему Ответить на тему  [ Сообщений: 3 ] 
Автор Сообщение
 Заголовок сообщения: HL Restore Map API v0.5 [Last Update: 20/06/2020]
СообщениеДобавлено: 21 июн 2020, 09:39 
Не в сети
Зарегистрирован:
24 апр 2017, 21:16
Последнее посещение:
19 ноя 2023, 09:01
Сообщения: 53
HL Restore Map API

Изображение Изображение Изображение Изображение

☉ Description

With this API you can restore map stuff as they were at the start. It's easy to use and it doesn't require to download any other module.

Now you can use this to restore stuff in maps of some game modes like Deathrun, Zombie Escape, etc.

☰ Natives

Код:
/** 
 * Associates an entity class name with a function that handles restoring.
 */
native hl_restore_register(const classname[], const handler[]);

/**
 * Restores an entity to like it was at the beggining of the map.
 */
native hl_restore_ent(ent);

/**
 * Restores all entities with the provided class name just like they were
 * at the beggining of the map.
 */
native hl_restore_by_class(const classname[]);

/**
 * Restores all entities just like they were at the beggining of the map.
 */
native hl_restore_all();

☰ Available classes for restoring

  • ambient_generic
  • env_explosion
  • env_render
  • func_breakable
  • func_pushable
  • func_door
  • func_door_rotating
  • func_water
  • func_button
  • func_rot_button
  • func_train
  • func_tracktrain
  • func_rotating
  • func_wall_toggle
  • func_healthcharger
  • func_recharge
  • light
  • light_spot
  • multi_manager
  • multisource
  • trigger_auto
  • trigger_once
  • trigger_multiple
  • trigger_push
  • trigger_hurt

☰ Debug Commands

Requires admin with immunity flag to use them.

  • restore_all - Restores all entities.
  • restore_by_class <classname> - Restores all entities by class name.
  • restore_ent <entid> - Restores an entity.
  • restore_info <entid> - Shows useful debug info from an entity.

⛭ Requirements


⚙ Installation

  1. Download the attached files and extract them in your AMX Mod X folder.
  2. Compile all the restore_xxx.sma files and save them in your plugins folder.
  3. In your plugin's code, type #include <restore_map>.

Now you are ready to use the natives of the API.

⛏ To Do

  • ☑ Add restoring of ambient_generic.
  • ☑ Add restoring of trigger_multiple.
  • ☑ Add restoring of env_render.
  • ☑ Add restoring of light and light_spot.
  • ☑ Add restoring of env_render.
  • ☐ Add restoring of env_beam, env_spark and env_laser.
  • ☐ Add restoring of momentary_door, momentary_rot_button and func_pendulum.
  • ☐ Add restoring of cycler_sprite.
  • ☐ Add restoring of items and weapons by using a wildcard. Example: hl_restore_register("weapon_*", "RestoreItem").

☉ Preview



☘ Plugins using this API:


☆ Thanks to:

  • ReGameDLL Team for most of the code they use for restart stuff in CS 1.6, saved me a lot of time.
  • The-822 for figure out how to block ent deleting in some entities (breakables, pushables).
  • KlyPPy for ideas to improve the API. Improved a lot the simplicity and safety of the plugin.
  • HamletEagle for stock to get strings stored in GoldSrc way.

♨ Notes

  • Some entities depends from others to work as expected (e.g., func_train starts only with a trigger_auto). I recommend to restore all to avoid any issues unless you know what you are doing.
  • If you are experiencing any issues, please link the name of the map (with a download link if you don't mind) and the entity you want to restore, so I can find the problem more fast and fix it.

Post made with MD to BB converter.


Вложения:
HL-Restore-Map-0.5.zip [17.4 КБ]
Скачиваний: 338

_________________
Изображение
Zombie Mod X | AG Mod X | HL Player Models API
Contact:
@Discord: rtxa#6795
Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: HL Restore Map API v0.5 [Last Update: 20/06/2020]
СообщениеДобавлено: 08 авг 2020, 03:29 
Не в сети
AIMaster servers
Аватара пользователя
Зарегистрирован:
15 авг 2011, 18:31
Последнее посещение:
11 мар 2024, 00:24
Сообщения: 221
Откуда: Moscow
Actually after rereading 3 times I didn't understand how it could be used…

_________________
Let's make HL great again! ~


Вернуться к началу
 Профиль 
  
 Заголовок сообщения: Re: HL Restore Map API v0.5 [Last Update: 20/06/2020]
СообщениеДобавлено: 11 авг 2020, 07:51 
Не в сети
Зарегистрирован:
24 апр 2017, 21:16
Последнее посещение:
19 ноя 2023, 09:01
Сообщения: 53
Safety1st писал(а):
Actually after rereading 3 times I didn't understand how it could be used…
It's not something that could be used the way it its. It's needs to be integrated to plugin that have round-system. Examples of plugins requiring to restore map to like it was at the beggining are Zombie Escape, Deathrun, etc.

Anyway you can test it using the command restore_all

_________________
Изображение
Zombie Mod X | AG Mod X | HL Player Models API
Contact:
@Discord: rtxa#6795


Вернуться к началу
 Профиль 
  
Показать сообщения за:  Поле сортировки  
Начать новую тему Ответить на тему  [ Сообщений: 3 ] 

Часовой пояс: UTC + 5 часов [ Летнее время ]


Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 12


Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете добавлять вложения

Найти:
Перейти:  
cron
Создано на основе phpBB® Forum Software © phpBB Group
Русская поддержка phpBB