Description:
An automated respawn system, that can suit your needs. It can be configured differently for every map. You can add X map which will use lifes (which is the default option), yet you can add map Y and configured it to use timer instead, or add map Z on which players will respawn infinite times. The spawnkiller detector is also configurable and can enabled or disabled for single maps.
Instalation:
You need
[INC] Multi Colors to compile the plugin.
- Compile locally and put ph_autorespawn.smx in ./addons/sourcemod/plugins/
- Restart the map. A config will be automatically generated
Main commands (Requires ADMFLAG_BAN):
- sm_autorespawnmenu (or !autorespawnmenu) - Opens a menu, where you can add or remove a map. (Default: Respawn with 3 lives each round)
Sub commands, when a map has auto-respawn (Requires ADMFLAG_RCON):
- sm_respawntype (or !respawntype) - Use this to configure the type of auto-respawn. (0 - will use timer, 1 - will use lives insted and 2 - will respawn players infinite times).
- sm_respawnlives (or !respawnlives) - Use this to configure the numbers of lifes per round. (If you use lives)
- sm_respawntimer (or !respawntimer) - Use this to configure the timer in which players can respawn. (If you use timer)
- sm_respawnsk (or !respawnsk) - Use this to configure the spawnkill detector. Either enable or disable it. [0 - Off, 1 - On]
Example config:
PHP Code:
"respawnmaps"
{
"mg_escape_castle_v3_fix"
{
"type" "1"
"maxtime" "60"
"lives" "3"
"spawnkiller" "1"
}
"mg_lego_course_3_csgo_v2"
{
"type" "1"
"maxtime" "60"
"lives" "3"
"spawnkiller" "1"
}
"mg_blood_sector_v1"
{
"type" "1"
"maxtime" "60"
"lives" "3"
"spawnkiller" "1"
}
"mg_saw_3_v1"
{
"type" "1"
"maxtime" "60"
"lives" "3"
"spawnkiller" "1"
}
}
Some simple natives:
PHP Code:
/**
* Very useful if you need to spawnkill a player
* if he doesn't need to be respawned from other plugins action.
*
* @param value Sets a spawnkill to a player while autorespawn is ON.
* true - The player is spawnkilled and won't be respawned.
* false - The opposite of true.
*/
native void SpawnKilled(int client, bool value);
/**
* Very useful if you want a plugin to check,
* if autorespawn is enabled.
*
* @param Returns if respawn is enabled.
*/
native bool RespawnOn();
Changelog:
Code:
1.0 - Initial release.
1.1 - Changed how spawnkill check works, fixed a broken timer handle.
1.2 - Main command changed to a menu, sub-commands are still normal commands.
1.3 - Code cleanup, added a check if spawnkiller is enabled.
1.3a - Minor fix.