Raised This Month: $12 Target: $400
 3% 

Keeping team client index the same through the campaign


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jaylow
Junior Member
Join Date: Dec 2021
Old 01-11-2022 , 05:26   Keeping team client index the same through the campaign
Reply With Quote #1

Is there anyway to keep the client team index the same through the campaign so everymap it doesnt change?

i have a L4D2 plugin which gets team, starttime, map, players and scores and i am displaying it but because the team client index is constantly changing it is not displaying correctly.

Last edited by Jaylow; 01-11-2022 at 05:29.
Jaylow is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 01-17-2022 , 10:06   Re: Keeping team client index the same through the campaign
Reply With Quote #2

There are two terms in versus related to teams:

1) client team - which is changed once per each map for each player. Can be retrieved via GetClientTeam().
2) logical team - which is not changed during the whole campaign, unless you specially moved to another team.

To get the logical team from client index you can use the stock below:
PHP Code:
int GetLogicalTeam(int client)
{
    return (
GetClientTeam(client) ^ GameRules_GetProp("m_bAreTeamsFlipped"1)) - 1;

__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 01-17-2022 at 10:07.
Dragokas is offline
Reply


Thread Tools
Display Modes

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 19:53.


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