Raised This Month: $23 Target: $400
 5% 

HL Restore Map API v0.5 [Last Update: 20/06/2020]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rtxa
Member
Join Date: Mar 2018
Location: Argentina
Old 06-11-2020 , 03:21   HL Restore Map API v0.5 [Last Update: 20/06/2020]
Reply With Quote #1

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

PHP Code:
/** 
 * 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.
Attached Files
File Type: zip HL-Restore-Map-0.4.zip (14.6 KB, 14 views)
File Type: zip HL-Restore-Map-0.5.zip (17.4 KB, 4 views)
__________________
Hi, I make plugins for Half-Life, check them down here.
Zombie Mod X | HL Deathrun | AG Mod X
Football N' Guns | MiniVS - A Vampire Slayer Port
HL Player Models API | HL Semiclip | HL Restore Map API
Also check my maps: Enix | xbow_jump | fb_ukfootie2

Last edited by rtxa; 06-21-2020 at 13:05. Reason: Update to v0.5
rtxa is offline
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 06-11-2020 , 10:54   Re: HL Restore Map API v0.3 [Last Update: 11/06/2020]
Reply With Quote #2

Why not post this in new plugin submissions? Would be a better place
__________________

Home of the AMX SUPER
Discord
DruGzOG is offline
Send a message via AIM to DruGzOG
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 06-11-2020 , 18:49   Re: HL Restore Map API v0.3 [Last Update: 11/06/2020]
Reply With Quote #3

Quote:
Originally Posted by DruGzOG View Post
Why not post this in new plugin submissions? Would be a better place
I agree, nice plugin idea btw.
__________________

Last edited by Napoleon_be; 06-11-2020 at 19:12.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
rtxa
Member
Join Date: Mar 2018
Location: Argentina
Old 06-12-2020 , 14:49   Re: HL Restore Map API v0.4 [Last Update: 12/06/2020]
Reply With Quote #4

Updated to version 0.4. Changelog:
- API has been improved, more simple, easy to mantain and safe to use.
- Fixed func_breakable not restoring collision in some cases.
- Added restoring of func_water, trigger_hurt, multisource and env_explosion (lambda_bunker explosive crates).
- Added commands restore_all, restore_ent, restore_by_class and restore_info for debugging. They require immunity flag access.

Quote:
Originally Posted by Napoleon_be View Post
I agree, nice plugin idea btw.
Thanks Napoleon. Not sure, I think it will get lost in the sea of plugins and this is mostly like a module. I have another API too posted here.
__________________
Hi, I make plugins for Half-Life, check them down here.
Zombie Mod X | HL Deathrun | AG Mod X
Football N' Guns | MiniVS - A Vampire Slayer Port
HL Player Models API | HL Semiclip | HL Restore Map API
Also check my maps: Enix | xbow_jump | fb_ukfootie2

Last edited by rtxa; 06-12-2020 at 14:50.
rtxa is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 06-13-2020 , 10:32   Re: HL Restore Map API v0.4 [Last Update: 12/06/2020]
Reply With Quote #5

Quote:
Originally Posted by rtxa View Post
Thanks Napoleon. Not sure, I think it will get lost in the sea of plugins and this is mostly like a module. I have another API too posted here.
The "New plugin submissions" section had a cleanup a few months ago though, maybe you should contact a mod / plugin approver about this. The "Module coding" section could be used too imo.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
rtxa
Member
Join Date: Mar 2018
Location: Argentina
Old 06-20-2020 , 23:12   Re: HL Restore Map API v0.5 [Last Update: 20/06/2020]
Reply With Quote #6

Updated to version 0.5.
# Changelog:
- Added restoring of ambient_generic.
- Added restoring of env_render.
- Added restoring of trigger_multiple.
- Added restoring of light and light_spot.
__________________
Hi, I make plugins for Half-Life, check them down here.
Zombie Mod X | HL Deathrun | AG Mod X
Football N' Guns | MiniVS - A Vampire Slayer Port
HL Player Models API | HL Semiclip | HL Restore Map API
Also check my maps: Enix | xbow_jump | fb_ukfootie2
rtxa is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:43.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode