AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   switch team (https://forums.alliedmods.net/showthread.php?t=132931)

Temptation 07-20-2010 07:37

switch team
 
hi guys, i need help. how to make when a player from ct kill the first terrorist. change the terrorist to ct. but, the the ct did not manage to kill the all the terrorists. the first t that are in ct change back to t.

Vechta 07-20-2010 09:12

Re: switch team
 
look into basebuilder code

zombieplague 07-20-2010 09:28

Re: switch team
 
Quote:

Originally Posted by Vechta (Post 1245502)
look into basebuilder code

His one is whole team. but, i want only first t to been kill by ct.

mottzi 07-20-2010 11:34

Re: switch team
 
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 >= && killer != 0)
            {
                if(
victim <= 32 && victim >= && victim != 0)
                {
                    
// set the killed t to CT
                    
cs_set_user_team(victimCS_TEAM_CT)
                    
                    
// set the CT (killer) to T
                    
cs_set_user_team(killerCS_TEAM_T)
                    
killed true;
                }
            }
        }
    }                
}

public 
round_start()
{
    
killed false;



zombieplague 07-21-2010 04:41

Re: switch team
 
Quote:

Originally Posted by mottzi (Post 1245599)
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 >= && killer != 0)
            {
                if(
victim <= 32 && victim >= && victim != 0)
                {
                    
// set the killed t to CT
                    
cs_set_user_team(victimCS_TEAM_CT)
                    
                    
// set the CT (killer) to T
                    
cs_set_user_team(killerCS_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 ?

mottzi 07-21-2010 05:38

Re: switch team
 
no the ct just have to kill 1 T to switch!
when another ct kills a T after this kill nothing will happen

zombieplague 07-21-2010 06:43

Re: switch team
 
Quote:

Originally Posted by mottzi (Post 1246527)
no the ct just have to kill 1 T to switch!
when another ct kills a T after this kill nothing will happen

Can you make it so it will become like this ?

If ct kill the first t. the t will change to ct. but the ct must kill all the t to get that t to become a ct successfully. then the ct will go t. if ct didn't manage to kill all the t. it restart

nikhilgupta345 07-22-2010 00:59

Re: switch team
 
I think he means something like the literal game of hide and seek. Whoever is found first (killed first) becomes the seeker (counter-terrorist) once he finds all of the hiders (terrorists). If he doesn't kill all of the terrorists, then the round restarts.

Correct me if I'm wrong zombieplague


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

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