Raised This Month: $ Target: $400
 0% 

Looking for a 'No High Five Taunt' Extension/plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Professor Chaos
Junior Member
Join Date: Nov 2011
Location: The People's Republic of
Old 01-08-2012 , 13:41   Looking for a 'No High Five Taunt' Extension/plugin
Reply With Quote #1

Anyone know of one of these?

I'd rather not have to re-edit my map to stop my players from using the taunt to glitch into the opposing team's base. Having a way to stop the taunt from working would be simpler.

I'm just curious to see if anyone is actually working on one, or if they know of one that's already been made before i look into making my own.
__________________
Professor Chaos is offline
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 01-08-2012 , 13:48   Re: Looking for a 'No High Five Taunt' Extension/plugin
Reply With Quote #2

You can block it with the TF2Items extension:
PHP Code:
#include <tf2items>

#define DEF_HIGHFIVE 167

public Action:TF2Items_OnGiveNamedItem(clientString:classname[], itemDefinitionIndex, &Handle:hItem)
{
    if(
itemDefinitionIndex == DEF_HIGHFIVE)
    {
        return 
Plugin_Handled;
    }
    
    return 
Plugin_Continue;

__________________

Last edited by pheadxdll; 01-08-2012 at 13:48.
pheadxdll is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 01-08-2012 , 14:02   Re: Looking for a 'No High Five Taunt' Extension/plugin
Reply With Quote #3

Quote:
Originally Posted by pheadxdll View Post
You can block it with the TF2Items extension:
PHP Code:
#include <tf2items>
 
#define DEF_HIGHFIVE 167
 
public Action:TF2Items_OnGiveNamedItem(clientString:classname[], itemDefinitionIndex, &Handle:hItem)
{
    if(
itemDefinitionIndex == DEF_HIGHFIVE)
    {
        return 
Plugin_Handled;
    }
 
    return 
Plugin_Continue;

I just had to pop in and say thank you for this little snippet. It'll come in quite handy
404UserNotFound is offline
Professor Chaos
Junior Member
Join Date: Nov 2011
Location: The People's Republic of
Old 01-08-2012 , 14:34   Re: Looking for a 'No High Five Taunt' Extension/plugin
Reply With Quote #4

Well, i appreciate your help, but tf2items seems to do nothing but crash my server.

I had the script compiled and loaded with no problem, but within moments of starting the server, it crashed repeatedly.

I guess i'll have to wait til i can load tf2items without crushing my server.
__________________
Professor Chaos is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 01-08-2012 , 15:51   Re: Looking for a 'No High Five Taunt' Extension/plugin
Reply With Quote #5

Quick query. If I was to want to add more items to this to block, would I use "else if"? For example

PHP Code:
#include <tf2items>
 
#define DEF_HIGHFIVE 167
#define DEF_EXAMPLE 169
 
public Action:TF2Items_OnGiveNamedItem(clientString:classname[], itemDefinitionIndex, &Handle:hItem)
{
    if(
itemDefinitionIndex == DEF_HIGHFIVE)
    {
        return 
Plugin_Handled;
    }
 
    else if(
itemDefinitionIndex == DEF_EXAMPLE)
    {
        return 
Plugin_Handled;
    }
 
    return 
Plugin_Continue;

Or would I just go with continual "if"s like so?:

PHP Code:
#include <tf2items>
 
#define DEF_HIGHFIVE 167
#define DEF_EXAMPLE 169
 
public Action:TF2Items_OnGiveNamedItem(clientString:classname[], itemDefinitionIndex, &Handle:hItem)
{
    if(
itemDefinitionIndex == DEF_HIGHFIVE)
    {
        return 
Plugin_Handled;
    }
 
    if(
itemDefinitionIndex == DEF_EXAMPLE)
    {
        return 
Plugin_Handled;
    }
 
    return 
Plugin_Continue;

404UserNotFound is offline
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 01-08-2012 , 16:57   Re: Looking for a 'No High Five Taunt' Extension/plugin
Reply With Quote #6

In this example, it doesn't matter because it returns right after but I would go with else if because the first statement excludes the second.
You could also do these but they are essentially the same. Do whatever you like best:
PHP Code:
switch(itemDefinitionIndex)
{
     case 
DEF_HIGHFIVEDEF_EXAMPLE:
     {
          return 
Plugin_Handled;
     }
}
...
if(
iItemDefinitionIndex == DEF_HIGHFIVE || iItemDefinitionIndex == DEF_EXAMPLE)
{
     return 
Plugin_Handled;

__________________

Last edited by pheadxdll; 01-08-2012 at 16:57.
pheadxdll is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 01-08-2012 , 17:09   Re: Looking for a 'No High Five Taunt' Extension/plugin
Reply With Quote #7

Quote:
Originally Posted by pheadxdll View Post
In this example, it doesn't matter because it returns right after but I would go with else if because the first statement excludes the second.
You could also do these but they are essentially the same. Do whatever you like best:
PHP Code:
switch(itemDefinitionIndex)
{
     case 
DEF_HIGHFIVEDEF_EXAMPLE:
     {
          return 
Plugin_Handled;
     }
}
...
if(
iItemDefinitionIndex == DEF_HIGHFIVE || iItemDefinitionIndex == DEF_EXAMPLE)
{
     return 
Plugin_Handled;

Beauty! Thanks for the additional info, pheadxdll! I was actually trying to remember if the proper way to code in what you did above was:
"if(iItemDefinitionIndex == DEF_HIGHFIVE || iItemDefinitionIndex == DEF_EXAMPLE)"
- or -
"if(iItemDefinitionIndex == DEF_HIGHFIVE | iItemDefinitionIndex == DEF_EXAMPLE)".

Turns out it's the one that has || .

The reason this is going to come in handy for me is because I'm working on a plugin similar to UnlockBlock/whatever other "Vanilla server" plugins are on here. But with mine, I'm creating it with the XBOX 360 "Orange Box" version of TF2 in mind. I've got a bunch of things to figure out, such as:

1. How to prevent Engineers from upgrading teleporters & dispensers (No clue how to do this...)

2. How to prevent players from using "action items" (You pretty much just showed me how to do this, phea )

3. How to prevent unlockable weapons from being used (VS Saxton Hale uses a "weapon replacement" method to replace certain weapons with nerfed versions of those weapons, so I'm going to use the method VSH uses for removing unlockables, unless UnlockBlock ever gets updated...)

3a. Add in coding to give Pyro's a stock Flamethrower that can't airblast (Airblasting isn't in the XBOX 360 version of TF2), and Demomen a Stickybomb launcher that can lay a max of 6 stickies (I think the max # is 6 on the XBOX 360 version of TF2).

And many other things.

Last edited by 404UserNotFound; 01-08-2012 at 17:12.
404UserNotFound is offline
napalm00
Veteran Member
Join Date: Jun 2011
Location: Italy, sadly
Old 01-08-2012 , 17:10   Re: Looking for a 'No High Five Taunt' Extension/plugin
Reply With Quote #8

Use the switch that is more efficient, too
__________________
napalm00 is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 01-08-2012 , 17:18   Re: Looking for a 'No High Five Taunt' Extension/plugin
Reply With Quote #9

Nevermind, I'm an idiot and figured this out on my own (I hope I did, anyway)

PHP Code:
PrepareItemHandle(weaponclassnameweaponidnumber"attributes"); 
I think that's correct. Now I can get a move on on my own custom Vanilla server/no unlockable weapon plugin.

Last edited by 404UserNotFound; 01-08-2012 at 19:52.
404UserNotFound is offline
Zephyrus
Cool Pig B)
Join Date: Jun 2010
Location: Hungary
Old 01-08-2012 , 20:16   Re: Looking for a 'No High Five Taunt' Extension/plugin
Reply With Quote #10

Quote:
Originally Posted by napalm00 View Post
Use the switch that is more efficient, too
and slower...
__________________
Taking private C++/PHP/SourcePawn requests, PM me.
Zephyrus 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 01:53.


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