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

Set tf_max_voice_speak_delay -1 only for donors


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OddworldCrash
Member
Join Date: May 2013
Location: Switzerland
Old 07-20-2014 , 09:32   Set tf_max_voice_speak_delay -1 only for donors
Reply With Quote #1

Hello,

I'm setting a server up with some cosmetic donor benefits (we all know that servers and the time we spent configuring it is expensive).

Is it possible to set the cvar "tf_max_voice_speak_delay 1.5" for default users and -1 for admins with the "a"-Tag?
Maybe there is a plugin that does a similar thing?

Thanks for your time
greetz, Oddy
__________________
http://oddynation.com
TF2 Community
OddworldCrash is offline
Send a message via Skype™ to OddworldCrash
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Old 07-20-2014 , 09:45   Re: Set tf_max_voice_speak_delay -1 only for donors
Reply With Quote #2

You can try this https://forums.alliedmods.net/showthread.php?p=2043735
__________________


dodsplugins.com - Plugins and Resources for Day of Defeat
http://twitch.tv/zadroot
Root_ is offline
OddworldCrash
Member
Join Date: May 2013
Location: Switzerland
Old 07-20-2014 , 12:23   Re: Set tf_max_voice_speak_delay -1 only for donors
Reply With Quote #3

Quote:
Originally Posted by Root_ View Post
Sadly this doesn't do the trick

Code:
L 07/20/2014 - 17:58:26: [convarfaker.smx] ConVar 'tf_max_voice_speak_delay' is not replicated
__________________
http://oddynation.com
TF2 Community
OddworldCrash is offline
Send a message via Skype™ to OddworldCrash
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 07-20-2014 , 19:14   Re: Set tf_max_voice_speak_delay -1 only for donors
Reply With Quote #4

That cvar's server-side. If you set it just as the command is hooked (since it's just before the game processes it itself) then you can override it depending on the client trying to use it; only caveat I've seen is that multiple plugins doing this can get messy, as it'll usually just be reset to 1.5 every time.

Try this, untested (although I've done this before). As you can probably tell, you'll need either the "a" admin flag, or the "voicedelay" override if it's set.
PHP Code:
public OnPluginStart()
{
    
AddCommandListener(Listener_voicemenu"voicemenu");
}

new 
Handle:cvarVoiceDelay;

public 
OnConfigsExecuted()
{
    
cvarVoiceDelay FindConVar("tf_max_voice_speak_delay");
}

public 
Action:Listener_voicemenu(client, const String:command[], args)
{
    if (
CheckCommandAccess(client"voicedelay"ADMFLAG_RESERVATION))
        
SetConVarFloat(cvarVoiceDelay, -9.9);
    else
        
SetConVarFloat(cvarVoiceDelay1.5);

Attached Files
File Type: sp Get Plugin or Get Source (voicedelayoverride.sp - 250 views - 445 Bytes)
__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)

Last edited by MasterOfTheXP; 07-20-2014 at 19:15.
MasterOfTheXP is offline
OddworldCrash
Member
Join Date: May 2013
Location: Switzerland
Old 07-21-2014 , 18:21   Re: Set tf_max_voice_speak_delay -1 only for donors
Reply With Quote #5

This is exactly what I needed. Thanks so much, it works perfectly fine!
I don't know how to thank you enough, so here's some bacon:
__________________
http://oddynation.com
TF2 Community
OddworldCrash is offline
Send a message via Skype™ to OddworldCrash
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 07-22-2014 , 12:43   Re: Set tf_max_voice_speak_delay -1 only for donors
Reply With Quote #6

Why not just set the client's netprop for next speak delay?
I think it's m_fLastPlayerTalkTime
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 07-22-2014 at 12:50.
friagram is offline
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 07-22-2014 , 16:55   Re: Set tf_max_voice_speak_delay -1 only for donors
Reply With Quote #7

Reading that datamap just seems to return 0.0...but I'm not sure. Haven't tried setting it. If it works, it would be better
__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)
MasterOfTheXP is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 07-23-2014 , 22:10   Re: Set tf_max_voice_speak_delay -1 only for donors
Reply With Quote #8

Doesn't work, though it should :/
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram 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 15:11.


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