There is not enough respawn points in some deathrun maps. So I wanted to make a plugin that respawns player if he gets killed at the very beginning of a new round. The method I'm trying to use is very simple but it should work since in DR there's semi-clip.
The code I made:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
public plugin_init()
{
register_plugin("Resurrection", "0.1", "inox");
}
public round_start(id)
{
set_task(0.2, "killer", id)
set_task(1.0, "respawn", id)
}
public killer(id)
{
if(is_user_alive(id))
{
user_kill(id)
}
return PLUGIN_HANDLED
}
public respawn(id)
{
new name[32]
get_user_name(id,name,31)
if(is_user_alive(id))
{
return PLUGIN_HANDLED
}
ExecuteHamB(Ham_CS_RoundRespawn, id)
client_print(id, print_chat, "%s, you've been respawned due spawn issue.", name)
client_print(id, print_chat, "You're good to go !")
return PLUGIN_HANDLED
}
'killer' function is only for testing purposes. The plugin completed with no errors or warning but it's not working anyway. I think, as I hardly understand pawn and actually this is my first plugin (so far I've only made some small changes to plugins), I've chosen incorrect 'round_start' function (I mean there's another function to do this job) or there's something wrong with 'set_tast'.