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

PTB * Team Balancer *


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nobody.aMxx
Junior Member
Join Date: Mar 2018
Old 02-16-2019 , 05:52   PTB * Team Balancer *
Reply With Quote #1

I'm using PTB...
And when spectator joins team via M menu every player kill him and he can kill anyone ( Including Teammate )...
Its using cs_set_user_team which is my other plugin using and everything works just fine,.,.
Here is transfer player code:
Code:
transferPlayer(id){

	if (!is_user_connected(id)) return
	if (isBeingTransfered[id]) return
	isBeingTransfered[id] = false
	
	new name[32], player_steamid[50], team_pre_transfer[12]
	get_user_name(id,name,31)
	get_user_authid(id, player_steamid, 49)
	get_user_team(id, team_pre_transfer, 11)
	
	if(cs_get_user_defuse(id))
     cs_set_user_defuse(id, 0);
	
	cs_set_user_team(id, (playerTeam[id]==TS) ? 2 : 1)
	cs_reset_user_model(id)

	// This must be done here or lastroundswithed will not be registered
	lastRoundSwitched[id] = roundCounter
	
	// This logs to hlds logs so Psychostats knows that the player has changed team (PS 3.X)
	//"LAntz69<9><STEAM_0:1:1895474><TERRORIST>" joined team "CT"  //This is how it will be outputted in hlds logs
	log_message("^"%s<%d><%s><%s>^" joined team ^"%s^"", 
		name, get_user_userid(id), player_steamid, team_pre_transfer, (playerTeam[id]==TS) ? "CT" : "TERRORIST" )
		
	if(get_pcvar_num(show_in_hlsw) == 1)
	{
		// This makes you able to see transfers with HLSW in the chat
		log_message("^"<><><>^" triggered ^"amx_chat^" (text ^"[PTB] Transfered %s to %s^")", 
			name, (playerTeam[id]==TS) ? "CT" : "TERRORIST" )
	}
	
#if defined PTB_DEBUG
	log_amx("Transfer player: %s lastRoundSwitched[id]: %i roundCounter:%i", name, lastRoundSwitched[id], roundCounter)
	client_print(0,print_chat,"Transfer player: %s lastRoundSwitched[id]: %i roundCounter:%i", name, lastRoundSwitched[id], roundCounter)
#endif
}
Acutally i found this:
Code:
	// He is choosing the AUTO-SELECT but he was already in game (He wants to play fair!)
	if (iNewTeam==AUTO_TEAM&&(iOldTeam==CTS||iOldTeam==TS)) {
		//say("Changing team automatically.")
		new opposingTeam = (iOldTeam==CTS) ? TS : CTS
		if (teamCounts[opposingTeam] && ( (teamCounts[opposingTeam]>=PTB_MAXSIZE)
				|| (iOldTeam==loserTeam) || (!loserTeam&&teamCounts[iOldTeam]<=teamCounts[opposingTeam])
				|| (teamCounts[opposingTeam]+1-teamCounts[iOldTeam]>=PTB_MAXDIFF)) ) {
			client_print(id,print_chat,"PTB: You have better stay in your current team...")
			return PLUGIN_HANDLED
		}
		client_print(id,print_chat,"PTB: You have been auto-assigned...")

		engclient_cmd(id,"jointeam",(opposingTeam==CTS)?"2":"1")

		return PLUGIN_HANDLED
	}

Last edited by Nobody.aMxx; 02-16-2019 at 05:55.
Nobody.aMxx is offline
deprale
Senior Member
Join Date: Oct 2018
Location: Leeds
Old 02-19-2019 , 05:51   Re: PTB * Team Balancer *
Reply With Quote #2

I think U could check if a user is alive but appertain neither to CT's or T's and just kick him.

PTB does not have this bug, you're either using an old version - or some other plugin is ****ing it up!
Please post your amxx plugins list here!
__________________
deprale 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 05:34.


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