ole

AdminToolkit for Arma 3 [DEVELOPER THREAD]

7 posts in this topic

HOWTO: Display other vehicles from different mods

In the Exile extensions of the AdminToolkit (AdminToolkit_Vehicles_Exile.sqf)  it is taking all Exile vehicles by using the VehicleClass property. That is possible, because Exile Team does a good job assigning them properly.  

// AdminToolkit_Vehicles_Exile.sqf: LINE 38
_result = "(getText(_x >> 'VehicleClass') in ['ExileCars', 'ExileBikes', 'ExileChoppers','ExileBoats','ExilePlanes']) and (getNumber (_x >> 'scope') == 2)" configClasses (configFile >> "CfgVehicles");

One interesting link is the Land Class Vehicles page. So you can try it the same way as above and simple add additional "superclasses" to it.

// NOT TESTED
_result = "(getText(_x >> 'VehicleClass') in ['Cars','ExileCars', 'ExileBikes', 'ExileChoppers','ExileBoats','ExilePlanes']) and (getNumber (_x >> 'scope') == 2)" configClasses (configFile >> "CfgVehicles");

Or you use a different technique. For example the isKindOf method

// show only classes which are inherited by the "Car" class (Truck, ...)
_result = "_x isKindOf 'Car'" configClasses (configFile >> "CfgVehicles");

// show only classes which are inherited by the "Air" class (Helicopters)
_result = "_x isKindOf 'Air'" configClasses (configFile >> "CfgVehicles");

// Combined - Car and Air
_result = "(_x isKindOf 'Air') or (_x isKindOf 'Car')" configClasses (configFile >> "CfgVehicles");

Try it yourself and let us know what your favorite filter is.

Regards,
Ole

Share this post


Link to post
Share on other sites
Advertisement

Below is a list (returned as _result) for all RHS: Armed Forces of the Russian Federation according to class.rhsmods.org but without invantry

_result = "(getText(_x >> 'VehicleClass') in ['rhs_vehclass_apc','rhs_vehclass_ifv','rhs_vehclass_car','rhs_vehclass_truck','rhs_vehclass_tank','rhs_vehclass_artillery','rhs_vehclass_radar','rhs_vehclass_targeting','rhs_vehclass_launcher','rhs_vehclass_aircraft','rhs_vehclass_helicopter', 'rhs_vehclass_aa']) and (getNumber (_x >> 'scope') == 2)" configClasses (configFile >> "CfgVehicles");

 

Edited by ole

Share this post


Link to post
Share on other sites

User Request: Example on how to extend the exile extension shipped with AdminToolkit

A user has requested to add a "delete vehicle" feature for the exile extension.

To add this feature you only need to change the following two files:

  • @MissionFile/atk/AdminToolkit_Vehicles_Exile.sqf - used to add the menu button "Remove NearBy" in "Vehicles" register
  • @ExileServer/admintoolkit_server/code/AdminToolkit_server_exile.sqf - used to "receive" the button command.

 

// ### @MissionFile/atk/AdminToolkit_Vehicles_Exile.sqf
// [...]
ctrlSetText [1706,"Remove NearBy"];
buttonSetAction [1706, "['exile_delvehicle'] call AdminToolkit_buttonAction;"];
// [...]

Server 

// ### @ExileServer/admintoolkit_server/code/AdminToolkit_server_exile.sqf
// [...]
// Used to remove an object which nearby player object
case 'exile_delvehicle': 
{
	
	_object = nearestObject [_playerObject, _params];
	deleteVehicle _object;
};
// [...]

Also make sure you have added the line

AdminToolkit_ModEnable = "exile";

in your description.ext of your Mission PBO

Share this post


Link to post
Share on other sites

User Request: Howto apply only furniture in "Building" section of AdminToolkit

(TESTED AND WORKING: 2016-04-02)

Example File: "atk\AdminToolkit_Custom_Furniture.sqf" in your MissionFile

/**
 * AdminToolkit
 * 
 * Author: ole1986
 * Website: https://github.com/ole1986/a3-admintoolkit
 *
 * This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
 */

private['_result'];
disableSerialization;

_result = "getText(_x >> 'vehicleClass') == 'Furniture'" configClasses (configFile>>"CfgVehicles");
_result;

Change the "class CfgAdminToolkitCustomMod" located in your description.ext (or config.cpp) of your missionFile as follow:

class CfgAdminToolkitCustomMod {
  AdminToolkit_ModEnable = "exile";
  AdminToolkit_Mod_Vehicles = "atk\AdminToolkit_Vehicles_Exile.sqf";
  // Used to overwrite buildings to only display Furniture vehicle classes
  AdminToolkit_Mod_Custom = "atk\AdminToolkit_Custom_Furniture.sqf";
};

 

Edited by ole

Share this post


Link to post
Share on other sites

How to apply several classes in "Building" section of AdminToolkit
(TESTED AND WORKING: 2016-05-05)

Create an AdminToolkit_Custom_Furniture.sqf like posted here.
Change the "class CfgAdminToolkitCustomMod" located in your description.ext (or config.cpp) of your missionFile like shown in the same post.

Inside the AdminToolkit_Custom_Furniture.sqf change the definition for _result to this:

_result = "(getText(_x >> 'vehicleClass') in ['Furniture','Structures','Tents','Cargo','Dead_bodies','Market','Small_items','Fortifications','Signs']) and (getNumber(_x >> 'scope') == 2)" configClasses (configFile>>"CfgVehicles");

All credits for this go to @ole . Thanks for the help! :)

  • Like 1

Share this post


Link to post
Share on other sites

anyone can tell me howto convert a list of spezific classnames in the _result list? 
 

Spoiler

"Exile_Car_BRDM2_HQ",
            "Exile_Car_BTR40_MG_Camo",
            "Exile_Car_BTR40_Camo",
            "Exile_Car_Golf_Black",
            "Exile_Car_Hatchback_Black",
            "Exile_Car_Hatchback_Sport_Admin",
            "Exile_Car_HEMMT",
            "Exile_Car_HMMWV_M134_Desert",
            "Exile_Car_HMMWV_M2_Desert",
            "Exile_Car_HMMWV_UNA_Desert",
            "Exile_Car_Hunter",
            "Exile_Car_Ifrit",
            "Exile_Car_Ikarus_Party",
            "Exile_Car_Kart_RedStone",
            "Exile_Car_Lada_Hipster",
            "Exile_Car_LandRover_Urban",
            "Exile_Car_LandRover_Ambulance_Green",
            "Exile_Car_MB4WD",
            "Exile_Car_MB4WDOpen",
            "Exile_Car_Octavius_Black",
            "Exile_Car_Offroad_Guerilla06",
            "Exile_Car_Offroad_Armed_Guerilla12",
            "Exile_Car_Offroad_Repair_Civillian",
            "Exile_Car_OldTractor_Red",
            "Exile_Car_ProwlerUnarmed",
            "Exile_Car_QilinUnarmed",
            "Exile_Car_Strider",
            "Exile_Car_SUV_Black",
            "Exile_Car_SUVXL_Black",
            "Exile_Car_SUV_Armed_Black",
            "Exile_Car_Tempest",
            "Exile_Car_TowTractor_White",
            "Exile_Car_Tractor_Red",
            "Exile_Car_UAZ_Green",
            "Exile_Car_UAZ_Open_Green",
            "Exile_Car_Ural_Covered_Military",
            "Exile_Car_Ural_Open_Military",
            "Exile_Car_V3S_Covered",
            "Exile_Car_V3S_Open",
            "Exile_Car_Van_Guerilla02",
            "Exile_Car_Van_Box_Guerilla04",
            "Exile_Car_Van_Fuel_Guerilla03",
            "Exile_Car_Volha_Black",
            "Exile_Car_Zamak",
            "Exile_Car_MountainBike",
            "Exile_Car_OldBike",
            "Exile_Car_QuadBike_Csat",
            "Exile_Chopper_Hellcat_Green",
            "Exile_Chopper_Huey_Green",
            "Exile_Chopper_Huey_Armed_Green",
            "Exile_Chopper_Hummingbird_Green",
            "Exile_Chopper_Hummingbird_Civillian_ION",
            "Exile_Chopper_Huron_Black",
            "Exile_Chopper_Mohawk_FIA",
            "Exile_Chopper_Orca_CSAT",
            "Exile_Chopper_Taru_CSAT",
            "Exile_Chopper_Taru_Covered_CSAT",
            "Exile_Chopper_Taru_Transport_CSAT",
            "Exile_Plane_AN2_Green",
            "Exile_Plane_BlackfishInfantry",
            "Exile_Plane_BlackfishVehicle",
            "Exile_Plane_Ceasar",
            "Exile_Plane_Cessna"

this list i will shown in the vehicle list, i dont like to have 20 offroads in the list .

tryed a lot but i never worked with gettext and configClasses and cant find an example 

 

Edit : added some exile_cmd

Spoiler
case 'exile_getvehicle':
  {
  // _params = <string> - vehicle class name
  // pin code
  _tmp2 = format["%1%2%3%4",floor random 10, floor random 10, floor random 10, floor random 10];
  _position = (getPos _playerObject) findEmptyPosition [10, 175, _params];
   
  if (_position isEqualTo []) exitWith
  {
  throw 13;[_playerObject, "toastRequest", ["SuccessTitleOnly", [format["Some Error"] ]]] call ExileServer_system_network_send_to;
  };
   
  _object = [_params, _position, (random 360), true, _tmp2] call ExileServer_object_vehicle_createPersistentVehicle;
  _object setVariable ["ExileOwnerUID", (getPlayerUID _playerObject)];
  _object setVariable ["ExileIsLocked",0];
  _object setVariable ["ExileAccessCode", _tmp2];
  _object lock 0;
  _object call ExileServer_object_vehicle_database_insert;
  _object call ExileServer_object_vehicle_database_update;
   
  [_playerObject, "toastRequest", ["SuccessTitleOnly", [format["%1 Spawned!", _params] ]]] call ExileServer_system_network_send_to;
  [_playerObject, "dynamicTextRequest", [format ["UNLOCK PIN: %1", _tmp2], 0, 2, "#ffffff"]] call ExileServer_system_network_send_to;
  };
  case 'exile_repvehicle':
  {
  // _params =vehicle class name
  _params setDamage 0;
   
  [_playerObject, "toastRequest", ["SuccessTitleOnly", [format["%1 Repaired!", _params] ]]] call ExileServer_system_network_send_to;
  };
  case 'exile_destvehicle':
  {
  // _params =vehicle class name
  _params setDamage 100;
   
  [_playerObject, "toastRequest", ["SuccessTitleOnly", [format["%1 Destroyed!", _params] ]]] call ExileServer_system_network_send_to;
  };
  case 'exile_delvehicle':
  {
  // _params =vehicle class name
  _params call ExileServer_object_vehicle_remove;
  deleteVehicle _params;
   
  [_playerObject, "toastRequest", ["SuccessTitleOnly", [format["%1 Deleted!", _params] ]]] call ExileServer_system_network_send_to;
  };
  case 'exile_getheal':
  {
  _playerObject setDamage 0;
   
  [_playerObject, "toastRequest", ["SuccessTitleOnly", [format["%1 healed!", _playerObject] ]]] call ExileServer_system_network_send_to;
  };
  case 'exile_kill':
  {
  _playerObject setDamage 100;
   
  [_playerObject, "toastRequest", ["SuccessTitleOnly", [format["%1 killed!", _playerObject] ]]] call ExileServer_system_network_send_to;
  };
  case 'exile_getmoney':
  {
  // _params = <number> - the amount to be transferred
   
  _tmp = _params;
  _tmp2 = _playerObject getVariable ["ExileMoney", 0];
  _tmp2 = _tmp2 + _tmp;
  _playerObject setVariable ["ExileMoney", _tmp2, true];
  format["setPlayerMoney:%1:%2", _tmp2, _player getVariable ["ExileDatabaseID", 0]] call ExileServer_system_database_query_fireAndForget;
   
  [_playerObject, "toastRequest", ["SuccessTitleOnly", [format["Money %1 added!", _tmp] ]]] call ExileServer_system_network_send_to;
  [_playerObject, "lockerResponse", []] call ExileServer_system_network_send_to;
  };
  case 'exile_getscore':
  {
  // _params = <number> - the amount to be transferred
  _tmp = _playerObject getVariable ["ExileScore", 0];
  _tmp = floor (_tmp + _params);
  _playerObject setVariable ["ExileScore", _tmp];
   
  format["setAccountScore:%1:%2", _tmp, (getPlayerUID _playerObject)] call ExileServer_system_database_query_fireAndForget;
  [_playerObject, "freeResponse", [str _params]] call ExileServer_system_network_send_to;
  };

 

Edited by Warsheep
  • Like 1

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.