PDA

View Full Version : Auto-Alltalk


ferret
01-02-2008, 12:47
Auto-Alltalk
Version 1.0

By: ferret!

Description

This plugin will automatically adjust the value of sv_alltalk based on the number of connected players. It can work both ways, either turning on OR off. Please be aware that when running this plugin you will lose control of sv_alltalk, as the plugin will automatically reset the convar to what it believes should be the value. You can stop this by setting the limit to 0.

Cvars

sm_aatlimit
Number of players required to change alltalk. Defaults to 10. Maximum of 64. Set to 0 to disable.
sm_aatmode

Sets whether alltalk is enabled or disabled when the limit is reached. Default is "0".
When set to 0, alltalk will be disabled when the limit is reached, and enabled when you fall below the limit.
When set to 1, alltalk will be enabled when the limit is reached, and disabled when you fall below the limit.Change Log:

Version 1.0
Release
Bugs, Requests, Translations, or Other Issues

Post bugs here. I do not plan to make any major changes to this plugin or heavily support it. As long as it works, it works. If it breaks, I'll fix it.

ferret
01-02-2008, 12:49
This plugin compiles. I wrote it at lunch out of boredom. I'm 99.9999999999% confident that it works, but it hasn't actually been tested. It's not exactly rocket science, just fulfilling a small request:

http://forums.alliedmods.net/showthread.php?t=64938

Freelancer
01-02-2008, 18:45
Thanks ferret

Neo_Bahamut_19
01-02-2008, 20:07
as I have already said in my request thread for this, thank you, this helps a lot, i love having fun in small groups, but i also love talking to the team in large groups

Edit: Uploaded it to my server, and may I make a suggestion for a possible update, shouldn't be hard, but mabe make something that flashes up in the 3 admin chat display areas saying something to the tune of "18 Players Reached. Alltalk Will Now Be Turned Off." or something to that accord when the players is reached for it to be turned on or off. Also, I would put a toggle in the admin menu to turn this script on and off so that admins can override it ;)

ferret
01-03-2008, 09:49
If someone wants to make a more advanced version, they are welcome to take this as a start and add to it. I may add a message saying whether or not Alltalk has been turned on/off.

ratty
01-06-2008, 15:54
I'm working on this now, using as an excuse to learn sourcepawn.
Rather than hijack this thread, I started another thread. I'll appreciate your input.

http://forums.alliedmods.net/showthread.php?p=571089

Also, in OnClientDisconnect, the SetConVarBool sets alltalk to mode, shouldn't it be !mode?

tkaway69
01-09-2008, 23:51
Hello "Ferret". Any idea what this error means?

L 01/09/2008 - 20:59:38: [SM] Plugin encountered error 8: Not enough space on the stack
L 01/09/2008 - 20:59:38: [SM] Debug mode is not enabled for "autoalltalk.smx"
L 01/09/2008 - 20:59:38: [SM] To enable debug mode, edit plugin_settings.cfg, or type: sm plugins debug 6 on

StevenT
01-23-2008, 11:49
L 01/19/2008 - 13:48:56: SourceMod error session started
L 01/19/2008 - 13:48:56: Info (map "emp_vehicletraining_rc4") (file "errors_20080119.log")
L 01/19/2008 - 13:48:56: [SM] Plugin encountered error 8: Not enough space on the stack
L 01/19/2008 - 13:48:56: [SM] Native "GetConVarBool" encountered a generic error.
L 01/19/2008 - 13:48:56: [SM] Displaying call stack trace for plugin "autoalltalk.smx":
L 01/19/2008 - 13:48:56: [SM] [0] Line 108, /home/groups/alliedmodders/forums/files/1/4/0/6/8/22586.attach::ConVarChange_Alltalk()
L 01/19/2008 - 14:15:24: [SM] Plugin encountered error 8: Not enough space on the stack
L 01/19/2008 - 14:15:24: [SM] Native "GetConVarInt" encountered a generic error.
L 01/19/2008 - 14:15:24: [SM] Displaying call stack trace for plugin "autoalltalk.smx":
L 01/19/2008 - 14:15:24: [SM] [0] Line 95, /home/groups/alliedmodders/forums/files/1/4/0/6/8/22586.attach::ConVarChange_Alltalk()
L 01/19/2008 - 14:16:12: [SM] Plugin encountered error 8: Not enough space on the stack
L 01/19/2008 - 14:16:12: [SM] Native "GetConVarInt" encountered a generic error.
L 01/19/2008 - 14:16:12: [SM] Displaying call stack trace for plugin "autoalltalk.smx":
L 01/19/2008 - 14:16:12: [SM] [0] Line 95, /home/groups/alliedmodders/forums/files/1/4/0/6/8/22586.attach::ConVarChange_Alltalk()
L 01/19/2008 - 14:53:45: Error log file session closed.
L 01/19/2008 - 14:53:45: SourceMod error session started
L 01/19/2008 - 14:53:45: Info (map "emp_vehicletraining_rc4") (file "errors_20080119.log")
L 01/19/2008 - 14:53:45: [SM] Plugin encountered error 8: Not enough space on the stack
L 01/19/2008 - 14:53:45: [SM] Native "GetConVarBool" encountered a generic error.
L 01/19/2008 - 14:53:45: [SM] Displaying call stack trace for plugin "autoalltalk.smx":
L 01/19/2008 - 14:53:45: [SM] [0] Line 108, /home/groups/alliedmodders/forums/files/1/4/0/6/8/22586.attach::ConVarChange_Alltalk()
L 01/19/2008 - 14:54:41: [SM] Plugin encountered error 8: Not enough space on the stack
L 01/19/2008 - 14:54:41: [SM] Native "GetConVarInt" encountered a generic error.
L 01/19/2008 - 14:54:41: [SM] Displaying call stack trace for plugin "autoalltalk.smx":
L 01/19/2008 - 14:54:41: [SM] [0] Line 95, /home/groups/alliedmodders/forums/files/1/4/0/6/8/22586.attach::ConVarChange_Alltalk()
L 01/19/2008 - 14:55:09: [SM] Plugin encountered error 8: Not enough space on the stack
L 01/19/2008 - 14:55:09: [SM] Native "GetConVarInt" encountered a generic error.
L 01/19/2008 - 14:55:09: [SM] Displaying call stack trace for plugin "autoalltalk.smx":
L 01/19/2008 - 14:55:09: [SM] [0] Line 95, /home/groups/alliedmodders/forums/files/1/4/0/6/8/22586.attach::ConVarChange_Alltalk()
L 01/19/2008 - 15:14:54: Error log file session closed.



thx for the nice plugin ferret, doesnt crash my server and works like a charm, but if you have time, take a look at these errors :) no idea what it means ^^

oh btw is it possible to add a PrintToAllChat saying sv_alltalk has been turned off or on , just so players know when that happens

i didnt even know when alltalk was on or off, i kept on talking with the idea of having the other state of alltalk lol

Neo_Bahamut_19
01-24-2008, 01:59
another thing is that sometimes it doesn't turn it off either, so it will hit 20 players (my trigger) and then 6 people will drop off and it will stay with alltalk on...

StevenT
01-29-2008, 13:26
another thing is that sometimes it doesn't turn it off either, so it will hit 20 players (my trigger) and then 6 people will drop off and it will stay with alltalk on...

To go into detail in the above post,
this auto-alltalk doesnt change on-the-fly, whenever there is a mapchange it checks for how many players are connecting (status) and will force sv_alltalk to that value you have set fot that amount of players.
So whenever the sv_alltalk value should change during the same map, it won't, until mapchange occurs.
You also cannot override sv_alltalk with admin power, the script keeps overriding the value that the admin wants to change.
(So atm you just need to turn of the plugin or unload it if you want to override)

mryoung
04-13-2008, 05:41
hi there !

I'm pretty new to sourcemod and even more new to sourcepawn language ...

I'm pretty interested by this plugin, but, if i'm not wrong, i think there an error in the sourcecode ...
Indeed, when a player disconnects, you check if we reach the "reverse" limit (means, by default, we have less than 10 players)...
If it's the case, you set sv_alltalk to the sm_aatmode value instead of setting it to the "reverse" value of sm_aatmode ...

Imho, the OnClientDisconnect method should be like the following:
public OnClientDisconnect(client)
{
if (GetConVarInt(g_Cvar_Limit))

{

new cur = GetClientCount(false);



if (cur < GetConVarInt(g_Cvar_Limit))

{

SetConVarBool(g_Cvar_Alltalk, !GetConVarBool(g_Cvar_Mode));

}

}
}

Can you confirm it ?

Thanks in advance for your answer.

cya

VictorOfSweden
08-30-2008, 18:49
If someone wants to make a more advanced version, they are welcome to take this as a start and add to it.
I did, and here's the result. Enjoy!

curlefry
09-06-2008, 18:24
I did, and here's the result. Enjoy!

Ferret's version doesn't work for me at all. It spams sv_alltalk "1" 2 million times in chat/console.

You're works great, but 1 question:

Can you make it to where Alltalk goes back to the previous setting when the limit goes back under what's set?

And you need to add a minimum and maximum value for sm_spa_atlmit...

bangboom
09-28-2008, 12:51
Awesome! I have been looking for this, thanks Ferret.

DontWannaName
11-17-2008, 21:58
Ferrets wont turn all talk off after the limit and swedens wont make the auto config with cvars in it and gives me an error that it needs translation files.

sneaK
05-16-2015, 21:16
I updated this to work with CS:GO, based off of VictorofSweden's update. I haven't gotten a chance to test it, but it should work no problem.

cvars:
sm_spa_atlimit - Number of players needed to toggle alltalk (0 = turn off). Default: 16
sm_spa_atlimitmode - When the player limit is reached, turn alltalk on/off (1/0). Default: 0
sm_spa_atroundend - Turn toggling of alltalk at round end on/off (1/0). Default: 1
sm_spa_atroundendmode - When a round is over, turn alltalk on/off (1/0). Default: 1

AriaXoria
05-28-2015, 16:52
I updated this to work with CS:GO, based off of VictorofSweden's update. I haven't gotten a chance to test it, but it should work no problem.

cvars:
sm_spa_atlimit - Number of players needed to toggle alltalk (0 = turn off). Default: 16
sm_spa_atlimitmode - When the player limit is reached, turn alltalk on/off (1/0). Default: 0
sm_spa_atroundend - Turn toggling of alltalk at round end on/off (1/0). Default: 1
sm_spa_atroundendmode - When a round is over, turn alltalk on/off (1/0). Default: 1

Is this supposed to work on the fly, or at the beginning of the next map when conditions are met?

sneaK
05-29-2015, 02:26
Is this supposed to work on the fly, or at the beginning of the next map when conditions are met?

On the fly. Once the conditions are met, sv_alltalk will change to whatever you set it to.

z282846139
09-09-2018, 08:49
I updated this to work with CS:GO, based off of VictorofSweden's update. I haven't gotten a chance to test it, but it should work no problem.

cvars:
sm_spa_atlimit - Number of players needed to toggle alltalk (0 = turn off). Default: 16
sm_spa_atlimitmode - When the player limit is reached, turn alltalk on/off (1/0). Default: 0
sm_spa_atroundend - Turn toggling of alltalk at round end on/off (1/0). Default: 1
sm_spa_atroundendmode - When a round is over, turn alltalk on/off (1/0). Default: 1

Is this plugin works on L4D2?

eliteroyal
07-06-2019, 04:44
SneaK, can you modifi it so at every begining of map players would vote if they want alltalk 1 or 0 ? csgo server.

eyal282
03-12-2021, 14:01
Doesn't work for CS:GO, likely due to sv_full_alltalk needing a fix.