Raised This Month: $ Target: $400
 0% 

get_players


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-18-2022 , 01:04   Re: get_players
Reply With Quote #4

Use get_user_team() to determine which team the player is on and then you'll know the other team (there are mod-specific versions of get_user_team for Counter-Strike and Day of Defeat IIRC that might be better for clarity if you're playing one of those). Then, you'll know the opposite team.

Psuedocode:
Code:
if team == TeamA then
    TeamB
else
    TeamA
or, just replace "Team" in the get_players() function with the ternary operation:

Code:
get_user_team(id) == TeamA ? "TeamB" : "TeamA"
no need for an extra function unless you're trying to do something fancy with it.
__________________
fysiks is offline
 



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 15:40.


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