AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [TF2] Jarate Teammates (https://forums.alliedmods.net/showthread.php?t=130868)

simoneaolson 06-28-2010 13:14

[TF2] Jarate Teammates
 
2 Attachment(s)
Description
Ever wanted to jarate your own teammates? Maybe to troll or just get attention? Now you can do that. Note that minicrits are NOT given from the opposite team when your teammate is jarated.

Cvars
tf_jar_teammates_version - Current plugin version
tf_jar_teammates_enabled - Enabled/Disable the plugin (bool) Def: 1
tf_jar_teammates_distance - Max distance a player can be from jarate to be covered in piss (float) Def: 750.0
tf_jar_teammates_time - Time in seconds to cover player in piss (float) Def: 7.0

Update History
v1.0 - Initial release
v1.01 - Fixed a bug where no mini-crits are taken (when using jarate on other team)
v1.02 -
* Added admin functionality
* New CVARs
* Fixed a bug allowing jarated teammates to take minicrits
v1.03 - Removed minicrit damage on teammates
v1.04 - Optimized plugin
v1.05 -
* Fixed CVAR resetting bug
* Added spy jarated sound effects


Requirements
* Sourcemod 1.3.3 or Greater
* SDKHooks extension, get it here: http://code.google.com/p/tsunami-pro...downloads/list
* Note that the plugin will not compile without sdkhooks.inc, so please download the .smx instead


SCREENS
[IMG]http://img208.**************/img208/8155/hl22010070111215745.png[/IMG]

Sreaper 06-29-2010 21:59

Re: [TF2] Jarate Teammates
 
Lol sweet plugin! Thanks!

Afronanny 06-29-2010 23:22

Re: [TF2] Jarate Teammates
 
Suggestions for source code improvement:
Not required, but good practice to put semicolons at the end of each statement.

Instead of making the array size 40, set it to MAXPLAYERS
PHP Code:

new bool:jarated[MAXPlAYERS]; 

In the loop in OnMapStart, use MaxClients instead of hardcoding 40 (TF2 doesn't even go up to 40)
PHP Code:

for (new 1<= MaxClientsi++) 

Changing events around will not change whether or not it is a minicrit, since the damage has already been taken by the time the event is fired. Events are post-fact, only notifications.

Possibly make a global variable for enabled:
PHP Code:

new g_bEnabled true;
public 
OnPluginStart()
{
    
Cv_PluginEnabled CreateConVar(....);
    
HookConVarChange(Cv_PluginEnabledConVarChanged_Enabled);
}
public 
ConVarChanged_Enabled(Handle:convar, const String:oldValue[], const String:newValue[])
{
    
g_bEnabled GetConVarBool(Cv_PluginEnabled);


And do the same for the rest of the cvars, so you don't have to repeatedly look up the convar's value, all you need to do is check the variable, which is changed whenever the convar is changed.

simoneaolson 06-30-2010 01:18

Re: [TF2] Jarate Teammates
 
Quote:

Originally Posted by Afronanny (Post 1224282)
Changing events around will not change whether or not it is a minicrit, since the damage has already been taken by the time the event is fired. Events are post-fact, only notifications.

Thanks for the suggestions, i'll be sure to update it with most of these. However your statement regarding the even hook is incorrect. this plugins uses the EventHookMode_Pre option meaning that the hook is called before the event happens in the engine. I have tested it myself, the players do not take minicrits.

Sreaper 06-30-2010 01:36

Re: [TF2] Jarate Teammates
 
Are you supposed to be able to see jarate on your teammate when you throw it at them? Also does friendlyfire need to be on for this to work? I can't seem to get this to work. :/

simoneaolson 06-30-2010 01:50

Re: [TF2] Jarate Teammates
 
Yes you are supposed to see it, also friendly fire does not need to be on. However, the plugin does not work well when you throw jarate from long distances or if you directly hit a teammate. You could also try increasing the tf_jar_teammates_distance cvar to 900.0 or so to help this. It also could be that the plugin is not detecting you as an admin. Are you sure that you have it configured correctly?

Sreaper 06-30-2010 02:14

Re: [TF2] Jarate Teammates
 
Actually I just placed the smx in the plugins folder. It just plainly doesn't seem to be working for me. :/ I haven't changed anything on the plugin either.

simoneaolson 06-30-2010 02:50

Re: [TF2] Jarate Teammates
 
What exactly are you testing the plugin on? Bots? Other players?

Sreaper 06-30-2010 03:59

Re: [TF2] Jarate Teammates
 
Other players in game. Just threw the plugin in, changed levels tried it. Nothing happens. Restarted the server for an unrelated matter, tried it, nothing happened.

Afronanny 06-30-2010 10:11

Re: [TF2] Jarate Teammates
 
Quote:

Originally Posted by simoneaolson (Post 1224313)
Thanks for the suggestions, i'll be sure to update it with most of these. However your statement regarding the even hook is incorrect. this plugins uses the EventHookMode_Pre option meaning that the hook is called before the event happens in the engine. I have tested it myself, the players do not take minicrits.

They don't appear to take minicrits to you, because the event being shown to the client has minicrits set to false. The damage will still be that of a minicrit, you just don't see the "Minicrit" sprite float out of them.

Remember, events are simply notifications to say what happened. A pre hook means that you can change what is reported, but even in a pre hook, the damage has already been dealt; you can't change what actually happened.


All times are GMT -4. The time now is 11:35.

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