So, it doesn't actually work, and i think there is something wrong with this:
Code:
if(get_user_team(id) == 1 || get_user_team(id) == 2) {
because it doesnt even say "respawned".
Well, the code:
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
public plugin_init() {
register_plugin("Respawn", "0.14b", "naf")
register_event("DeathMsg","func_death","a")
}
public func_death()
set_task(0.1, "r_spawn", read_data(2))
public r_spawn(id) {
if(get_user_team(id) == 1 || get_user_team(id) == 2) {
spawn_func(id)
set_hudmessage(id, 225, 0, 0.05, 0.45, 0, 6.0, 6.0, 0.5, 0.15, 3)
show_hudmessage(id,"[Respawned]")
client_print(id, print_console,"Respawned.")
}
}
public spawn_func(id) {
new parm[1]
parm[0] = id
set_task(0.2,"player_spawn",72,parm,1)
set_task(0.3,"player_spawn",72,parm,1)
set_task(0.4,"player_giveitems",72,parm,1)
}