Thread: Respawn for cts
View Single Post
Author Message
AlexWinchester
Junior Member
Join Date: May 2023
Old 11-24-2023 , 18:32   Respawn for cts
Reply With Quote #1

Hello everybody,
I could use some help to add spawn protection and cancel the CT's from respawning when the round ends.
Which i have no idea how to do,

Here's what i've done so far,

Thanks in advance

*REDITING THE CODE*
PHP Code:
#include <amxmodx>
#include <engine>
#include <cstrike>
#include <fun>
#include <hamsandwich>

// team ids 
#define CTS 2

public plugin_init()
{    
    
RegisterHamHam_Killed"player""ham_killed");
}

public 
ham_killedvictimkillershouldgib )
{
    if (
get_user_team(victim)==CTS)        
        
set_task0.5"RespawnPlayer"victim );

    return 
HAM_IGNORED;
}

public 
RespawnPlayerid )
{
    
ExecuteHamBHam_CS_RoundRespawnid )

    
set_user_godmode(id1)
    
client_print_color id print_chat "^3[SpawnProtection] ^1You get 5 second SpawnProtection" 
    
    if (
cs_get_user_team(id) == CS_TEAM_CT)
        
set_rendering(idkRenderFxGlowShell00255kRenderNormal50)
    
    
set_task(5.0"RemoveProtection"id)
    return 
PLUGIN_HANDLED;
}

public 
RemoveProtection(id) {
    
set_user_godmode(id0)
    
set_rendering(id)
    
client_print_colorid print_chat "^3[SpawnProtection] ^1SpawnProtection has expired" )


Last edited by AlexWinchester; 11-28-2023 at 12:57. Reason: editted the code
AlexWinchester is offline