Raised This Month: $51 Target: $400
 12% 

Commands restricted to team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
deadmau54
AlliedModders Donor
Join Date: May 2013
Old 12-10-2017 , 08:02   Commands restricted to team
Reply With Quote #1

Is there a way to make certain commands available only to RED or BLU?

Thank you in advance.
__________________
deadmau54 is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 12-10-2017 , 11:44   Re: Commands restricted to team
Reply With Quote #2

Code:
if (GetClientTeam(client) != 2)
{
	PrintToChat(client, "Must be on red team to use this command.");
	return Plugin_Handled;
}

if (GetClientTeam(client) != 3)
{
	PrintToChat(client, "Must be on blue team to use this command.");
	return Plugin_Handled;
}
You can use the 'TF2_GetClientTeam' function as well.
Drixevel is offline
deadmau54
AlliedModders Donor
Join Date: May 2013
Old 12-10-2017 , 16:34   Re: Commands restricted to team
Reply With Quote #3

Quote:
Originally Posted by Drixevel View Post
Code:
if (GetClientTeam(client) != 2)
{
	PrintToChat(client, "Must be on red team to use this command.");
	return Plugin_Handled;
}

if (GetClientTeam(client) != 3)
{
	PrintToChat(client, "Must be on blue team to use this command.");
	return Plugin_Handled;
}
You can use the 'TF2_GetClientTeam' function as well.
Thank you!
__________________
deadmau54 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 06:47.


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