Jump to content

Dynamic Drug Dealer v2.2 - 4.4 > 5.0


Drunken Cheetah

Recommended Posts

Before we begin. This has been made for and tested on the latest release for AsYetUntitled.

 

Description:

Dynamic Drug Dealer, changes position every X minutes and stays put for X minutes. Compatible with any object/character in Arma 3 for both civ's for store and cops for "Question Dealer".

 

THIS SCRIPT UTILIZES THE LIFE_SERVER FOLDER. BEFORE CONTINUING, PLEASE MAKE SURE TO MAKE A BACKUP OF YOUR LIFE_SERVER FOLDER. I AM NOT RESPONSIBLE FOR ANY MISTAKES MADE.

 

If you don't have it already, create a folder in your life_server > Functions.
Create a new file called: fn_initDD.sqf inside that document, add the following;

 

#include "\life_server\script_macros.hpp"

/*
	Author: Drunken Cheetah
	File: fn_initDD.sqf

	Desc: Initializes drug dealer before changing spots begins.
*/

//sleep(5*60);		//testing
sleep(10*60);
[]spawn TON_fnc_drugdealerInit;

 

Save that file, and heaed over to life_server >> config.cpp and add the following under TON_Systems

 

class missions {
			file = "\life_server\Functions\Scripts";
			class initDD {};
			class drugdealerInit {};
		};

 

save that file, and head to life_server >> init.sqf and add the following after;

life_wanted_list = [];

>>

[] execVM "\life_server\Functions\Scripts\fn_initDD.sqf";

Create a new file in the scripts folder called fn_drugdealerInit.sqf and add the following inside;

#include "\life_server\script_macros.hpp"

/*
    File Name: fn_drugdealerInit.sqf
	Author: Drunken Cheetah  
	Desc: Dynamic drug dealer, moves position every X minutes.
	Version: 2.2
*/

private["_drug1","_positions","_spawnPos","_man","_stayTime","_debug"];
if(LIFE_SETTINGS(getNumber, "enable_drugDealer") isEqualTo 0) exitWith {};
_man = LIFE_SETTINGS(getText, "man_to_use"); 
_stayTime = LIFE_SETTINGS(getNumber, "drugDealer_position_time");

//change locations here. Make sure each new location has the brackets around it when replacing. e.g [1,2,3,4],
_positions = [[8362.88,12441.3,-3.8147e-006],[15769.8,10645,0],[25372.6,20334.4,1.17488],[14312.4,17413.7,1.90735e-006]];
_spawnPos = _positions select floor random count _positions;

diag_log "..:: Drunken Cheetahs DRUG DEALER SCRIPT - STARTING ::..";
[3,"<t align='center'><t size='2.4'><t color='#FF0000'>Drug Dealer</t></t><br/> The drug dealer has found a new place to deal from!"] remoteExecCall ["life_fnc_broadcast",0];

_drug1 = createMarker ["drug_dealer",_spawnPos];
"drug_dealer" setMarkerColor "ColorEast";
"drug_dealer" setMarkerType "mil_dot";
"drug_dealer" setMarkerText "Drug Dealer";

dd = createVehicle [_man,_spawnPos, [], 0, "CAN_COLLIDE"];
[dd,[localize "STR_MAR_Question_Dealer",life_fnc_questionDealer,"",0,false,false,"",'isNull objectParent player && player distance _target < 5 && playerSide isEqualTo west && !life_action_inUse']] remoteExec ["addAction",0,dd];
[dd,["Drug Dealer",life_fnc_virt_menu,"drugdealer",0,false,false,"",'playerSide isEqualTo civilian']] remoteExec ["addAction",0,dd];
dd allowDamage false;
dd enableSimulation false;

sleep(_stayTime * 60);
[3,"<t align='center'><t size='2.4'><t color='#FF0000'>Drug Dealer</t></t><br/> The drug dealer is packing up and moving to a new location. When he arrives, his new location will be marked on map!"] remoteExecCall ["life_fnc_broadcast",0];
deleteMarker "drug_dealer";
deleteVehicle dd;

[]spawn TON_fnc_initDD;

save that file, and repack your life_server PBO.

 

Heaed over to your mission folder, and open up config >> config_master.hpp and add the following to it

//Drug Dealer - Drunken Cheetah
enable_drugDealer = true;			//Enable/Disable dynamic dealer -- If false, drug dealer wont be on the map at all. Will be changed next version
drugDealer_position_time = 45;		//In minutes
man_to_use = "C_man_hunter_1_F";	//Character/Object to use as the Drug Dealer

Save that file, and re-pack if need be.

Head to the editor, and find your locations for where you want the drug dealer. The current locations are actual locations in Altis at okay-ish locations according to my server.

 

The easiest way to get a new location, is place an object in the location you want, right click the object and click Log > Location.
It will be copied to your clipboard, with the required brackets around it.

 

Make sure to re-pack your mission, & life_server and you should be good to go.
The script will run 10 minutes after the server starts, and the drug dealer will change positions every 45 minutes, thereafter.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

Please update your file with the following;

 

/*
    File: fn_broadcast.sqf
    Author: Bryan "Tonic" Boardwine

    Description:
    Broadcast system used in the life mission for multi-notification purposes.
*/
private ["_type","_message"];
_type = [_this,0,0,[[],0]] call BIS_fnc_param;
_message = [_this,1,"",[""]] call BIS_fnc_param;
_localize = [_this,2,false,[false]] call BIS_fnc_param;
if (_message isEqualTo "") exitWith {};

if (_localize) exitWith {
    _arr = _this select 3;
    _msg = switch (count _arr) do {
        case 0: {localize _message;};
        case 1: {format [localize _message,_arr select 0];};
        case 2: {format [localize _message,_arr select 0, _arr select 1];};
        case 3: {format [localize _message,_arr select 0, _arr select 1, _arr select 2];};
        case 4: {format [localize _message,_arr select 0, _arr select 1, _arr select 2, _arr select 3];};
    };

    if (_type isEqualType []) then {
        for "_i" from 0 to (count _type)-1 do {
            switch (_type select _i) do {
                case 0: {systemChat _msg;};
                case 1: {hint _msg;};
                case 2: {titleText[_msg,"PLAIN"];};
            };
        };
    } else {
        switch (_type) do {
            case 0: {systemChat _msg;};
            case 1: {hint _msg;};
            case 2: {titleText[_msg,"PLAIN"];};
        };
    };
};

if (_type isEqualType []) then {
    for "_i" from 0 to (count _type)-1 do {
        switch (_type select _i) do {
            case 0: {systemChat _message};
            case 1: {hint format ["%1", _message]};
            case 2: {titleText[format ["%1",_message],"PLAIN"];};
			case 3: {hint parseText format ["%1", _message]};
        };
    };
} else {
    switch (_type) do {
        case 0: {systemChat _message};
        case 1: {hint format ["%1", _message]};
        case 2: {titleText[format ["%1",_message],"PLAIN"];};
		case 3: {hint parseText format ["%1", _message]};
    };
};



Then you should be good to go.

Edited by Drunken Cheetah
Link to comment
Share on other sites

  • 2 years later...
On 12/10/2020 at 11:25 AM, Drunken Cheetah said:

If you don't have it already, create a folder in your life_server > Functions.
Create a new file called: fn_initDD.sqf inside that document, add the following;

 

#include "\life_server\script_macros.hpp"

/*
	Author: Drunken Cheetah
	File: fn_initDD.sqf

	Desc: Initializes drug dealer before changing spots begins.
*/

//sleep(5*60);		//testing
sleep(10*60);
[]spawn TON_fnc_drugdealerInit;

 

On 12/10/2020 at 11:25 AM, Drunken Cheetah said:
[] execVM "\life_server\Functions\Scripts\fn_initDD.sqf";

 

Its my assumution that you meant to say save it in life_server\functions\scripts and not life_server\Functions as you OP seems to say?

Link to comment
Share on other sites

Posted (edited)
On 12/10/2020 at 11:25 AM, Drunken Cheetah said:

If you don't have it already, create a folder in your life_server > Functions.
Create a new file called: fn_initDD.sqf inside that document, add the following;

Here you say to save it in life_server\functions

But then here

On 12/10/2020 at 11:25 AM, Drunken Cheetah said:
[] execVM "\life_server\Functions\Scripts\fn_initDD.sqf";

You are calling it from life_server\Functions\Scripts\fn_initDD.sqf NOT life_server\Functions\fn_initDD.sqf as the OP suggests.

Edited by NeoAnonymous
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.