Jump to content

Punish Voice over side chat (script needs a fix)


Calaveylon

Recommended Posts

I found a script on the gtx gaming forums  by Sgt M Everlast. It lets people type in side chat but blocks voice. after 3 times talking in side it kicks. I love the idea but when I installed it my epoch.altis.pbo did not respond anymore .

If anybody is interested and want to fix it here is the code

This will allow players to type though give them a nice FLASHBANG to there ears with three warning if talking on side. Works pretty good, I use this on my Altis life server, it will work just as good on your Epoch server.


1. Add this to your init.sqf (If you don't have one, then just create one inside your mp_epoch):
[] execVM "no_side_chat.sqf";


2. Now create a new sqf called: no_side_chat.sqf (this new sqf should be placed where your init.sqf is located)


3. Add this script inside the new sqf:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////// stop Voice Chat
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
[] spawn {
disableSerialization;
DS_really_loud_sounds = {[60,15] call fnc_usec_pitchWhine;for "_i" from 1 to 15 do {playSound format ["%1",_this select 0];};};
DS_double_cut = {1 cutText [format ["%1",_this select 0],"PLAIN DOWN"];2 cutText [format ["%1",_this select 0],"PLAIN"];};
DS_slap_them = {_randomnr = [2,-1] call BIS_fnc_selectRandom;(vehicle player) SetVelocity [_randomnr * random (4) * cos getdir (vehicle player), _randomnr * random (4) * cos getdir (vehicle player), random (4)];};
fnc_usec_pitchWhine =
{
_visual = _this select 0;
_sound = _this select 1;
//affect the player
0 fadeSound 0;
playMusic ["PitchWhine",0];
if (!r_player_unconscious) then
{
_visual call fnc_usec_bulletHit;
_sound fadeSound 1;
};
r_pitchWhine = true;
[] spawn
{
sleep 32;
r_pitchWhine = false;
};
};
while {true} do {
waitUntil {sleep 1;((!isNull findDisplay 63) && (!isNull findDisplay 55))};
if (ctrlText ((findDisplay 55) displayCtrl 101) == "\A3\ui_f\data\igui\rscingameui\rscdisplayvoic echa t\microphone_ca.paa") then
{
if (ctrlText ((findDisplay 63) displayCtrl 101) == localize "str_channel_side") then
{
[] spawn {
if (isNil "reset_timer") then {
reset_timer = true;
sleep 90;
disconnect_me = nil;
warn_one = nil;
warn_two = nil;
warn_three = nil;
warn_last = nil;
reset_timer = nil;
};
};
if (isNil "disconnect_me") then {disconnect_me = 0;} else {disconnect_me = disconnect_me + 1;};
if (disconnect_me == 0) then {
if (isNil "warn_one") then {
warn_one = true;
systemChat ("Please do not use voice on sidechat, this is your first warning.");
[] spawn DS_slap_them;
player say3D "flashbang";
//[] call life_fnc_p_updateMenu;
//[] call life_fnc_hudUpdate;
["NO VOICE ON SIDE"] spawn DS_double_cut;
};
};
if (disconnect_me == 1) then {
if (isNil "warn_two") then {
warn_two = true;
systemChat ("Please do not use voice on sidechat, this is your second warning..");
[] spawn DS_slap_them;
player say3D "flashbang";
//[] call life_fnc_p_updateMenu;
//[] call life_fnc_hudUpdate;
["NO VOICE ON SIDE"] spawn DS_double_cut;
};
};
if (disconnect_me == 2) then {
if (isNil "warn_three") then {
warn_three = true;
systemChat ("PLEASE DO NOT USE VOICE ON SIDECHAT!! This is your LAST warning!");
systemChat ("You will be frozen and then disconnected!");
[] spawn DS_slap_them;
player say3D "flashbang";
//[] call life_fnc_p_updateMenu;
//[] call life_fnc_hudUpdate;
["NO VOICE ON SIDE! This is your LAST warning!"] spawn DS_double_cut;
};
};
if (disconnect_me >= 3) then {
if (isNil "warn_last") then {
warn_last = true;
playMusic ["PitchWhine",0];
[] spawn DS_slap_them;
player say3D "flashbang";
//[] call life_fnc_p_updateMenu;
//[] call life_fnc_hudUpdate;
["We warned you..."] spawn DS_double_cut;
1 fademusic 10;
1 fadesound 10;
disableUserInput true;
startLoadingScreen ["You are being disconnected"];
//progressLoadingScreen 0.2;sleep 2;["All_Haha"] spawn DS_really_loud_sounds;
progressLoadingScreen 0.4;sleep 2.25;
//progressLoadingScreen 0.6;sleep 2;["All_Haha"] spawn DS_really_loud_sounds;
progressLoadingScreen 0.8;sleep 2.25;
//progressLoadingScreen 1.0;sleep 2;["All_Haha"] spawn DS_really_loud_sounds;
endLoadingScreen;sleep 0.5;
disableUserInput false;
endMission "LOSER";
};
};
};
};
sleep 1;
};
};
//[] call life_fnc_p_updateMenu;
//[] call life_fnc_hudUpdate;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////// stop Voice Chat
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


4. Now open your description.ext & add this at the end:
class CfgSounds
{
class flashbang
{
name="flashbang";
sound[] = {"\Sounds\flashbang.ogg", 1.0, 1};
titles[] = {0, " "};
};


5. Now just create a folder called Sounds & add a sound file called flashbang.ogg
Link to comment
Share on other sites

stupid question, how to type in a side chat? Whenever I try to do it, doesn't matter on which server on Epoch, I just cant see what I typed in nor can I see messages of others. Doesn't matter who types, admin or a player I just can not see it. Why is it or maybe the servers turned off this feature? I have no other mods installed except Epoch. And I have a little bit changed game UI layout but didn't delete anything...

Link to comment
Share on other sites

in your init

		    ExecVM "pathtoyourscripts\StopSideVoice.sqf"; 

make a new files Called StopSideChat.sqf

[] spawn {
disableSerialization;
DS_really_loud_sounds = {[60,15] call fnc_usec_pitchWhine;for "_i" from 1 to 15 do {playSound format ["%1",_this select 0];};};

DS_double_cut = {1 cutText [format ["%1",_this select 0],"PLAIN DOWN"];2 cutText [format ["%1",_this select 0],"PLAIN"];};

DS_slap_them = {_randomnr = [2,-1] call BIS_fnc_selectRandom;(vehicle player) SetVelocity [_randomnr * random (4) * cos getdir (vehicle player), _randomnr * random (4) * cos getdir (vehicle player), random (4)];};

fnc_usec_pitchWhine =
					{
						_visual = _this select 0;
						_sound = _this select 1;
				//affect the player
						0 fadeSound 0;
						playMusic ["PitchWhine",0];
						if (!r_player_unconscious) then
					{
						_visual call fnc_usec_bulletHit;
						_sound fadeSound 1;
					};
							r_pitchWhine = true;
					[] spawn
						{
							sleep 32;
							r_pitchWhine = false;
						};
					};
				while {true} do {
					waitUntil {sleep 1;((!isNull findDisplay 63) && (!isNull findDisplay 55))};
					if (ctrlText ((findDisplay 55) displayCtrl 101) == "\A3\ui_f\data\igui\rscingameui\rscdisplayvoic echa t\microphone_ca.paa") then
				{
					if (ctrlText ((findDisplay 63) displayCtrl 101) == localize "str_channel_side") then
				{
				[] spawn {
					if (isNil "reset_timer") then {
					reset_timer = true;
					sleep 90;
					disconnect_me = nil;
					warn_one = nil;
					warn_two = nil;
					warn_three = nil;
					warn_last = nil;
					reset_timer = nil;
				};
				};
				if (isNil "disconnect_me") then {disconnect_me = 0;} else {disconnect_me = disconnect_me + 1;};
				if (disconnect_me == 0) then {
				if (isNil "warn_one") then {
					warn_one = true;
					systemChat ("Please do not use voice on sidechat, this is your first warning.");
					[] spawn DS_slap_them;
					player say3D "flashbang";
				//[] call life_fnc_p_updateMenu;
				//[] call life_fnc_hudUpdate;
					["NO VOICE ON SIDE"] spawn DS_double_cut;
				};
				};
				if (disconnect_me == 1) then {
				if (isNil "warn_two") then {
					warn_two = true;
					systemChat ("Please do not use voice on sidechat, this is your second warning..");
				[] spawn DS_slap_them;
					player say3D "flashbang";
				//[] call life_fnc_p_updateMenu;
				//[] call life_fnc_hudUpdate;
					["NO VOICE ON SIDE"] spawn DS_double_cut;
				};
				};
				if (disconnect_me == 2) then {
				if (isNil "warn_three") then {
					warn_three = true;
					systemChat ("PLEASE DO NOT USE VOICE ON SIDECHAT!! This is your LAST warning!");
					systemChat ("You will be frozen and then disconnected!");
				[] spawn DS_slap_them;
					player say3D "flashbang";
				//[] call life_fnc_p_updateMenu;
				//[] call life_fnc_hudUpdate;
					["NO VOICE ON SIDE! This is your LAST warning!"] spawn DS_double_cut;
				};
				};
				if (disconnect_me == 3) then {
				if (isNil "warn_last") then {
					warn_last = true;
					playMusic ["PitchWhine",0];
				[] spawn DS_slap_them;
					player say3D "flashbang";
				//[] call life_fnc_p_updateMenu;
				//[] call life_fnc_hudUpdate;
					["We warned you..."] spawn DS_double_cut;
					1 fademusic 10;
					1 fadesound 10;
					disableUserInput true;
					startLoadingScreen ["You are being disconnected"];
				//progressLoadingScreen 0.2;sleep 2;["All_Haha"] spawn DS_really_loud_sounds;
					progressLoadingScreen 0.4;sleep 2.25;
				//progressLoadingScreen 0.6;sleep 2;["All_Haha"] spawn DS_really_loud_sounds;
					progressLoadingScreen 0.8;sleep 2.25;
				//progressLoadingScreen 1.0;sleep 2;["All_Haha"] spawn DS_really_loud_sounds;
					endLoadingScreen;sleep 0.5;
					disableUserInput false;
					endMission "LOSER";
				};
				};
				};
				};
					sleep 1;
				};
				};
				//[] call life_fnc_p_updateMenu;
				//[] call life_fnc_hudUpdate;

then in your description

{
	class flashbang
				{
					name="flashbang";
					sound[] = {"\Sounds\flashbang.ogg", 1.0, 1};
					titles[] = {0, " "};
				};
};
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...