 |
|
Veteran Member
|

07-21-2010
, 04:41
Re: switch team
|
#5
|
Quote:
Originally Posted by mottzi
with this code the first CT who kill a T will switch to T and the killed T will switch to CT!
PHP Code:
#include <amxmodx> #include <amxmisc> #include <cstrike>
new bool:killed
public plugin_init() { register_plugin("dontknowthenameofthisplugin", "1.0", "Mottzi") register_event ( "DeathMsg" , "e_DeathMsg" , "a" ); register_logevent("round_start", 2, "1=Round_Start"); }
public e_DeathMsg() { new killer = read_data(1), victim = read_data(2) if(killed == false) { if(cs_get_user_team(killer) == CS_TEAM_CT) { if(killer <= 32 && killer >= 1 && killer != 0) { if(victim <= 32 && victim >= 1 && victim != 0) { // set the killed t to CT cs_set_user_team(victim, CS_TEAM_CT) // set the CT (killer) to T cs_set_user_team(killer, CS_TEAM_T) killed = true; } } } } }
public round_start() { killed = false; }
|
Does this include when the CT can't kill all the T. The whole process repeat again. like going back to normal ?
|
|
|
|