Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define PLUGIN "AutoSpawn"
#define VERSION "1.0"
#define AUTHOR "Smarttart62"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("amx_autospawn","1")
register_event("DeathMsg","spawnMe","a")
}
public spawnMe()
{
if (get_cvar_num("amx_autospawn")!=1)
{
return PLUGIN_HANDLED
}
new players[32], num
get_players(players, num)
new i
for (i = 0; i < num; i++)
{
new id = players[i]
if (!is_user_alive(id))
{
spawn(id)
set_task(0.5, "respawn", id)
}
}
return PLUGIN_CONTINUE
}
public respawn(id)
{
spawn(id)
}
Look at that code an compare to yours and you will find your errors.