AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Module Coding (https://forums.alliedmods.net/forumdisplay.php?f=9)
-   -   Respawn for cts (https://forums.alliedmods.net/showthread.php?t=344653)

AlexWinchester 11-24-2023 18:32

Respawn for cts
 
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" )




All times are GMT -4. The time now is 08:54.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.