Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Team struct
#1
Hi Nukem,

i am already working on teamchange support for the addon for about 1 month and i noticed that you implemented that inside the newest update.
I tried it out, but it seems that you only change the team-"appearance".

When i change the team value of a client, he is shown in the other teams list (in the player table) and his appearance is changed too (not the model). But he still can be killed by the new teammates.
It seems that you have to change more than just 1 value.

The Addresses i have so far are (for player 1):
0x185AF14 <- The actual Team value, which i found
0x1ADA758 <- Team Appearance, which you are changing - i think (mentioned above)
0x1ADA694 <- Player vision

The possible values for those are:
Team -> 0 = FFA/Joined | 1 = axis | 2 = allies | 3 = spectator
Team Appearance -> same as above
Player Vision -> 0 = alive | 1 = last location (spawn location or dead body from last death) | 2 = spectator | 3 = endscreen

The Offsets for this addresses (to get the other Players) are:
// Starting from Player 1 Addresses
Team -> 0x564
Team Appearance -> 0x38A8
Player Vision -> 0x38A8

Allthough i change the values at this addresses, it doesn't seem to work as it should.
You CAN change the vision, you CAN change the appearance and you CAN change the team with this addresses, but sometimes i can then kill a previous teammate and sometimes not.
It seems that something is still missing.

I hope this is a help and that you can manage to get the teamchange support working.

Greets Deviler
Reply

#2
I also found 2 values somehow but it didn't see anything changing with one of them (I think it was "the actual team value").

Good job I hope the bugs can be fixed when changing team.
[Image: azuw.jpg]
Reply

#3
NUKEM GET IN HERE NOAW
Reply

#4
(02-26-2012, 17:38)Deviler86 Wrote: Allthough i change the values at this addresses, it doesn't seem to work as it should.
You CAN change the vision, you CAN change the appearance and you CAN change the team with this addresses, but sometimes i can then kill a previous teammate and sometimes not.
It seems that something is still missing.

I hope this is a help and that you can manage to get the teamchange support working.

Greets Deviler

0x185AF14 actually reads from 0x1ADA758 when you switch a team, but only when you switch a team. 0x1ADA758 and 0x1ADA694 are also in the same struct (PM for info) but 0x1ADA694 is mostly irrelevant for switching teams.

The only real way now to force switch teams is to use mr commands (and let the server do the work for us):
Code:
mr <server id> [autoassign|allies|axis|spectator]

I'll look into faking these if it is possible the same structs are used.
Other than that, I would assume the game has many more places where the real team is located and read from.

Good work.
[Image: b_560_95_1.png]
Reply

#5
(02-26-2012, 18:37)Nukem Wrote: 0x185AF14 actually reads from 0x1ADA758 when you switch a team, but only when you switch a team. 0x1ADA758 and 0x1ADA694 are also in the same struct (PM for info) but 0x1ADA694 is mostly irrelevant for switching teams.

The only real way now to force switch teams is to use mr commands (and let the server do the work for us):
Code:
mr <server id> [autoassign|allies|axis|spectator]

I'll look into faking these if it is possible the same structs are used.
Other than that, I would assume the game has many more places where the real team is located and read from.

Good work.

that would be great ^^.
I know that the 0x1ADA694 address is irrelevant for switching from axis to allies and backwards, but - using your team struct - for switching from allies/axis to spectator it's necessary, since the switched player would just stay on the map walking around allthough he was switched to spectator (tested that already).
Same goes for switching from spectator to allies/axis <- the player still flies arround as a spectator.
Changing the vision (with 0x1ADA694) fixes that, allthough a previous spectator falls on the ground at switch and has no weapons/equipments ^^
Reply

#6
You'd probably have to find the engine function which manages team changes (well, afaik it's handled via GSC but the GSC code has to call some engine functions somehow...).

Once you've found the function's address and it's parameters you can do something like this to call it:
CSHARP Code
  1. using System.Runtime.InteropServices;
  2.  
  3. // Assuming the function's calling convention is __cdecl.
  4. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  5. public delegate void ChangeTeamDelegate(int clientNum, int targetTeam);
  6.  
  7. private void SwitchPlayerTeam(int clientNum, int targetTeam)
  8. {
  9. ChangeTeamDelegate ChangeTeam = Marshal.GetDelegateForFunctionPointer((IntPtr)0xDEADBEEF, typeof(ChangeTeamDelegate));
  10. ChangeTeam(clientNum, teamTarget);
  11. }


Something like that, not that the address or delegate is correct for the game, it's just an example.

Alternatively, you could just use what @Nukem suggested, it'd save all the hassle.
[Image: 30xhrep.png]

A casual conversation between barata and I about Nukem.
Reply

#7
Anybody can make a plugin "Switcher Teams "?
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Call of Duty loser calls in SWAT team hoax on kid who beat him RaZ 3 4,075 04-24-2014, 19:31
Last Post: Casper
Question Help Team DAMAGE offhand E-losev 0 2,425 09-17-2013, 12:03
Last Post: E-losev
  Help choose 2 random players?(1 each team) 26hz 6 4,642 09-12-2013, 17:32
Last Post: Yamato
  Name Team CheGuevara 1 3,073 06-01-2013, 14:15
Last Post: Yamato
  [Release] Team Customizer iPaddie 35 27,691 04-14-2013, 12:34
Last Post: Nero Z zero
  Sniper rifles bullet's spread & Preventing joining to a team lammv 11 7,101 03-15-2013, 12:53
Last Post: lammv
  Sending a plaeyr to axis or allies team lammv 0 2,018 01-26-2013, 18:59
Last Post: lammv
  [Request] Team change by admin command. Dumas 10 8,877 11-29-2012, 21:38
Last Post: 99IRock
Question Help MW3 infected team help koro35 12 9,385 11-23-2012, 07:45
Last Post: 99IRock
  [Request] change team name plugin james ford 7 7,162 11-13-2012, 22:05
Last Post: parsa89

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.