AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to get user real team? (https://forums.alliedmods.net/showthread.php?t=177312)

wwzw 01-30-2012 21:10

How to get user real team?
 
I use get_user_team(id) can return a player's team.

But when a player change he's team (press "m"), get_user_team(id) return value is he's old team .

Can I get player's real team ?

Please help me ! Thanks !

Neeeeeeeeeel.- 01-30-2012 21:29

Re: How to get user real team?
 
You could try this module

Hunter-Digital 01-30-2012 23:02

Re: How to get user real team?
 
For CS it's cs_get_user_team() and there are some other mod specific functions, see funcwiki.

wwzw 01-31-2012 01:44

Re: How to get user real team?
 
Hunter-Digital:
Thank you very much ! cs_get_user_team() is good !

wwzw 01-31-2012 02:03

Re: How to get user real team?
 
Quote:

Originally Posted by Hunter-Digital (Post 1641579)
For CS it's cs_get_user_team() and there are some other mod specific functions, see funcwiki.

now I use :
PHP Code:

cs2_get_user_team(id)
{
 switch(
cs_get_user_team(id))
 {
  case 
CS_TEAM_UNASSIGNED: return 0;
  case 
CS_TEAM_T: return 1;
  case 
CS_TEAM_CT: return 2;
  case 
CS_TEAM_SPECTATOR: return 3;
 }
 return 
0;


Right or wrong ?

fysiks 01-31-2012 02:25

Re: How to get user real team?
 
Quote:

Originally Posted by wwzw (Post 1641672)
now I use :
PHP Code:

cs2_get_user_team(id)
{
 switch(
cs_get_user_team(id))
 {
  case 
CS_TEAM_UNASSIGNED: return 0;
  case 
CS_TEAM_T: return 1;
  case 
CS_TEAM_CT: return 2;
  case 
CS_TEAM_SPECTATOR: return 3;
 }
 return 
0;


Right or wrong ?

Pointless. Just use cs_get_user_team() as is with the CS_TEAM_* constants.

wwzw 01-31-2012 03:52

Re: How to get user real team?
 
I need to return the number result 0-3 to use for array .

Arkshine 01-31-2012 05:47

Re: How to get user real team?
 
It returns already such number, it's just tagged with CsTeams.

Exolent[jNr] 01-31-2012 09:29

Re: How to get user real team?
 
Code:
#define cs2_get_user_team(%1) (_:cs_get_user_team(%1))

wwzw 01-31-2012 18:52

Re: How to get user real team?
 
Quote:

Originally Posted by Exolent[jNr] (Post 1641831)
Code:
#define cs2_get_user_team(%1) (_:cs_get_user_team(%1))

Very perfect ! I have used! Thank you very much!


All times are GMT -4. The time now is 00:21.

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