red_ned

Completely remove hotwire

14 posts in this topic

I have a PVE server so with code change I really wanted to remove the knife hotwire so thought I would release just in case others wanted to do the same.

1. Create a text file and rename to ExileClient_action_hotwireVehicle_condition.sqf

2. Paste the following code into the file and save it:

Spoiler

/**
 * ExileClient_action_hotwireVehicle_condition
 *
 * Exile Mod
 * exile.majormittens.co.uk
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_vehicle","_result"];
_vehicle = _this;
_result = "";
try
{
 if (ExilePlayerInSafezone) then
 {
  throw "Hotwire is disabled on this server";
 };
 if !(ExilePlayerInSafezone) then
 {
  throw "Hotwire is disabled on this server";
 };
}
catch
{
 _result = throw "Hotwire is disabled on this server";
};
_result

3. Put file into your mission PBO.

4. Open your mission PBO and edit the config.cpp and find the section: class CfgExileCustomCode

Insert the following between the {};

Quote

  // disable hotwire
 ExileClient_action_hotwireVehicle_condition = "ExileClient_action_hotwireVehicle_condition.sqf";

Remembering if you use folders to put the full path in.

5. Save and repack your PBO with the adjusted config and new file in.

6. Enjoy no one stealing stuff, just puts up message "Hotwire is disabled on this server" no matter what people select or where they are.

Basically I added the condition "if player is not in the safe zone" to the original "if player is in the safe zone" which basically means anywhere on the map!

Edited by red_ned
  • Like 3

Share this post


Link to post
Share on other sites
On ‎09‎/‎03‎/‎2016 at 7:26 PM, red_ned said:

catch
{
 _result = throw "Hotwire is disabled on this server";
};
_result

just to be sure I changed last bit for safety but shouldn't affect anything

  • Like 2

Share this post


Link to post
Share on other sites
Advertisement
On 3/18/2016 at 6:00 PM, red_ned said:

just to be sure I changed last bit for safety but shouldn't affect anything

Just so you're aware you don't need to throw in the catch, you only 'throw' an exception when trying something, as you mention its for 'safety' you can just do
 

Spoiler

/**
 * ExileClient_action_hotwireVehicle_condition
 *
 * Exile Mod
 * exile.majormittens.co.uk
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_vehicle","_result"];
_vehicle = _this;
_result = "";
try
{
	if (true) then
	{
		throw "Hotwire is disabled on this server";
	};
}
catch
{
	_result = _exception;
};
_result

 

 

Edited by KamikazeXeX

Share this post


Link to post
Share on other sites
31 minutes ago, KamikazeXeX said:

Just so you're aware you don't need to throw in the catch, you only 'throw' an exception when trying something, as you mention its for 'safety' you can just do
 

  Hide contents


/**
 * ExileClient_action_hotwireVehicle_condition
 *
 * Exile Mod
 * exile.majormittens.co.uk
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_vehicle","_result"];
_vehicle = _this;
_result = "";
try
{
	if (true) then
	{
		throw "Hotwire is disabled on this server";
	};
}
catch
{
	_result = _exception;
};
_result

 

 

Just so you're aware you don't need to do anything here.
 

/**
 * ExileClient_action_hotwireVehicle_condition
 *
 * Exile Mod
 * exile.majormittens.co.uk
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */

"Hotwire disabled on this server!"

 

  • Like 1

Share this post


Link to post
Share on other sites
10 minutes ago, second_coming said:

couldn't you just remove the knife from loot spawning and the traders?

That's all I did till I could change the success percentage. 

Share this post


Link to post
Share on other sites
9 minutes ago, second_coming said:

couldn't you just remove the knife from loot spawning and the traders?

removing the knife is a bit of a pain as its useful to have in for extra crafting and also it can be a pain to make sure it doesn't spawn from any mission system, remove from loot tables and then you may as well disable in 1 script and give people notice its disabled.

the exception call is good though thanks @KamikazeXeX

  • Like 1

Share this post


Link to post
Share on other sites
7 minutes ago, Grim said:

Just so you're aware you don't need to do anything here.
 


/**
 * ExileClient_action_hotwireVehicle_condition
 *
 * Exile Mod
 * exile.majormittens.co.uk
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */

"Hotwire disabled on this server!"

 

a ballsie move I wouldn't have thought of!

Share this post


Link to post
Share on other sites
11 minutes ago, Grim said:

Just so you're aware you don't need to do anything here.
 


/**
 * ExileClient_action_hotwireVehicle_condition
 *
 * Exile Mod
 * exile.majormittens.co.uk
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */

"Hotwire disabled on this server!"

 

Shhh :P I did realise that after posting, either way i'm teaching the bambi some syntax :P

EDIT: *Kami cowers in corner waiting for @Grim to join his TeamSpeak and abuse him*

Edited by KamikazeXeX

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.