Extra Vehicle Actions Addon

Re: Extra Vehicle Actions Addon

« Reply #30 posted: Jan 21, 2015, 08:32 AM »
I feel that I am still confused on how to lock vehicles outside of said vehicle.  I checked this link: https://github.com/micovery/ArmA3_Wasteland.Altis/commit/dc4f89de9c3b7ccf73da0ca6a5aa8b3132ad6d14?diff=split

but I cannot seem to find those lines of code in my file.  what am I doing wrong?  Again I am very new to this :).

Thank you!

Re: Extra Vehicle Actions Addon

« Reply #31 posted: Feb 08, 2015, 09:02 PM »
is there not a download option? or do we really have to copy and paste all the text? also how do we get the images
  • Offline Tokae
  • Geared Up
  • **
  • Posts: 40

Re: Extra Vehicle Actions Addon

« Reply #32 posted: Feb 09, 2015, 06:15 PM »
is there not a download option? or do we really have to copy and paste all the text? also how do we get the images

I was wondering how we implement this addon, which file is exec'd?
  • Offline LouD
  • Silent but deadly ;)
  • Moderator
  • Veteran
  • ******
  • Posts: 1415

Re: Extra Vehicle Actions Addon

« Reply #33 posted: Feb 09, 2015, 10:57 PM »
I was wondering how we implement this addon, which file is exec'd?

Add this to your init.sqf

Code: [Select]
[] execVM "addons\vactions\functions.sqf";
As shown here:
https://github.com/micovery/ArmA3_Wasteland.Altis/commit/abb23bdb75ad7f08bf9ebd0b21637ebbf1df2016#diff-ad48684afe808e82f49cf6baf3d2663c
  • Offline Tokae
  • Geared Up
  • **
  • Posts: 40

Re: Extra Vehicle Actions Addon

« Reply #34 posted: Feb 10, 2015, 12:44 AM »
Thanks for the reply LouD!

As one of the many who do not find github or its overall layout to be beneficial or easy to decipher I appreciate all the assistance I get. Every time I go to add something or use a new version of wasteland its a 2 day nightmare just trying to piece together what parts need to be updated in order to make something work. I was looking over the files and I could not see that.

Re: Extra Vehicle Actions Addon

« Reply #35 posted: Mar 12, 2015, 08:06 PM »
I work with tokae (above here) to manage the same server. But he hasn't  done such a good job implementing this script. I'm trying to fix those but could use some help cause i don't understand everything said in here.
the problem is we're stuck on the problem you guys had to save the lockstate over a serverrestart. Also, new vehicles can't say who their owner is untill after a server restart.
Is there a link to the breaklock script too?
And is it possible to change ownership when stealing vehicles or does it not do that?

Re: Extra Vehicle Actions Addon

« Reply #36 posted: Mar 18, 2015, 02:15 AM »
On prgress: i managed to put in the fix for newly bought vehicles. we can lock them now. But newly earned vehicles form missions not yet. Also it did not make the lockstate save. Any help with that? How do i get the lockstate in the vehicle saving and reloading? and how do we create ownerUID's for missionvehicles?
  • Offline CREAMPIE
  • Armaholic
  • Veteran
  • ******
  • Posts: 1083
  • ^_^;;

Re: Extra Vehicle Actions Addon

« Reply #37 posted: Mar 18, 2015, 06:43 AM »
I've added an action to my vehicle stores that allows players to buy a "license" for vehicles they find / get from missions.

add this into your server\functions\setupStoreNPC.sqf in the VehStore case

Code: [Select]
_npc addAction ["<img image='client\icons\r3f_unlock.paa'/> License Vehicle", "client\systems\selling\licenseVehicle.sqf", [], 0.97, false, true, "", STORE_ACTION_CONDITION + " && " + SELL_VEH_CONTENTS_CONDITION];
then add this in the client\systems\selling\licenseVehicle.sqf - you can change the amount charged by adjusting the CHOPSHOP_PRICE_RELATIONSHIP ( 4 = 25% , 10 = 10% )

Code: [Select]
// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
// @file Name: licenseVehicle.sqf
// @file Author: CRE4MPIE
//  @file edited: CRE4MPIE
//  @credits to: Cael817, Lodac, Wiking, Gigatek (original auth of chopshop)


#include "sellIncludesStart.sqf";

storeSellingHandle = _this spawn
{
#define CHOPSHOP_PRICE_RELATIONSHIP 10
#define VEHICLE_MAX_SELLING_DISTANCE 50

private ["_vehicle","_type", "_price", "_confirmMsg", "_playerMoney", "_text"];

_storeNPC = _this select 0;
_vehicle = objectFromNetId (player getVariable ["lastVehicleRidden", ""]);
_type = typeOf _vehicle;
_playerMoney = player getVariable "cmoney";
_price = 500;
_objClass = typeOf _vehicle;
_objName = getText (configFile >> "CfgVehicles" >> _objClass >> "displayName");

if (isNull _vehicle) exitWith
{
playSound "FD_CP_Not_Clear_F";
["Dude! Where's your vehicle?", "Error"] call  BIS_fnc_guiMessage;
};


if (_vehicle distance _storeNPC > VEHICLE_MAX_SELLING_DISTANCE) exitWith
{
playSound "FD_CP_Not_Clear_F";
[format ['"%1" is further away than %2m from the store.', _objname, VEHICLE_MAX_SELLING_DISTANCE], "Error"] call  BIS_fnc_guiMessage;
};



{
if (_type == _x select 1) then
{
_price = _x select 2;
_price = _price / CHOPSHOP_PRICE_RELATIONSHIP;
};

} forEach (call allVehStoreVehicles);

if (_price > _playerMoney) exitWith
{
playSound "FD_CP_Not_Clear_F";
[format ['You do not have enough money to buy a license for the %1', _objname], "Error"] call  BIS_fnc_guiMessage;
};

if (!isNil "_price") then
{
// Add total sell value to confirm message
_confirmMsg = format ["Buying a license for the %1 will cost you $%2 <br/>", _objName, _price];
_confirmMsg = _confirmMsg + format ["<br/><t font='EtelkaMonospaceProBold'>1</t> x %1", _objName];

// Display confirm message
if ([parseText _confirmMsg, "Confirm", "LICENSE", true] call BIS_fnc_guiMessage) then
{
  _vehicle setVariable ["A3W_missionVehicle", true, true];
_vehicle setVariable ["ownerN", name player, true];
_vehicle setVariable ["ownerUID", getPlayerUID player, true];
 
player setVariable["cmoney",(player getVariable "cmoney")-_price,true];
[format ['Congratulations! You are now the proud owner of a %1', _objname, VEHICLE_MAX_SELLING_DISTANCE], "THANK YOU"] call  BIS_fnc_guiMessage;

if (["A3W_playerSaving"] call isConfigOn) then
{
[] spawn fn_savePlayerData;
};
};
} else {
hint parseText "<t color='#ffff00'>An unknown error occurred.</t><br/>Cancelled.";
playSound "FD_CP_Not_Clear_F";
};
};

#include "sellIncludesEnd.sqf";




- from the grassy knoll -

Re: Extra Vehicle Actions Addon

« Reply #38 posted: Mar 18, 2015, 10:09 PM »
I do this, having an action that depends on you having an toolkit in your inventory and in this case havin a 25% of breaking your toolkit. I did at one time make a "wasteland item" to be used in an earlier version but i found it to be more of a hassle when i came to keeping up with updates. Also this makes the player having making the choice of hulking around on it or not.

Code: [Select]
private ["_vehicle","_nearvehicle", "_break"];
_nearvehicle = nearestObjects [player, ["LandVehicle", "Ship", "Air"], 7];
_vehicle = _nearvehicle select 0;
_break = floor (random 100);

if (_break < 25) exitWith {
hint "Your ToolKit broke";
player removeItem "ToolKit";
};

 for "_i" from 120 to 0 step -1 do
 {
    hint str _i;
player action ["lightOn", _vehicle];
_soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString;
_soundToPlay = _soundPath + "addons\snafu\vehicleActions\sounds\carhorn.ogg";
playSound3D [_soundToPlay, _vehicle, false, getPosASL _vehicle, 1, 1, 0];
    sleep 0.5;
player action ["lightOff", _vehicle];
sleep 0.5;

if (player distance _vehicle >6 ) then
{
hint "Attempt aborted. You need to stay close to the vehicle in order to break in.";
breakOut "_i";
};
};

if (local _vehicle) then
{
_vehicle lock 1;
//hint "local";
}
else
{
[[netId _vehicle, 1], "A3W_fnc_setLockState", _vehicle] call A3W_fnc_MP; // Unlock
//hint "not local";
};

_vehicle setVariable ["objectLocked", false, true];
_vehicle setVariable ["R3F_LOG_disabled",false,true];
_soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString;
_soundToPlay = _soundPath + "addons\snafu\vehicleActions\sounds\carlock.ogg";
playSound3D [_soundToPlay, _vehicle, false, getPosASL _vehicle, 1, 1, 15];
player action ["lightOn", _vehicle];
sleep 0.5;
player action ["lightOff", _vehicle];
titleText ["You broke in to the vehicle!","PLAIN DOWN"]; titleFadeOut 2;

called with
Code: [Select]
["<img image='client\icons\r3f_unlock.paa'/>Break in and hotwire", "addons\snafu\vehicleActions\breakLock.sqf", [cursorTarget], 1,false,false,"","!isNull cursorTarget && vehicle player == player && {{ cursorTarget isKindOf _x } count ['LandVehicle', 'Ship', 'Air'] > 0 ;} && cursorTarget getVariable ['ownerUID',''] != getPlayerUID player && locked cursorTarget >= 2 && cursorTarget distance player < 7 && ('ToolKit' in (items player))"],

I would like to see to option of micoverys locking system having a lockpick function in the addon using some kind of "ArmA" item rather than a special "wastland item", but maybe its just me liken the "plug n play" functionality of things =).

Anyway micoverys addon works really nice, thanks again.
What's supposed to happen with it all? create a new file or put them in the vactions?

@Creampie: great script, I've put that in, and your vehicleselling too wich is good cause since the update we haven't had a vehicleselling anymore.

Re: Extra Vehicle Actions Addon

« Reply #39 posted: Mar 19, 2015, 07:49 PM »
you create a sqf with the name and location in my example
Code: [Select]
addons\snafu\vehicleActions\breakLock.sqf (you don t have to have it in a snafu folder thou ;-)  put the "breakLock.sqf wherever)

the second part goes into your playerActions.sqf edit the path and names to your liking

with the contents of the first part, doesnt really have anything to to with "vactions" its a remnant from befor micovery made that nad im just to bad at scripting to get into his code

Re: Extra Vehicle Actions Addon

« Reply #40 posted: Apr 05, 2015, 05:59 PM »
I Managed to get this working with extdb and after a server restart

Could you told me how you make it ? Pls`?

Good job anyway

  • Offline LouD
  • Silent but deadly ;)
  • Moderator
  • Veteran
  • ******
  • Posts: 1415

Re: Extra Vehicle Actions Addon

« Reply #41 posted: Apr 05, 2015, 06:13 PM »
This works without any effort on extDB.
But if you want vehicles to spawn in locked, then add this:

https://github.com/LouDnl/ArmA3_Wasteland.Altis/blob/NL-United/persistence/server/world/vLoad.sqf#L122-L129

Re: Extra Vehicle Actions Addon

« Reply #42 posted: Apr 05, 2015, 06:38 PM »
This works without any effort on extDB.
But if you want vehicles to spawn in locked, then add this:

https://github.com/LouDnl/ArmA3_Wasteland.Altis/blob/NL-United/persistence/server/world/vLoad.sqf#L122-L129

THX for that mate :)
  • Offline Mokey
  • Fractured Wasteland
  • Elite
  • ******
  • Posts: 606
  • Https://Fractured-Gaming.com

Re: Extra Vehicle Actions Addon

« Reply #43 posted: Apr 08, 2015, 02:17 PM »
This works without any effort on extDB.
But if you want vehicles to spawn in locked, then add this:

https://github.com/LouDnl/ArmA3_Wasteland.Altis/blob/NL-United/persistence/server/world/vLoad.sqf#L122-L129

Does this mean all vehicles will spawn in locked? or just the ones owned by players?
Posts once, edits post 40 times in 60 seconds. STUPID FAT FINGERS!
  • Offline LouD
  • Silent but deadly ;)
  • Moderator
  • Veteran
  • ******
  • Posts: 1415

Re: Extra Vehicle Actions Addon

« Reply #44 posted: Apr 08, 2015, 03:08 PM »
Does this mean all vehicles will spawn in locked? or just the ones owned by players?
Only ones owned by players. Mission vehicles will stay unlocked.