#include <amxmodx>
#include <fun>
#define PLUGIN "Spawn"
#define VERSION "1.1"
#define AUTHOR "amxxx"
#define IsPlayer(%1) (1 <= %1 <= gMaxClients)
new gMaxClients;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("DeathMsg","func_death","a")
register_clcmd("say /respawn","respawn");
register_clcmd("say_team /respawn","respawn");
gMaxClients = get_maxplayers();
}
public func_death()
set_task(0.5, "odrodzenie", read_data(2))
public respawn(id){
if(IsPlayer(id) && is_user_connected(id) && !is_user_alive(id) && get_user_team(id)%3)
set_task(0.5, "odrodzenie", id);
}
public odrodzenie(id){
if(IsPlayer(id) && is_user_connected(id) && !is_user_alive(id) && get_user_team(id)%3){
spawn(id)
client_print(id,print_center,"Zostales Ozywiony! Mozesz Grac ponownie!")
}
}
Jednak polecam spawnować gracza podwójnie, np. w odstępie 0.5 sekundy (nieraz funkcja działa dopiero za drugim razem).