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

Solved [CS:GO] Closing team menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
eyal282
Veteran Member
Join Date: Aug 2011
Old 03-19-2021 , 06:06   [CS:GO] Closing team menu
Reply With Quote #1

I use AddCommandListener to block jointeam. With whatever return higher than Handled, the team menu stays and I want it to close after blocking team change.

Edit: note to self: try blocking with forcing player to join his team.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334

Last edited by eyal282; 03-19-2021 at 07:58.
eyal282 is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 03-19-2021 , 07:45   Re: [CS:GO] Closing team menu
Reply With Quote #2

Making someone jointeam %i GetClientTeam(client) does not work and will not close the menu.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
SSheriFF
AlliedModders Donor
Join Date: May 2020
Location: Israel
Old 03-19-2021 , 07:53   Re: [CS:GO] Closing team menu
Reply With Quote #3

Try this cvar
PHP Code:
sv_disable_show_team_select_menu 1 
__________________
Taking small private requests (Free) and big private requests (Paid).
Contact me via Discord: WilDick#1524

My Plugins:
SSheriFF is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 03-19-2021 , 07:58   Re: [CS:GO] Closing team menu
Reply With Quote #4

Solved!

Code:
#include <sourcemod>
#include <sdktools>
#include <cstrike>

public OnPluginStart()
{
	HookEvent("player_team", Event_OnPlayerChangeTeam, EventHookMode_Pre);
}

public Action:Event_OnPlayerChangeTeam(Event:hEvent, const String:name[], bool:dontBroadcast)
{
	hEvent.SetBool("silent", true);
	SetEventBroadcast(hEvent, true); // These two lines are optional to avoid spamming team change messages in chat.
	
	new team = GetEventInt(hEvent, "team");
	
	int client = GetClientOfUserId(hEvent.GetInt("userid"));
	
	if(client == 0)
		return Plugin_Changed;
	
	Event fakeevent = CreateEvent("player_team");
	
	fakeevent.SetInt("userid", GetClientUserId(client));
	fakeevent.FireToClient(client);
	
	CancelCreatedEvent(fakeevent);
    
	if(team == CS_TEAM_SPECTATOR && IsPlayerAlive(client)) // Optional to make spectator team join kill you on the spot.
		ForcePlayerSuicide(client);
		
	return Plugin_Changed;
}
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
raj kaul
Senior Member
Join Date: Mar 2018
Location: www.lotgaming.xyz
Old 03-07-2022 , 05:27   Re: [CS:GO] Closing team menu
Reply With Quote #5

@eyal can you please check this , i am using get5 plugin bdw!!

PHP Code:
L 03/07/2022 15:51:32: [SMBlamingteammenudisable.smx
L 03
/07/2022 15:51:32: [SMCall stack trace:
L 03/07/2022 15:51:32: [SM]   [0Event.FireToClient
L 03
/07/2022 15:51:32: [SM]   [1Line 34plugin.sp::Event_OnPlayerChangeTeam
L 03
/07/2022 15:51:32: [SMException reportedSending events to fakeclients is not supported on this game (client 3)
L 03/07/2022 15:51:32: [SMBlamingteammenudisable.smx
L 03
/07/2022 15:51:32: [SMCall stack trace:
L 03/07/2022 15:51:32: [SM]   [0Event.FireToClient
L 03
/07/2022 15:51:32: [SM]   [1Line 34plugin.sp::Event_OnPlayerChangeTeam
L 03
/07/2022 15:51:32: [SMException reportedSending events to fakeclients is not supported on this game (client 4
__________________

Last edited by raj kaul; 03-07-2022 at 05:52.
raj kaul is offline
bklol
Member
Join Date: May 2019
Location: on my chair
Old 03-08-2022 , 06:05   Re: [CS:GO] Closing team menu
Reply With Quote #6

you should check IsFakeClient(GetClientUserId(client)) before fire event
bklol 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 03:55.


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