View Single Post
Snake.
Senior Member
Join Date: Jul 2017
Old 11-06-2022 , 11:00   Re: [Request] Freeze Player For 1 Second When Spawned
Reply With Quote #5

Quote:
Originally Posted by Nutu_ View Post
send the auto-respawn code
PHP Code:
public plugin_init() 
{
    
register_plugin("[Respawn]""1.0"PluginAuthor);
    
    
register_clcmd("say /start""Command_Respawn");
    
register_clcmd("say /respawn""Command_Respawn");
    

    
register_forward(FM_PlayerPreThink"CBasePlayer_PreThink");

    
register_forward(FM_PlayerPreThink"CBasePlayer_PreThink_BlockUse");
    
register_forward(FM_ClientKill"CBasePlayer_KillCommand");
    
register_forward(FM_AddToFullPack"AddToFullPack_Post"1);    
    
}

public 
Command_Start(id)
{
    if (!
is_user_connected(id) || cs_get_user_team(id) == CS_TEAM_SPECTATOR)         return;

    
ExecuteHamB(Ham_CS_RoundRespawnid);
    
cs_set_user_deaths(idcs_get_user_money(id));
    
give_item(id"weapon_usp");
    
set_user_health (id 10084);
}
public 
Command_Respawn(id
{
    if(
is_user_alive(id)) 
    { 
        
Command_Start(id);
    }
    return 
PLUGIN_HANDLED;
}
public 
CBasePlayer_KillCommand(id
{
    
Command_Start(id);    
    return 
HAM_SUPERCEDE;
}
public 
Ham_PlayerAlready_Killed(id
{        
    
set_task(0.1"Command_Start"id);    
}

public 
client_PreThink(id
{
    if(
get_user_health(id) < 9984) {
        
Command_Start(id)
    }

Snake. is offline
Send a message via Skype™ to Snake.