☉ 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
Code: Select all
/**
* 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();ambient_generic
env_explosion
env_render
env_laser
env_beam
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
Last AMXX 1.9 or newer.
⚙ Installation
Download the attached files and extract them in your AMX Mod X folder.
Compile all the restore_xxx.sma files and save them in your plugins folder.
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, env_beam and env_laser.
☑ Add restoring of light and light_spot.
☐ Add restoring of env_spark.
☐ Add restoring of cycler_sprite.
☐ (On Discuss) Add restoring of momentary_door, momentary_rot_button and func_pendulum.
☐ (On Discuss) Add restoring of items and weapons by using a wildcard. Example: hl_restore_register("weapon_*", "RestoreItem").
☉ Preview
https://projectgodmode.com/custom_conte ... owcase.mp4
♨ 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.
