Raised This Month: $32 Target: $400
 8% 

Solved [The Specialists 3.0] Force team transfer?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hellmoss
Senior Member
Join Date: Oct 2009
Location: ZOMBIE PLAGUE
Old 11-20-2021 , 12:48   [The Specialists 3.0] Force team transfer?
Reply With Quote #1

Hello, I'm working on a mod and I need this feature to manage the bots in teamplay mode. I can't really find any info on here about team transfer. I looked at the AMXX API but found nothing useful. Does anyone have any idea how I can go about this? Thanks!

In usermsg.cpp from tsx module source code there is a variable which is assigned to the team.

Code:
	if ( mPlayer->teamId || is_theonemode  ){
		if ( (mPlayer->teamId == pAttacker->teamId ) && (mPlayer != pAttacker) )
			TA = 1;
	}
If I created my own function and recompiled the module would a simple
Code:
mPlayer->teamId=1/2/3..etc
be enough? I'm unable to compile from the computer I'm using atm.

What I'm trying to achieve is to force the bots to enter in a certain team and not auto-join randomly.
__________________
Quote:
Originally Posted by Kakarot47 View Post
There is no bug. with 100% gurenty

Last edited by hellmoss; 12-13-2021 at 18:11.
hellmoss is offline
hellmoss
Senior Member
Join Date: Oct 2009
Location: ZOMBIE PLAGUE
Old 11-25-2021 , 17:26   Re: [The Specialists 3.0] Force team transfer?
Reply With Quote #2

https://forums.alliedmods.net/showthread.php?t=335317
__________________
Quote:
Originally Posted by Kakarot47 View Post
There is no bug. with 100% gurenty
hellmoss is offline
STekLyAToR
Member
Join Date: May 2016
Old 12-01-2021 , 09:45   Re: [The Specialists 3.0] Force team transfer?
Reply With Quote #3

You can just do it using get_user_pdata I guess. You just should bruteforce valid offset for it.
STekLyAToR is offline
hellmoss
Senior Member
Join Date: Oct 2009
Location: ZOMBIE PLAGUE
Old 12-01-2021 , 13:23   Re: [The Specialists 3.0] Force team transfer?
Reply With Quote #4

Quote:
Originally Posted by STekLyAToR View Post
You can just do it using get_user_pdata I guess. You just should bruteforce valid offset for it.
I thought of the same thing but I don't know how to find the right offset...



[UPDATE]

Code:
static cell AMX_NATIVE_CALL set_team(AMX *amx, cell *params)
{
	int id = params[1];

	if (id<1 || id>gpGlobals->maxClients)
	{ 
		MF_LogError(amx, AMX_ERR_NATIVE, "Player %d is not valid", id);
		return 0;
	}

	CPlayer *pPlayer = GET_PLAYER_POINTER_I(id);
	
	if (!pPlayer->ingame)
	{
		return 0;
	}

	// this prints in hlds console
	MF_Log("plr_id=%d, team=%d", id, pPlayer->teamId);

	//bruteforce variable which holds team id
	pPlayer->teamId=4;

	// pPlayer->teamId=2; //(int)params[2];

	return 0;
}
I managed to create my own function and compile tsx module but the trick I thought would work didn't...

Yes, I tried while my player in-game is dead.
Yes, I printed the teamId variable before forcing it to 4 and it prints out my current and correct team id.

Printed integer offsets from 0 to 1000 (anything above 1000 returns 0), nothing equals 3, which is the team I chose...
Code:
	for(new i=get_pcvar_num(cvar_min);i<get_pcvar_num(cvar_max);i++)
	{
		server_cmd("echo pdata num (%d) = %d", i, get_pdata_int(id, i))
	}
__________________
Quote:
Originally Posted by Kakarot47 View Post
There is no bug. with 100% gurenty

Last edited by hellmoss; 12-02-2021 at 14:23. Reason: update
hellmoss is offline
hellmoss
Senior Member
Join Date: Oct 2009
Location: ZOMBIE PLAGUE
Old 12-07-2021 , 15:16   Re: [The Specialists 3.0] Force team transfer?
Reply With Quote #5

Bump
__________________
Quote:
Originally Posted by Kakarot47 View Post
There is no bug. with 100% gurenty
hellmoss is offline
hellmoss
Senior Member
Join Date: Oct 2009
Location: ZOMBIE PLAGUE
Old 12-13-2021 , 17:40   Re: [The Specialists 3.0] Force team transfer?
Reply With Quote #6

Bump
__________________
Quote:
Originally Posted by Kakarot47 View Post
There is no bug. with 100% gurenty
hellmoss is offline
Reply



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 21:35.


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