Can convert this for ZP4.3 ?
Code:
#include <amxmodx>
#include <zombie_plague_advance>
#define PLUGIN "ZP: AutoRespawn"
#define VERSION "1.0.0"
#define AUTHOR "yokomo"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event( "TeamInfo", "join_team", "a")
}
public join_team()
{
new id = read_data(1)
static user_team[32]
read_data(2, user_team, 31)
if(!is_user_connected(id))
return 0;
switch(user_team[0])
{
case 'C':
{
if(!is_user_alive(id))
{
remove_task(id)
set_task(15.0,"SpawnPlayer",id);
}
}
case 'T':
{
if(!is_user_alive(id))
{
remove_task(id)
set_task(15.0,"SpawnPlayer",id);
}
}
case 'S':
{
// No need to spawn player when he/she spectating
client_print(id, print_chat, "[ZP] You cannot respawn when in Spectator")
}
}
return 0;
}
public SpawnPlayer(id)
{
if(is_user_alive(id) || zp_is_assassin_round() || zp_is_sniper_round()) return
if ((zp_is_survivor_round() || zp_is_lnj_round() || zp_is_plague_round() || zp_is_swarm_round()) && (zp_get_human_count() > 1 || zp_get_zombie_count() > 1))
{
// Spawn player as zombi on survivor, LNJ, plague, swarm round
zp_respawn_user (id, ZP_TEAM_ZOMBIE)
client_print(id, print_chat, "[ZP] You have been respawned as Zombie")
}
else if(zp_is_nemesis_round() && zp_get_human_count() > 1)
{
// Spawn player as human on nemesis round
zp_respawn_user (id, ZP_TEAM_HUMAN)
client_print(id, print_chat, "[ZP] You have been respawned as Human")
}
else
{
if(zp_get_human_count() > 1 && zp_get_zombie_count() > 1)
{
// Spawn player as zombi on infection round
zp_respawn_user (id, ZP_TEAM_ZOMBIE)
client_print(id, print_chat, "[ZP] You have been respawned as Zombie")
}
}
}
public zp_round_ended(id) remove_task(id)