I was just looking for a simple amx_respawn script but didnt find anything else than trashed bad coded junk.
So I just made my own.
But I get "Internal Error" on both web compiler and my own.
Whats wrong with this?
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
public plugin_init()
{
register_plugin("Player Spawner", "1.0", "XunTric")
register_concmd("amx_spawn", "spawn", ADMIN_KICK, "<name> Spawns a player from death")
}
public spawn(id, level, cid)
{
if (!cmd_access(id, level, cid, 2)) {
return PLUGIN_HANDLED
}
new arg[32]
read_argv(1 ,arg, 31)
new target = cmd_target(id, arg, 2)
if(!target) {
client_print(id, print_console, "Invalid user!")
return PLUGIN_HANDLED
}
if(is_user_alive(target)) {
client_print(id, print_console, "Target is already alive!")
return PLUGIN_HANDLED
}
//Spawn 2 times to avoid bug
set_task(0.5, "dospawn", target)
set_task(0.7, "dospawn", target)
client_print(id, print_console, "Succesfully spawned %s!", target)
return PLUGIN_HANDLED
}
public dospawn(id)
{
spawn(id)
}