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

[L4D1/2] Vocalize Fatigue 2


Post New Thread Reply   
 
Thread Tools Display Modes
Mr. Zero
Veteran Member
Join Date: Jun 2009
Location: Denmark
Old 03-01-2011 , 08:59   Re: [L4D2] Vocalize Fatigue 2
Reply With Quote #11

Edited and moved post content to post 3.

Last edited by Mr. Zero; 03-03-2011 at 19:43.
Mr. Zero is offline
irogue
Senior Member
Join Date: Jan 2011
Location: Australia
Old 03-03-2011 , 00:49   Re: [L4D2] Vocalize Fatigue 2
Reply With Quote #12

Stunned you really have thought out this plugin well, going to give this a shot later on tonight hopefully get some interesting results

Thx for sharing Mr. Zero
irogue is offline
Mr. Zero
Veteran Member
Join Date: Jun 2009
Location: Denmark
Old 03-18-2011 , 09:28   Re: [L4D1/2] Vocalize Fatigue 2
Reply With Quote #13

Here is a little script of mine.

This stops Survivors from vocalizing about specials that ain't active. Such as Survivors screaming TANNNK! when hes not even spawned yet. Same with the Witch.

Only works on COOP.

PHP Code:
#include <sourcemod>
#include <sdktools>
#include "vocalizefatigue"

public Plugin:myinfo 
{
    
name "Vocalize Warnings",
    
author "Mr. Zero",
    
description "Stops Survivors vocalizing warnings about specials that aint active.",
    
version "1.0",
    
url "http://forums.alliedmods.net/showthread.php?t=150357"
}

public 
OnPluginStart()
{
    
/* */
}

public 
Action:L4D_OnClientVocalize(client, const String:vocalize[], bool:byPlugin)
{
    if (
byPlugin) return Plugin_Continue// If client was asked to vocalize by a plugin, allow

    
if (StrEqual(vocalize"playeralsowarntank") || (StrEqual(vocalize"playerwarntank"))) // Player is trying to warn about a tank
    
{
        if (!
IsAnyTankAlive()) // If no tanks are alive
        
{
            return 
Plugin_Handled// Stop vocalization
        
}
    }

    if (
StrEqual(vocalize"playeralsowarnwitch") || (StrEqual(vocalize"playerwarnwitch"))) // Player is trying to warn about a witch
    
{
        if (!
IsAnyWitchAlive()) // If no witches are alive
        
{
            return 
Plugin_Handled// Stop vocalization
        
}
    }

    return 
Plugin_Continue// Allow vocalization
}

static 
bool:IsAnyTankAlive()
{
    
decl String:name[32];
    for (new 
client 1client <= MaxClientsclient++)
    {
        if (!
IsClientInGame(client) || !IsFakeClient(client)) continue;
        if (!
IsPlayerAlive(client) || GetClientHealth(client) < 1) continue;

        
GetClientName(clientname32);
        if (
StrContains(name"tank"false) != -1)
        {
            return 
true;
        }
    }
    return 
false;
}

static 
bool:IsAnyWitchAlive()
{
    return (
FindEntityByClassname(-1"witch") > 0);

Attached Files
File Type: smx vocalizewarnings.smx (2.8 KB, 317 views)
Mr. Zero is offline
TastyCheese
Member
Join Date: Nov 2010
Old 03-19-2011 , 07:03   Re: [L4D1/2] Vocalize Fatigue 2
Reply With Quote #14

Awesome! I don't see the option to add additional fatigue when someone tries spamming while fatigued though. Is that going to be added later on? And support for local servers? I don't understand why it doesn't support them D:
TastyCheese is offline
Mr. Zero
Veteran Member
Join Date: Jun 2009
Location: Denmark
Old 03-23-2011 , 17:04   Re: [L4D1/2] Vocalize Fatigue 2
Reply With Quote #15

It just often becomes "messy" when the client is both a player and the server.

It's not that I don't want to support client listening servers, it just a hassle coding "exceptions" here and there for when player is server.

But if you want to re-enable the possiblity to run on client listening servers, go to line 237 in main.sp and find this snippet:

PHP Code:
    if (!IsDedicatedServer())
    {
        
strcopy(errorerr_max"Plugin only support dedicated servers");
        return 
false// Plugin does not support client listen servers, return
    

Simple remove the whole snippet and it will load on client listen servers. However be warned, I coded this for dedicated servers. Might be a ton of issues.

As for adding more fatigue while already in fatigue, I might do it later on but I can't really see why you would want that.

Just increase it on the vocalize command they are using. If people keep laughing like mad, then set its fatigue to something like 20 seconds.
Mr. Zero is offline
adrianman
Senior Member
Join Date: Sep 2010
Old 03-30-2011 , 09:12   Re: [L4D1/2] Vocalize Fatigue 2
Reply With Quote #16

sometimes server crashes when using the vocalize gag command
adrianman is offline
matrixmark
Senior Member
Join Date: Jun 2010
Old 03-31-2011 , 08:31   Re: [L4D1/2] Vocalize Fatigue 2
Reply With Quote #17

How do you make admins immune to this?

I saw the the first few lines in the config that will probably do what Im looking for but I dont know what immunity levels to set (def is 0) if this is the correct thing.

thanks

Mark
matrixmark is offline
TastyCheese
Member
Join Date: Nov 2010
Old 03-31-2011 , 11:05   Re: [L4D1/2] Vocalize Fatigue 2
Reply With Quote #18

Quote:
Originally Posted by matrixmark View Post
How do you make admins immune to this?

I saw the the first few lines in the config that will probably do what Im looking for but I dont know what immunity levels to set (def is 0) if this is the correct thing.

thanks

Mark
Go to Steam\steamapps\common\left 4 dead 2\left4dead2\addons\sourcemod\configs, find admins_simple.ini and open it with a text editor, then just follow the instructions there. If you set one admin to 54 immunity, and another one to 56 while the immunity level in the plugin cfg is 55, only the one that's level 56 will be immune. I hope that wasn't too confusing

Last edited by TastyCheese; 03-31-2011 at 11:08.
TastyCheese is offline
matrixmark
Senior Member
Join Date: Jun 2010
Old 03-31-2011 , 11:26   Re: [L4D1/2] Vocalize Fatigue 2
Reply With Quote #19

owow that does make sense!! thanks dude very much
matrixmark is offline
Mr. Zero
Veteran Member
Join Date: Jun 2009
Location: Denmark
Old 03-31-2011 , 14:25   Re: [L4D1/2] Vocalize Fatigue 2
Reply With Quote #20

Quote:
Originally Posted by adrianman View Post
sometimes server crashes when using the vocalize gag command
Got any error logs?
Mr. Zero 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 09:16.


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