BEACON-SCAN

BEACON-SCAN

« posted: Jul 23, 2016, 04:02 AM »
HELLO
And for me it impossible beacon detector opens the menu to place my mouse :-\

ADD/PLAYERFONCT...
Code: [Select]
["Use Scanner", "addons\beacondetector\beacondetector.sqf",0,-10,false,false,"","('MineDetector' in (items player)) && !BeaconScanInProgress"],

Dexcription.ext
Code: [Select]
class CfgSounds
{
    sounds[] =
{
beep, beep2, beep3, beep4, beep5, beep6, beep7, beep8, beep9
};

class beep
{
sound[] = {"addons\beacondetector\sound\beep.wav", db-10, 0.5};
titles[] = {};
};
class beep2
{
sound[] = {"addons\beacondetector\sound\beep.wav", db-10, 0.6};
titles[] = {};
};
class beep3
{
sound[] = {"addons\beacondetector\sound\beep.wav", db-10, 0.7};
titles[] = {};
};
class beep4
{
sound[] = {"addons\beacondetector\sound\beep.wav", db-10, 0.8};
titles[] = {};
};
class beep5
{
sound[] = {"addons\beacondetector\sound\beep.wav", db-10, 0.9};
titles[] = {};
};
class beep6
{
sound[] = {"addons\beacondetector\sound\beep.wav", db-10, 1.0};
titles[] = {};
};
class beep7
{
sound[] = {"addons\beacondetector\sound\beep.wav", db-10, 1.2};
titles[] = {};
};
class beep8
{
sound[] = {"addons\beacondetector\sound\beep.wav", db-10, 1.4};
titles[] = {};
};
class beep9
{
sound[] = {"addons\beacondetector\sound\beep.wav", db-10, 0.1};
titles[] = {};
};
};
class CfgRemoteExec // applies only to clients
{
class Functions
{
#ifndef A3W_DEBUG
mode = 1; // 0 = block all, 1 = whitelist, 2 = allow all
#else
mode = 2; // debug mode, don't touch
#endif

#include "client\CfgRemoteExec_fnc.hpp"
};
class Commands
{
#ifndef A3W_DEBUG
mode = 1; // 0 = block all, 1 = whitelist, 2 = allow all
#else
mode = 2; // debug mode, don't touch
#endif
};
};

A3Wasteland.Tanoa\addons\beacondetector
Code: [Select]
// @file Version: 1.0
// @file Name: beacondetector.sqf
// @file Author: wiking.at
// Allows tracking of spawn beacons

// Check if script is already active
if (BeaconScanInProgress) exitWith
{
["You are already performing another device scan.", 5] call mf_notify_client;
};

_beaconsnear = nearestObjects [player, ["Land_Tentdome_F", "Land_Device_assembled_F"], 100];

if ((count _beaconsnear) > 0 ) then
{

playsound "beep9"; ["Device found - tracking started.", 5] call mf_notify_client;
BeaconScanInProgress = true;
Beaconscanstop = false;

_distance = 0; //init distance

while {_distance < 100} do
{
_beaconsnear = nearestObjects [player, ["Land_Tentdome_F", "Land_Device_assembled_F"], 100];

if (Beaconscanstop) exitwith
{
playsound "beep9";
["Device scan interrupted.", 5] call mf_notify_client;
BeaconScanInProgress = false;
};

if (count _beaconsnear == 0) exitwith
{
playsound "beep9";
["No devices in detector range.", 5] call mf_notify_client;
BeaconScanInProgress = false;
};

_nearestbeacon = _beaconsnear select 0;
_distance = player distance _nearestbeacon;
_dir = getdir (vehicle player);
_degree = ((getpos _nearestbeacon select 0) - (getpos player select 0)) atan2 ((getpos _nearestbeacon select 1) - (getpos player select 1));
if (_degree < 0) then { _degree = _degree + 360};
_difference = _degree - _dir;
if (_difference > 180) then { _difference = _difference - 360};
if (_difference < -180) then { _difference = _difference + 360};
_adjusteddiff = (abs _difference);
_beepfreq = ((_adjusteddiff / 50) + 0.25);



switch (true) do
{
case (_distance < 6) : {playsound "beep6";};
case (_distance < 10) : {playsound "beep5";};
case (_distance < 20) : {playsound "beep4";};
case (_distance < 30) : {playsound "beep3";};
case (_distance < 50) : {playsound "beep2";};
case (_distance < 100) : {playsound "beep";};
default {
//default case should not happen
playsound "beep9";
["There was a malfunction of your device detector.", 5] call mf_notify_client;
};
};
sleep _beepfreq;

};
}
else
{
playsound "beep9";
["No device in detector range.", 5] call mf_notify_client;
};


NO WORK
:-\

THANK
  • Offline CREAMPIE
  • Armaholic
  • Veteran
  • ******
  • Posts: 1085
  • ^_^;;

Re: BEACON-SCAN

« Reply #1 posted: Jul 23, 2016, 10:29 AM »
HELLO
And for me it impossible beacon detector opens the menu to place my mouse :-\

ADD/PLAYERFONCT...
Code: [Select]
["Use Scanner", "addons\beacondetector\beacondetector.sqf",0,-10,false,false,"","('MineDetector' in (items player)) && !BeaconScanInProgress"],

NO WORK
:-\

THANK

There's quite a few more commits than just adding the action to the playerActions. Search a working mission for beacondetector and add all commits

- from the grassy knoll -

Re: BEACON-SCAN

« Reply #2 posted: Jul 23, 2016, 01:18 PM »
There's quite a few more commits than just adding the action to the playerActions. Search a working mission for beacondetector and add all commits


sory lite info
there is nothing else to add it seems

Re: BEACON-SCAN

« Reply #4 posted: Jul 24, 2016, 02:43 PM »
thank you very much works WONDER :-*@CREAMPIE


I have another question
and it can change the layout of the drop-down menu ?
add an icon to impossible for me ?
thank you in advance


  • Offline CREAMPIE
  • Armaholic
  • Veteran
  • ******
  • Posts: 1085
  • ^_^;;

Re: BEACON-SCAN

« Reply #5 posted: Jul 24, 2016, 03:27 PM »
thank you very much works WONDER :-*@CREAMPIE


I have another question
and it can change the layout of the drop-down menu ?
add an icon to impossible for me ?
thank you in advance

Like this ?




Get the icon here - https://github.com/CRE4MPIE/A3Wasteland_v0.9_CQB.Tanoa/tree/master/client/icons/scan.paa

Add the Icon to the playerAction here -
https://github.com/CRE4MPIE/A3Wasteland_v0.9_CQB.Tanoa/blob/master/client/functions/playerActions.sqf#L34

Goodluck :)

- from the grassy knoll -