Hello !
Today with help of Doombringer I tried to do a plugin who do : auto-respawn when you die.
The problem is that it do crash the server when you're die ^^
This is the code :
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <string>
#define PLUGIN "Auto-Respawn"
#define VERSION "1.0"
#define AUTHOR "Sbeex"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("DeathMsg", "Respawn", "a") //when someone die -> exec Respawn()
}
public Respawn() {
new id = read_data(2)
//Read_data values :
// 1 -> killer
// 2 -> victim
// 3 -> headshot
// 4 -> weapon id
spawn(id);
set_task(0.5, "Respawn_Again", id);
client_print(id, print_chat, "If it work you have respawn !");
return PLUGIN_CONTINUE
}
public Respawn_Again(id)
{
spawn(id);
}
If you can see any errors please tell me !
(i'm french sorry for my english)