How can I add ACE keys when I buy in the store?
  • Offline Animatek
  • SNET Admin
  • Fresh Spawn
  • *
  • Posts: 19
  • Editor de Profesión - ArmA III Admin from Cuba

How can I add ACE keys when I buy in the store?

« posted: Nov 14, 2018, 05:14 AM »
I was trying to make sure that when you buy a vehicle the player's keys will be assigned to the player. The only thing I achieved was this:

Code: [Select]
// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2016 A3Wasteland.com *
// ******************************************************************************************
// @file Name: takeOwnership.sqf
// @file Author: MercyfulFate, AgentRev
// @file Description: Acquire the nearest vehicle

#define DURATION 60
#define ANIMATION "AinvPknlMstpSlayWrflDnon_medic"

private _vehicle = ["LandVehicle", "Air", "Ship"] call mf_nearest_vehicle;
private _checks =
{
params ["_progress", "_vehicle"];
private _failed = true;
private _text = _vehicle call fn_canTakeOwnership;

if (_text isEqualTo "") then
{
_text = format ["Adquiriendo %1%2 completado", round (100 * _progress), "%"];
_failed = false;
};

[_failed, _text]
};

_success = [[DURATION, 5] select (_vehicle getVariable ["ownerUID","0"] isEqualTo getPlayerUID player), ANIMATION, _checks, [_vehicle]] call a3w_actions_start;
if (_success) then
{
    player removeItem "ACE_key_master";
[_vehicle, player] call A3W_fnc_takeOwnership;
[player, _vehicle, true] call ace_vehiclelock_fnc_addKeyForVehicle;
["Acquiring complete!", 5] call mf_notify_client;
};

_success

adding

Code: [Select]
[player, _vehicle, true] call ace_vehiclelock_fnc_addKeyForVehicle; on ``_success``

This I did for when you acquire ownership of a vehicle, and it works. But I do not find where to do it when you shop in the store.

Also, is there any way to add in game a custom name to an items in the inventory?
The problem is that the ACE keys are stacked and you can not tell which key is from which vehicle.
Soy administrador de ArmA III en una intranet en Cuba. No tengo experiencia en códigos ni programación, pero con ayuda he logrado un servicio eficiente y duradero, todo offline y sin internet.