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

[TF2] Cannot Call Medic


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
7106
Senior Member
Join Date: Jun 2013
Old 05-01-2014 , 07:01   [TF2] Cannot Call Medic
Reply With Quote #1

if there's no medic on player's team
that team's players cannot call medic
please, help me!
7106 is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 05-02-2014 , 09:31   Re: [TF2] Cannot Call Medic
Reply With Quote #2

Return plugin handled when they use voicemenu command 0 0 or whatever it is?
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 05-02-2014 , 12:23   Re: [TF2] Cannot Call Medic
Reply With Quote #3

Quote:
Originally Posted by friagram View Post
Return plugin handled when they use voicemenu command 0 0 or whatever it is?
Code:
#pragma semicolon 1
public OnPluginStart()
{
	AddCommandListener(MedicHook, "voicemenu");
}
public Action:MedicHook(client, const String:cmd[], args)
{
	new String:arg1[2],
		String:arg2[2];
	GetCmdArg(1, arg1, sizeof(arg1));
	GetCmdArg(2, arg2, sizeof(arg2));

	if (StrEqual(arg1, "0") && StrEqual(arg2, "0"))
		return Plugin_Handled;

	return Plugin_Continue;
}
not tested
Mitchell is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 05-02-2014 , 15:11   Re: [TF2] Cannot Call Medic
Reply With Quote #4

Quote:
Originally Posted by Mitchell View Post
Code:
#pragma semicolon 1
public OnPluginStart()
{
	AddCommandListener(MedicHook, "voicemenu");
}
public Action:MedicHook(client, const String:cmd[], args)
{
	new String:arg1[2],
		String:arg2[2];
	GetCmdArg(1, arg1, sizeof(arg1));
	GetCmdArg(2, arg2, sizeof(arg2));

	if (StrEqual(arg1, "0") && StrEqual(arg2, "0"))
		return Plugin_Handled;

	return Plugin_Continue;
}
not tested
Wouldn't this just always block the MEDIC! call, even if medics are present on the team?
__________________

Last edited by ddhoward; 05-02-2014 at 15:12.
ddhoward is offline
psychonic

BAFFLED
Join Date: May 2008
Old 05-02-2014 , 19:13   Re: [TF2] Cannot Call Medic
Reply With Quote #5

Some bonehead doing "voicemenu 00 00" would also go right through it and probably trigger the medic call.

Last edited by psychonic; 05-02-2014 at 19:15.
psychonic is offline
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 05-02-2014 , 19:25   Re: [TF2] Cannot Call Medic
Reply With Quote #6

But the two (really one)-character strings would just see "0", right?

Though with that said, just checking arg1[0] and arg2[0] should be sufficient, instead of using StrEqual.
__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)
MasterOfTheXP is offline
psychonic

BAFFLED
Join Date: May 2008
Old 05-02-2014 , 19:34   Re: [TF2] Cannot Call Medic
Reply With Quote #7

Quote:
Originally Posted by MasterOfTheXP View Post
But the two (really one)-character strings would just see "0", right?

Though with that said, just checking arg1[0] and arg2[0] should be sufficient, instead of using StrEqual.
In that case, "voicemenu a z" would go through and issue call medic.

StringToInt should be used to check the converted numeric value.
psychonic is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 05-03-2014 , 01:56   Re: [TF2] Cannot Call Medic
Reply With Quote #8

Or we can use AddNormalSoundHook. If the string appear to be the path to the medic sound and there is any medic in the team, return Plugin_Handled.
Will this work as well ?
__________________
Want to check my plugins ?
Arkarr is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 05-03-2014 , 02:02   Re: [TF2] Cannot Call Medic
Reply With Quote #9

No, as the MEDIC! notification still pops up in chat, and the + icon still appears above their heads.

psychonic's suggestions, when applied to Mitchell's code, is the best and simplest course of action here, provided that the code be modified to actually do what the OP requested and only disallow the call if there are no allied medics.
__________________
ddhoward is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 05-03-2014 , 02:09   Re: [TF2] Cannot Call Medic
Reply With Quote #10

Quote:
Originally Posted by ddhoward View Post
No, as the MEDIC! notification still pops up in chat, and the + icon still appears above their heads.

psychonic's suggestions, when applied to Mitchell's code, is the best and simplest course of action here, provided that the code be modified to actually do what the OP requested and only disallow the call if there are no allied medics.
Right, I forget about those two things.
__________________
Want to check my plugins ?
Arkarr 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 19:22.


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