Raised This Month: $ Target: $400
 0% 

get user old team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Caldeum
Senior Member
Join Date: Jul 2010
Location: United Kingdom
Old 08-27-2012 , 06:01   get user old team
Reply With Quote #1

How to get user old team?

if i join the server and choose one of the team i must get message but if i change team do not show message for me.

PHP Code:
if ( iTeam != Oldteam... ) 
PHP Code:
    new CsTeams:iTeam cs_get_user_teamid );
    
    if ( 
iTeam != CS_TEAM_T && iTeam != CS_TEAM_CT )
    {
       
//message
    

__________________
Of all the things I lost, I miss my brain the most.
Caldeum is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 08-27-2012 , 15:27   Re: get user old team
Reply With Quote #2

hook jointeam command and check cs_get_user_team there

also your part of code will still show the message if player switches to team from spectating, check if users team is CS_TEAM_UNASSIGNED for it to work only after connecting
jimaway is offline
Caldeum
Senior Member
Join Date: Jul 2010
Location: United Kingdom
Old 08-27-2012 , 15:54   Re: get user old team
Reply With Quote #3

jointeam hooked.

is it right?
PHP Code:
    new CsTeams:iTeam cs_get_user_teamid );
    
    if ( 
iTeam == CS_TEAM_T || iTeam == CS_TEAM_CT && cs_get_user_teamid ) == CS_TEAM_UNASSIGNED 
__________________
Of all the things I lost, I miss my brain the most.
Caldeum is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-27-2012 , 16:38   Re: get user old team
Reply With Quote #4

That statement will always evaluate to false
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 08-27-2012 , 16:48   Re: get user old team
Reply With Quote #5

if (cs_get_user_team( id ) == CS_TEAM_UNASSIGNED )
jimaway is offline
Caldeum
Senior Member
Join Date: Jul 2010
Location: United Kingdom
Old 08-27-2012 , 17:01   Re: get user old team
Reply With Quote #6

Ok. But if i'm in CT and i change my team to T i will get the //message. What i'm trying to do is block message if i change my team but show message when i connect and choose the team.
__________________
Of all the things I lost, I miss my brain the most.
Caldeum is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 08-27-2012 , 17:04   Re: get user old team
Reply With Quote #7

http://forums.alliedmods.net/showpos...21&postcount=3
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 08-27-2012 , 22:58   Re: get user old team
Reply With Quote #8

If this is not enough, you may try do this:

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

new g_iTeam33 ], Floatg_fTimeg_iMaxClientsboolg_bConnected33 ];

public 
client_connectiPlayer ) {
  
g_iTeamiPlayer ] = -1;
  
g_bConnectediPlayer ] = false;
}

public 
client_disconnectiPlayer ) {
  
g_iTeamiPlayer ] = -1;
  
g_bConnectediPlayer ] = false;
}

public 
plugin_init( ) {
  
register_forwardFM_StartFrame"OnGameFrame" );
  
g_iMaxClients get_maxplayers( );
}

public 
client_putinserveriPlayer )
  
g_bConnectediPlayer ] = true;

public 
OnGameFrame( ) {
  static 
FloatfGameTimeiiTeam;
  
fGameTime get_gametime( );

  if( 
fGameTime g_fTime >= 0.0666 ) {
    for( 
1<= g_iMaxClientsi++ ) {
      if( 
g_bConnected] ) {
        
iTeam get_pdata_inti114 );

        if( 
g_iTeam] != iTeam ) {
          
// THE TEAM HAS BEEN CHANGED ( OLDTEAM = g_iTeam[ i ], NEWTEAM = iTeam )

          /*

          */

          
g_iTeam] = iTeam;
        }
      }
    }

    
g_fTime fGameTime;
  }

__________________

Last edited by claudiuhks; 08-27-2012 at 23:04.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 08-28-2012 , 05:08   Re: get user old team
Reply With Quote #9

Quote:
Originally Posted by Caldeum View Post
Ok. But if i'm in CT and i change my team to T i will get the //message. What i'm trying to do is block message if i change my team but show message when i connect and choose the team.
you don't even know what you're talking about, don't you?

i dont get you all with your bigass codes with 1000000 variables cacheing teams and shit

Code:
#include <amxmodx> #include <cstrike> public plugin_init() {     register_plugin("this", "0", "jimaway")     register_clcmd("jointeam", "jointeam_func") } public jointeam_func(id) {     if (cs_get_user_team(id) == CS_TEAM_UNASSIGNED) {         //message     } }

Last edited by jimaway; 08-28-2012 at 05:14.
jimaway is offline
Caldeum
Senior Member
Join Date: Jul 2010
Location: United Kingdom
Old 08-28-2012 , 05:24   Re: get user old team
Reply With Quote #10

Check this code in your server and join to CT after change team to T.
__________________
Of all the things I lost, I miss my brain the most.
Caldeum is offline
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 05:50.


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