View Single Post
Hey
Member
Join Date: Dec 2017
Old 01-10-2018 , 11:28   Re: How To: Respawn a player
Reply With Quote #31

please don't bump old posts unless you have a good reason to bump it, i understand that you are new here so it's fine.


the code is not completed so here is the fixed one:
PHP Code:
#include <amxmodx>
#include <hamsandwich>

#define PLUGIN "Revive Test"
#define VERSION "1.0"
#define AUTHOR "Anurag Kumar"

new cvar_revivetime;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)

    
RegisterHam(Ham_Killed"player""Killed"1);
    
cvar_revivetime register_cvar("Respawn_Time""6.0");
}
public 
client_putinserver(id)
{
    
set_task(get_pcvar_float(cvar_revivetime), "Revive"id);
}
public 
Killed(id)
{
    
set_task(get_pcvar_float(cvar_revivetime), "Revive"id);
}
public 
Revive(id){
    if(!
is_user_alive(id))
    
ExecuteHamB(Ham_CS_RoundRespawn,id)

And btw this code will keep respawning player when they die so yeah.

Last edited by Hey; 01-10-2018 at 11:55.
Hey is offline