Austin

Pack Bike Script?

8 posts in this topic

Currently I have deploy bike but I want to make it so it has pack bike as well when you look at the bike within 5-10 meters. I have had this working just had it execute from bambistatebegin so if you relogged you would have the option. Anyone have any ideas? I will post the script below. (noob at scripting...)

 

NOTE: This script will add changes here and there from the community, I am not a full on coder and Just wing things when I make them so if I see better suggestions I will add them to main post.

 

Pack_Bike.sqf

if (ExileClientPlayerMoney < 9999999999999999) then {
    deletevehicle cursorTarget;
    player playMove "AinvPknlMstpSnonWnonDr_medic3";
    player linkItem "ItemRadio";
	uiSleep 1;
	["Success",["Personal Bike packed! Radio added!"]] call ExileClient_gui_notification_event_addNotification;
};

in ExileClient_object_player_bambiStateBegin.sqf I added

PackBikeAction = player addAction ["Pack Bike","Scripts\Bike\Pack_Bike.sqf",0,0,true,true,"","(typeof cursortarget) == 'Exile_Bike_MountainBike' and _this distance cursortarget <5"];

In the end I want players to always have this action when they look at a bike that way I don't have them laying everywhere.

Edited by Austin

Share this post


Link to post
Share on other sites

in config.cpp exile has vehicle option setting. You can try to use that.

Edited by GR8

Share this post


Link to post
Share on other sites
Advertisement
5 minutes ago, GR8 said:

in config.cpp exile has vehicle option setting. You can try to use that.

class CfgInteractionMenus
{
	class Car 
	{
		targetType = 2;
		target = "Car";

		class Actions 
		{
			class ScanLock: ExileAbstractAction
			{
				title = "Scan Lock";
				condition = "('Exile_Item_ThermalScannerPro' in (magazines player)) && !ExilePlayerInSafezone && ((locked ExileClientInteractionObject) != 1)";
				action = "_this call ExileClient_object_lock_scan";
			};

Assume you are talking about this, thanks for the heads up, will try messing with it.

1 person likes this

Share this post


Link to post
Share on other sites
6 minutes ago, Austin said:

class CfgInteractionMenus
{
	class Car 
	{
		targetType = 2;
		target = "Car";

		class Actions 
		{
			class ScanLock: ExileAbstractAction
			{
				title = "Scan Lock";
				condition = "('Exile_Item_ThermalScannerPro' in (magazines player)) && !ExilePlayerInSafezone && ((locked ExileClientInteractionObject) != 1)";
				action = "_this call ExileClient_object_lock_scan";
			};

Assume you are talking about this, thanks for the heads up, will try messing with it.

Let me know if you make something work. Would like to use it myself

Share this post


Link to post
Share on other sites
3 minutes ago, GR8 said:

Let me know if you make something work. Would like to use it myself

Will do.

Share this post


Link to post
Share on other sites
21 hours ago, GR8 said:

Let me know if you make something work. Would like to use it myself

Ok so I think it got it working. Still kinda testing it just to make 100% sure but this I what I did.

In config.cpp I changed

class Bikes
	{
		targetType = 2;
		target = "Bicycle";

		class Actions
		{
			class Flip: ExileAbstractAction
			{
				title = "Flip";
				condition = "true";
				action = "_this call ExileClient_object_vehicle_flip";
			};
		};
	};

to

class Bikes
	{
		targetType = 2;
		target = "Bicycle";

		class Actions
		{
			class Flip: ExileAbstractAction
			{
				title = "Flip";
				condition = "true";
				action = "_this call ExileClient_object_vehicle_flip";
			};
			class Pack: ExileAbstractAction
			{
				title = "Pack Bike";
				condition = "true";
				action = "execVM 'Scripts\Bike\Pack_bike.sqf';";
			};
		};
	};

and in Pack_bike.sqf I have

if (ExileClientPlayerMoney < 9999999999999999) then {
    deletevehicle cursorTarget;
    player playMove "AinvPknlMstpSnonWnonDr_medic3";
    player addWeapon "ItemRadio";
	uiSleep 1;
    ['BIKE REMOVED, RADIO ADDED !',0,0.6,2,0] spawn bis_fnc_dynamictext;
};

Seems to pop up everytime so far :)

1 person likes this

Share this post


Link to post
Share on other sites

Posted (edited)

player playMove "AinvPknlMstpSnonWnonDr_medic3";
uiSleep 11;
deletevehicle cursorTarget;
player linkItem "ItemRadio";
uiSleep 1;
["Success",["Personal Bike packed! Radio added!"]] call ExileClient_gui_notification_event_addNotification;

a bit cleaner. absolutely no need for the money check. also instead of adding the radio as weapon, which caused issues on my end, i use linkItem as this generates AND assignes the item automagically =) also utilizies the exile messages, they look better than dynamic text.

but im using something similar, great job! =)

Edited by Dizzturbed
2 people like this

Share this post


Link to post
Share on other sites
On 1/5/2016 at 9:54 AM, Dizzturbed said:

player playMove "AinvPknlMstpSnonWnonDr_medic3";
uiSleep 11;
deletevehicle cursorTarget;
player linkItem "ItemRadio";
uiSleep 1;
["Success",["Personal Bike packed! Radio added!"]] call ExileClient_gui_notification_event_addNotification;

a bit cleaner. absolutely no need for the money check. also instead of adding the radio as weapon, which caused issues on my end, i use linkItem as this generates AND assignes the item automagically =) also utilizies the exile messages, they look better than dynamic text.

but im using something similar, great job! =)

Ah ok, I only added the money check incase people wanted to set it so people that have played for a long time can change it so only new people can use it or the other way around.

1 person likes this

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.