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() { RegisterHam( Ham_Killed, "player", "ham_killed", 1 ); }
public ham_killed( victim, killer, shouldgib ) { if (get_user_team(victim)==CTS) set_task( 0.5, "RespawnPlayer", victim );
return HAM_IGNORED; }
public RespawnPlayer( id ) { ExecuteHamB( Ham_CS_RoundRespawn, id )
set_user_godmode(id, 1) client_print_color ( id , print_chat , "^3[SpawnProtection] ^1You get 5 second SpawnProtection" ) if (cs_get_user_team(id) == CS_TEAM_CT) set_rendering(id, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, 50) set_task(5.0, "RemoveProtection", id) return PLUGIN_HANDLED; }
public RemoveProtection(id) { set_user_godmode(id, 0) set_rendering(id) client_print_color( id , print_chat , "^3[SpawnProtection] ^1SpawnProtection has expired" ) }
|