Raised This Month: $32 Target: $400
 8% 

how to transfer all CT to T?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 01-01-2012 , 03:57   how to transfer all CT to T?
Reply With Quote #1

tittle please
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
Mr.Waffle
Senior Member
Join Date: Dec 2011
Old 01-01-2012 , 06:14   Re: how to transfer all CT to T?
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <cstrike>

new gMaxPlayers

public plugin_init() {
    
register_plugin("PLUGIN""VERSION""AUTHOR")
    
    
register_clcmd("say /transfer""transfer")
    
    
gMaxPlayers get_maxplayers();    
}

public 
transfer() {
    if(
is_user_admin(id){
        for( new 
id 1id <= gMaxPlayersid++ ) {    
            if(
cs_get_user_team(id) == CS_TEAM_CT) {
                
cs_set_user_team(idCS_TEAM_T)
                
user_kill(id)
            }
        }
    }        

Its will transfer all CT to T and slay them .
if you dont want to slay them remove :
PHP Code:
user_kill(id
Mr.Waffle is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-01-2012 , 07:30   Re: how to transfer all CT to T?
Reply With Quote #3

Previous method will generate errors.
Use this :
PHP Code:
transfer()
{
    new 
players[32], num
    get_players
(playersnum"h")
    for(new 
id players[--num]; num>=0id players[--num])
    {
        if( 
cs_get_user_team(id) == CS_TEAM_CT )
        {
            
cs_set_user_team(idCS_TEAM_T)
        }
    }

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 01-01-2012 at 07:37.
ConnorMcLeod is offline
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 01-01-2012 , 07:30   Re: how to transfer all CT to T?
Reply With Quote #4

I already know that kind of answer will came but I already tried that before but still it failed ( with bots. )

@Connor
Will try yours

EDIT :
PHP Code:
transfer() 

    new 
players[32], numid 
    get_players
(playersnum"h"
    for(--
numnum>=0num--) 
    { 
        
id players[num
        if( 
cs_get_user_team(id) == CS_TEAM_CT 
        { 
            
cs_set_user_team(idCS_TEAM_T 
        

    } 

==>

PHP Code:
transfer() 

    new 
players[32], numid 
    get_players
(playersnum"h"
    for(--
numnum>=0num--) 
    { 
        
id players[num
        if( 
cs_get_user_team(id) == CS_TEAM_CT 
        { 
            
cs_set_user_team(idCS_TEAM_T)
        } 
    } 

__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.

Last edited by JoKeR LauGh; 01-01-2012 at 07:32.
JoKeR LauGh is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-01-2012 , 07:39   Re: how to transfer all CT to T?
Reply With Quote #5

Code fixed and changed ;)
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 01-01-2012 at 07:39.
ConnorMcLeod is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 01-01-2012 , 07:47   Re: how to transfer all CT to T?
Reply With Quote #6

Quote:
Originally Posted by ConnorMcLeod View Post
Previous method will generate errors.
Just to know, what kind of errors would that be?
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-01-2012 , 08:07   Re: how to transfer all CT to T?
Reply With Quote #7

Quote:
Originally Posted by bibu View Post
Just to know, what kind of errors would that be?
"Invalid player %d" on not connected index with cs_get_user_team native.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 01-01-2012 at 08:07.
ConnorMcLeod is offline
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 01-01-2012 , 08:24   Re: how to transfer all CT to T?
Reply With Quote #8

like this also can , right?

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

#define PLUGIN "XXX"
#define VERSION "XXX"
#define AUTHOR "XXX"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHamHam_Spawn"player""Fw_Spawn")
}

public 
Fw_Spawn(id)
{
    if ( 
is_user_alive(id) )
    {
        if ( 
cs_get_user_team(id) == CS_TEAM_CT )
        {
            
cs_set_user_team(idCS_TEAM_T )
        }
    }

__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-01-2012 , 08:43   Re: how to transfer all CT to T?
Reply With Quote #9

In that case, would be better to convert all CT spawns into T spawns ;)
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 01-01-2012 , 08:46   Re: how to transfer all CT to T?
Reply With Quote #10

no , you can't teleport them all to T spawn , I tried with bots but why they didn't change to CT ? is it because the const entity is player?
PHP Code:
RegisterHamHam_Spawn"player""Fw_Spawn"
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
Reply


Thread Tools
Display Modes

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 20:03.


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