|
|
sponsored advertisements
|
|
20th November 2009, 09:37 PM
|
#1
|
Master Contributor
|
Teamcheck
Define the clientinfo size:
Code:
#define CClientInfoSize 0x052C
//Functions:
Code:
int getLocalIndex ( void )
{
return *(int*)off_GetLocalIndex;
}
int getTeam ( int i )
{
return *(int*)((i * CClientInfoSize) + off_GetTeam);
}
bool isEnemyTeam( int index )
{
return ( getTeam( getLocalIndex() ) != getTeam( index ) );
}
Patterns for the offsets:
Code:
/* 1.0.168
off_GetTeam 8E4814
off_GetLocalIndex 7F12C8
*/
DWORD dwGetTeam = *(DWORD*)(FindPattern((DWORD)GetModuleHandle("iw4mp.exe"), GetModuleSize(GetModuleHandle("iw4mp.exe")),
(BYTE *)"\x8B\xD3\x69\xD2\x2C\x05\x00\x00\x8B\xE8\x8B\x82\x14\x48\x8E\x00\x83\xF8\x03\xBE\x01\x00\x00\x00",
(CHAR *)"xxxx????xxxx????xxxxxxxx") + 0xC);
off_GetTeam = dwGetTeam;
DWORD dwGetLocalIndex = *(DWORD*)(FindPattern((DWORD)GetModuleHandle("iw4mp.exe"), GetModuleSize(GetModuleHandle("iw4mp.exe")),
(BYTE *)"\x51\x83\x3D\xEC\x12\x7F\x00\x00\x0F\x84\x9E\x00\x00\x00\xA1\xC8\x12\x7F\x00\x69\xC0\x2C\x05\x00\x00\x8B\x88\x14\x48\x8E\x00\x53\x8B\x5C\x24\x10\x55\x56\x57",
(CHAR *)"xxx????x??????x????xx????xx????xxxxxxxx") + 0xF );
off_GetLocalIndex = dwGetLocalIndex;
Usage:
Code:
bool enemyTeam = isEnemyTeam( i ); //entity index
__________________
“For every complex problem, there is an answer that is short, simple and wrong.”
“Pessimism is safe, but optimism is a lot faster!”
Last edited by ReUnioN; 20th November 2009 at 09:52 PM.
|
ReUnioN is offline
|
|
|
20th November 2009, 09:43 PM
|
#2
|
Sozinho Para Sempre
|
n1!! thx for info
|
KIDEBR is offline
|
|
20th November 2009, 09:46 PM
|
#3
|
Retired Administrator
|
nice work,
do you prefer this over a reclassed struct?
|
learn_more is offline
|
|
20th November 2009, 09:57 PM
|
#4
|
Master Contributor
|
Quote:
Originally Posted by learn_more
nice work,
do you prefer this over a reclassed struct?
|
Yep, for the teamcheck i prefer this one
For other peeps:
Code:
bool isEnemyTeam( CClientInfo* pLocalClientInfo, CClientInfo* pTargetClientInfo )
{
return ( pLocalClientInfo->team ) != pTargetClientInfo->team );
}
Never knew how to find out which is the localClientInfo as i didnt log its index. Incase its not always 0 i would have to iterate through the clientinfos until i find the local one.. save its team.. after iterate through all again to validate the teamcheck.
If there is a more simple way put me on it
__________________
“For every complex problem, there is an answer that is short, simple and wrong.”
“Pessimism is safe, but optimism is a lot faster!”
Last edited by ReUnioN; 20th November 2009 at 10:01 PM.
|
ReUnioN is offline
|
|
|
20th November 2009, 10:35 PM
|
#5
|
I never talk to the cops, I don't speak Pig Latin.
|
very nice.
__________________
Quote:
Originally Posted by Rick Cook
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
|
|
scrapdizle is offline
|
|
21st November 2009, 01:00 AM
|
#6
|
|
Dont forget free for all both yours and the enemy team will be 0, so in your team check just check what team your on and if its 0 then enemy team = your team
|
Encrypted92 is offline
|
|
21st November 2009, 01:13 AM
|
#7
|
A Legend
|
Quote:
Originally Posted by ReUnioN
Yep, for the teamcheck i prefer this one
For other peeps:
Code:
bool isEnemyTeam( CClientInfo* pLocalClientInfo, CClientInfo* pTargetClientInfo )
{
return ( pLocalClientInfo->team ) != pTargetClientInfo->team );
}
Never knew how to find out which is the localClientInfo as i didnt log its index. Incase its not always 0 i would have to iterate through the clientinfos until i find the local one.. save its team.. after iterate through all again to validate the teamcheck.
If there is a more simple way put me on it
|
You can grab local index here: 0x007F12C8
|
_GHOSTER_ is offline
|
|
21st November 2009, 01:20 AM
|
#8
|
|
This will work fine unless you go into a "Free For All" match then this will just show everyone as friendly for a better solution just use this:
Code:
bool bIsEnemy = ( pClient->TeamID != g_pMyClient->TeamID || pClient->TeamID == 0 );
TeamID is at 0x1C of the ClientInfo struct.
|
K@N@VEL is offline
|
|
21st November 2009, 07:11 AM
|
#9
|
:3 1337 :3
|
Thx mAn i was checking it in à really shity way
__________________
hai
|
Wieter20 is offline
|
|
22nd November 2009, 11:40 PM
|
#10
|
Join Date: Dec 2006
Posts: 45
Reputation: -155
Rep Power: 0
Level up: 22%, 858 Points needed |
|
So can this make teammates kill-able in a non-hardcore game?
|
echo1990 is offline
|
|
23rd November 2009, 12:08 AM
|
#11
|
|
Quote:
Originally Posted by echo1990
So can this make teammates kill-able in a non-hardcore game?
|
I wish it could :P
But no, this is just a teamcheck with return's if the player is on your team or not, or returns what the teamid is as in the first post.
__________________
A good programmer is someone who looks both ways before crossing a one-way street. - Doug Linder
And God said "Let there be light." But then the program crashed because he was trying to access the 'light' property of a NULL universe pointer.
The three most dangerous things are a programmer with a soldering iron, a manager who codes, and a user who gets ideas.
|
Credzis is offline
|
|
Similar Threads
|
Thread |
Thread Starter |
Forum |
Replies |
Last Post |
Teamcheck
|
haxing |
Call of Duty 4: Modern Warfare |
12 |
9th April 2008 07:15 PM |
All times are GMT. The time now is 01:18 AM.
|
|
sponsored advertisement |
| | |