Raised This Month: $ Target: $400
 0% 

switch team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Temptation
Member
Join Date: Jan 2010
Old 07-20-2010 , 07:37   switch team
Reply With Quote #1

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.
Temptation is offline
Vechta
Veteran Member
Join Date: Jun 2010
Old 07-20-2010 , 09:12   Re: switch team
Reply With Quote #2

look into basebuilder code
Vechta is offline
zombieplague
Veteran Member
Join Date: Apr 2009
Old 07-20-2010 , 09:28   Re: switch team
Reply With Quote #3

Quote:
Originally Posted by Vechta View Post
look into basebuilder code
His one is whole team. but, i want only first t to been kill by ct.
zombieplague is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 07-20-2010 , 11:34   Re: switch team
Reply With Quote #4

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;

__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers
mottzi is offline
Send a message via MSN to mottzi
zombieplague
Veteran Member
Join Date: Apr 2009
Old 07-21-2010 , 04:41   Re: switch team
Reply With Quote #5

Quote:
Originally Posted by mottzi View Post
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 ?
zombieplague is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 07-21-2010 , 05:38   Re: switch team
Reply With Quote #6

no the ct just have to kill 1 T to switch!
when another ct kills a T after this kill nothing will happen
__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers
mottzi is offline
Send a message via MSN to mottzi
zombieplague
Veteran Member
Join Date: Apr 2009
Old 07-21-2010 , 06:43   Re: switch team
Reply With Quote #7

Quote:
Originally Posted by mottzi View Post
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
zombieplague is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 07-22-2010 , 00:59   Re: switch team
Reply With Quote #8

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
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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