Raised This Month: $ Target: $400
 0% 

get team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
piepie
Member
Join Date: May 2013
Location: Pieland *.*
Old 06-03-2013 , 19:14   get team
Reply With Quote #1

what is the best method? cs_get_user_team or get_user_team?
__________________

piepie is offline
guipatinador
SourceMod Donner Party
Join Date: Oct 2009
Location: Poortugal
Old 06-03-2013 , 19:19   Re: get team
Reply With Quote #2

cs_get_user_team( ) returns CS_TEAM_T, CS_TEAM_CT etc etc and get_user_team( ) returns 1, 2, etc

With get_user_team( ) you can get the team name (string).

Last edited by guipatinador; 06-03-2013 at 19:19.
guipatinador is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-03-2013 , 19:52   Re: get team
Reply With Quote #3

Quote:
Originally Posted by piepie View Post
what is the best method? cs_get_user_team or get_user_team?
Generally, cs specific functions should be used when possible for Counter-Strike.
__________________
fysiks is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 06-03-2013 , 20:21   Re: get team
Reply With Quote #4

get_user_team not properly validate command for dead players

cs_get_user_team - working correctly
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
xPez
Member
Join Date: Apr 2013
Location: Sweden
Old 06-04-2013 , 01:15   Re: get team
Reply With Quote #5

PHP Code:
cs_get_user_team 

Last edited by xPez; 06-04-2013 at 01:15.
xPez is offline
Send a message via Skype™ to xPez
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 06-04-2013 , 04:50   Re: get team
Reply With Quote #6

use get_user_team( ), if u don't want to use cstrike module
TheDS1337 is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 06-04-2013 , 10:42   Re: get team
Reply With Quote #7

Quote:
Originally Posted by DeagLe.Studio View Post
use get_user_team( ), if u don't want to use cstrike module
Not really a valid reason. Fysiks is right.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-05-2013 , 03:56   Re: get team
Reply With Quote #8

Quote:
Originally Posted by DeagLe.Studio View Post
use get_user_team( ), if u don't want to use cstrike module
cstrike module should be used when possible.
__________________
fysiks is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 06-05-2013 , 06:10   Re: get team
Reply With Quote #9

Quote:
Originally Posted by guipatinador View Post
With get_user_team( ) you can get the team name (string).
Not a problem.

PHP Code:
_get_client_teamIndexTeam[ ], Length )
{
  if( !
is_user_connectedIndex ) )
    return -
1;

  static const 
TeamNames[ ][ ] = { "UNASSIGNED""TERRORIST""CT""SPECTATOR" };
  static 
Team;

  
Team cs_get_user_teamIndex );

  if( 
Length )
    
formatexTeamLength"%s"TeamNamesTeam ] );

  return 
Team;

PHP Code:
// Returns the Counter-Strike purely team index
native cs_get_user_teamClient );

// Returns the team that is retrieved through different events like TeamInfo or ScoreInfo
native get_user_teamClientTeam[ ] = ""Length ); 
In my opinion, the best solution is retrieving the client's team index by cs_get_user_team.

Fake Meta fast conversion:

PHP Code:
_get_client_teamIndex )
{
  static const 
OFFSET_CSTEAMS 114;

  return 
is_user_connectedIndex ) ? get_pdata_intIndexOFFSET_CSTEAMS ) : -1;
}

_set_client_teamIndexTeam )
{
  static const 
OFFSET_CSTEAMS 114;

  return 
is_user_connectedIndex ) ? set_pdata_intIndexOFFSET_CSTEAMSTeam ) : -1;

__________________

Last edited by claudiuhks; 06-05-2013 at 06:28.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
Old 06-23-2013, 04:44
Row
This message has been deleted by ConnorMcLeod. Reason: TROLLINg
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 16:23.


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