Sign in to follow this  
Airitech

Disable Mounted MG42's

Recommended Posts

Posted (edited)

Hello!

For my gungame server, i'd like to disable or remove the mounted MG 42's from the maps that have them, I am unaware of any server dvar there is to disable them, but if that existed that would be sweet.

Couldn't find anything super definitive in the .gsc files to disable them either. Only thing I found that looked to be related was some things in _missions.gsc like MGKill() and endMGStreakWhenLeaveMG() Nothing getting done when theu mount onto it.

To solve the problem right now, I have inserted some code into callback_playerdamage in globallogic so that nobody gets killed by the bullets from one, but if you explode a car, you can still kill somebody.

	if(sWeapon == "saw_bipod_stand_mp")
	{
		if(isDefined( eAttacker ) )
		{
			iDamage = 0;
			eAttacker suicide();
			eAttacker iPrintLnBold("Do ^1NOT ^7use mounted ^1MG42! ^7You will be kicked.");
			eAttacker.pers["mgkills"]++;
			if(eAttacker.pers["mgkills"] >= 2)
			{
				eAttacker.guid = eAttacker getGuid();
				exec("clientkick " + eAttacker.guid + " Mounted MG42's are not allowed!");
			}
		}
	}

I just don't feel like this is the most elegant way to solve my problem, and there's probably a super easy way or a simple dvar to disable them that I cant find!

So if anybody knows an easier way, id really appreciate it!

Thanks!

Edited by Airitech

Share this post


Link to post
Share on other sites

If you are running new arch add to config file:

set db_nobspweapon 1

 

If still on old arch add this code to gametype start function

turrets = getEntArray( "misc_turret", "classname" );
for( i = 0; i < turrets.size; i++ )
{
	turrets[ i ] delete();
}

 

  • Like 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this