Raised This Month: $ Target: $400
 0% 

get_user_team & cs_get_user_team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NiQu
Veteran Member
Join Date: Nov 2009
Old 01-11-2010 , 01:21   get_user_team & cs_get_user_team
Reply With Quote #1

Do i understand the purpose of these right?


get_user_team:
Get's the players current team in any hl1 game?

cs_get_user_team:
Get's the players current team in counter-strike 1.6?
Using cstrike engine?

Can come in handy, so i'd like to know the difference of these two.
NiQu is offline
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 01-11-2010 , 01:51   Re: get_user_team & cs_get_user_team
Reply With Quote #2

I think that get_user_team returns (in a string) the name of the team..
This, as you said, is for HL1 (all games). And cs_get_user_team returns CS_TEAM_UNASSIGNED(0) | CS_TEAM_T(1) | CS_TEAM_CT(2) | CS_TEAM_SPECTATOR(3) and you don't need a string to save the data.. And the last function is specially for cstrike mod

As far as i know..
Mxnn is offline
NiQu
Veteran Member
Join Date: Nov 2009
Old 01-11-2010 , 01:57   Re: get_user_team & cs_get_user_team
Reply With Quote #3

Okey,
But i can use either CS_TEAM_T or 1?

Or do i have to stick with the number?, i dont like to play around with integers n numbers.

I would use this code to check if you are Terrorist.

PHP Code:
if ( cs_get_user_team(id) == CS_TEAM_T )
{
//What happends if ur T in here

And that would work right?

so, i could also use this?

PHP Code:
if ( cs_get_user_team(id) == )
{
//What happends if ur T in here

NiQu is offline
Mxnn
Veteran Member
Join Date: Aug 2009
Location: AT MY HOME
Old 01-11-2010 , 02:09   Re: get_user_team & cs_get_user_team
Reply With Quote #4

Yes, both right. But is more simply to read the first code
Mxnn is offline
NiQu
Veteran Member
Join Date: Nov 2009
Old 01-11-2010 , 02:10   Re: get_user_team & cs_get_user_team
Reply With Quote #5

Okey
Thats all i need to know
NiQu is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-11-2010 , 02:19   Re: get_user_team & cs_get_user_team
Reply With Quote #6

get_user_team returns and index and can also fill the team name.
If i remember well, in cs, team name is always correctly filled, but team index may be false in some specific situations.

A useless fix (use cstrike) would be something like this :
Code:
get_user_team2(id, szTeam[] = "", iLen = 0)
{
	new szTeamName[11] // UNASSIGNED
	get_user_team(id, szTeamName, charsmax(szTeamName))
	copy(szTeam, iLen, szTeamName)
	switch( szTeam[0] )
	{
		case 'U':return 0
		case 'T':return 1
		case 'C':return 2
		case 'S':return 3
	}
	return -1
}
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
DjOptimuS
Senior Member
Join Date: Jan 2009
Old 03-13-2012 , 00:58   Re: get_user_team & cs_get_user_team
Reply With Quote #7

sorry for posting here after a long time since last message, but i didn't wanted to make a new thread.

The question is, Which method is more efficient ? get_user_team or cs_get_user_team

NOTE: I will use this for CS 1.6. Thank you
DjOptimuS is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-13-2012 , 01:56   Re: get_user_team & cs_get_user_team
Reply With Quote #8

Use cs_get_user_team(). Difference will be negligible.
__________________
fysiks is offline
DjOptimuS
Senior Member
Join Date: Jan 2009
Old 03-13-2012 , 01:57   Re: get_user_team & cs_get_user_team
Reply With Quote #9

Thank you fysiks
DjOptimuS is offline
Xvil
BANNED
Join Date: Feb 2012
Old 03-13-2012 , 15:32   Re: get_user_team & cs_get_user_team
Reply With Quote #10

Example cs_get_user_tem:
PHP Code:
new CsTeams:Team cs_get_user_team(id)

switch(
Team

    case 
CS_TEAM_T:  // Team Terror
    
case CS_TEAM_CT:  // team CT
    
case CS_TEAM_SPECTATOR// Spec team

Example get_user_tem:
PHP Code:

new Team get_user_team(id)

switch(
Team

    case 
1// Team Terror
    
case 2// team CT
    
case 3// Spec team


Last edited by Xvil; 03-14-2012 at 13:58. Reason: fixed
Xvil 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 02:46.


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