Jump to content

Add ATMs in traders (Altis)


Narines

Recommended Posts

  • 2 months later...

I'm getting

26.06.2015 22:16:42: Sandman (xx.xx.x.xx:xxxx) f17c6a54a1211cedda129cf95cd1e2b5 - #22 "e 1 "mpmissions\__CUR_MP.altis\init.sqf"

if (isServer) then {
execVM "\q\addons\traderATMs\init.sqf";
};"
The Init.sqf file is attached to the epoch.altis.pdo right?
Link to comment
Share on other sites

Alright I have the PBO in @Epochhive/addons i then went into MPMissions and downloaded Epoch.altis.pbo, extracted it, added Init.sqf opened it up then pasted

if (isServer) then {

    execVM "\q\addons\traderATMs\init.sqf";
};
inside of it. Packed everything back up to Epoch.Altis.pbo and threw it back into MPMissions. Still get the same error
Link to comment
Share on other sites

  • 4 weeks later...
  • 1 year later...
On 4/22/2017 at 0:44 AM, Gaming Junkie said:

Anyone have an updated version

No but here is Narines which works just fine still.

traderATMs.pbo has only two file within it.

init.sqf

/*
Add ATMs to Altis traders
Author: Narines
v 1.1
Optimized following the recommendations of Kroenen. 
*/
private["_atms"];
 _atms = [
	 [[13326.2, 14498.5], 248],
	 [[6199.3, 16847.2], 56], 
	 [[18468.7, 14268.9], 86]
 ];
 
 {
	private ["_atm"];
	_atm = createVehicle ["Land_Atm_01_F", _x select 0, [], 0, "CAN_COLLIDE"];
	
		_atm setDir (_x select 1);
		_atm setPos (_x select 0);
	
} foreach _atms;

$PREFIX$

q\addons\traderATMs

 

So First create a folder called traderATMs.

then create file called init.sqf and create file called $PREFIX$ within the traderATMs folder.

PBO said folder.

In your mission file, should be  a file called initServer.sqf if not make one.

then insert the code below.

if (isServer) then {
	[] execVM "\q\addons\traderATMs\init.sqf";
};

save it and pbo your mission file again, now its done

instruction on the first post are still validate for install

hope this helps

natoed

 

Link to comment
Share on other sites

  • 2 months later...
On 18.01.2015 at 9:17 AM, Narines said:

Hi,

 

This script is extremely simple.

 

1 - In '@epochhive/addons' add the following pbo (traderATMs.pbo) :

 

https://dl.dropboxusercontent.com/u/63143678/epoch_scripts/traderATMs.pbo

 

2 - In your 'MPMissions' folder, unpack 'epoch.Altis.pbo'

 

3 - In your unpacked 'epoch.Altis' folder, open init.sqf and add the following at the very top :


if (isServer) then {
    execVM "\q\addons\traderATMs\init.sqf";
};

Note : if there is no init.sqf in the root of your unpacked 'epoch.Altis' folder, just create one.

 

4 - Repack 'epoch.Altis' into 'epoch.Altis.pbo'

 

That's it !

 

**EDIT** Optimized following Kroenen's suggestions

Could you upload files again? The files are not found.

Link to comment
Share on other sites

  • 2 months later...
On 1/18/2015 at 8:17 AM, Narines said:

Hi,

 

This script is extremely simple.

 

1 - In '@epochhive/addons' add the following pbo (traderATMs.pbo) :

 

https://dl.dropboxusercontent.com/u/63143678/epoch_scripts/traderATMs.pbo

 

2 - In your 'MPMissions' folder, unpack 'epoch.Altis.pbo'

 

3 - In your unpacked 'epoch.Altis' folder, open init.sqf and add the following at the very top :


if (isServer) then {
    execVM "\q\addons\traderATMs\init.sqf";
};

Note : if there is no init.sqf in the root of your unpacked 'epoch.Altis' folder, just create one.

 

4 - Repack 'epoch.Altis' into 'epoch.Altis.pbo'

 

That's it !

 

**EDIT** Optimized following Kroenen's suggestions

The dropbox link is broken. Is this PBO available elsewhere?

Link to comment
Share on other sites

On 4/21/2017 at 4:39 PM, natoed said:

No but here is Narines which works just fine still.

traderATMs.pbo has only two file within it.

init.sqf


/*
Add ATMs to Altis traders
Author: Narines
v 1.1
Optimized following the recommendations of Kroenen. 
*/
private["_atms"];
 _atms = [
	 [[13326.2, 14498.5], 248],
	 [[6199.3, 16847.2], 56], 
	 [[18468.7, 14268.9], 86]
 ];
 
 {
	private ["_atm"];
	_atm = createVehicle ["Land_Atm_01_F", _x select 0, [], 0, "CAN_COLLIDE"];
	
		_atm setDir (_x select 1);
		_atm setPos (_x select 0);
	
} foreach _atms;

$PREFIX$


q\addons\traderATMs

 

So First create a folder called traderATMs.

then create file called init.sqf and create file called $PREFIX$ within the traderATMs folder.

PBO said folder.

In your mission file, should be  a file called initServer.sqf if not make one.

then insert the code below.


if (isServer) then {
	[] execVM "\q\addons\traderATMs\init.sqf";
};

save it and pbo your mission file again, now its done

instruction on the first post are still validate for install

hope this helps

natoed

 

NatoED was nice enough to make this instructional reply for you guys. Try this out  @Cyrus

Link to comment
Share on other sites

  • 9 months later...

Hi Guys trying to add this but getting this error:

Spoiler

20:13:14 Error in expression <e 1 "q\addons\traderATMs\init.sqf"

private["_atms"];

_atms = [

[[24403.>

20:13:14   Error position: <

private["_atms"];

_atms = [

[[24403.>

20:13:14   Error Invalid number in expression

20:13:14 File q\addons\traderATMs\init.sqf, line 6

20:13:14 Error in expression <e 1 "q\addons\traderATMs\init.sqf"

this is the code just added new coords

Spoiler

/*
Add ATMs to Altis traders
Author: Narines
v 1.1
Optimized following the recommendations of Kroenen. 
*/
private["_atms"];
 _atms = [
     [[24403.1, 13954.7], 248],
     [[23181.2, 19779.6], 56], 
     [[37159.2, 20244.9], 86],
     [[4071.08, 19456.9], 86],
     [[30855.4, 9634.7], 86],
     [[19032, 33977.2], 86]
 ];
 
 {
    private ["_atm"];
    _atm = createVehicle ["Land_Atm_01_F", _x select 0, [], 0, "CAN_COLLIDE"];
    
        _atm setDir (_x select 1);
        _atm setPos (_x select 0);
    
} foreach _atms;

any help would be great thanks

MegaZ

 

UPDATE all fixed and working now thanks to Grahame - there were some weird characters on the end of my file.

Edited by megaz
fixed
Link to comment
Share on other sites

On 7/17/2018 at 3:17 PM, megaz said:

Hi Guys trying to add this but getting this error:

  Hide contents


20:13:14 Error in expression <e 1 "q\addons\traderATMs\init.sqf"


private["_atms"];


_atms = [


[[24403.>


20:13:14   Error position: <


private["_atms"];


_atms = [


[[24403.>


20:13:14   Error Invalid number in expression


20:13:14 File q\addons\traderATMs\init.sqf, line 6


20:13:14 Error in expression <e 1 "q\addons\traderATMs\init.sqf"

this is the code just added new coords

  Hide contents

/*
Add ATMs to Altis traders
Author: Narines
v 1.1
Optimized following the recommendations of Kroenen. 
*/
private["_atms"];
 _atms = [
     [[24403.1, 13954.7], 248],
     [[23181.2, 19779.6], 56], 
     [[37159.2, 20244.9], 86],
     [[4071.08, 19456.9], 86],
     [[30855.4, 9634.7], 86],
     [[19032, 33977.2], 86]
 ];
 
 {
    private ["_atm"];
    _atm = createVehicle ["Land_Atm_01_F", _x select 0, [], 0, "CAN_COLLIDE"];
    
        _atm setDir (_x select 1);
        _atm setPos (_x select 0);
    
} foreach _atms; 

any help would be great thanks

MegaZ

I did a little testing. The script itself seems to work fine but you picked up a special character somewhere. You might want to check positions of those ATMs. Below is a little script you can use to see where stuff spawns which you can run in the editor.

Spoiler

systemChat format["Spawning ATMs at %1",diag_tickTime];

private _exisitingATMs = nearestObjects[[10000,10000,0],["Land_Atm_01_F"],20000];
systemChat format["_exisitingATMs = %1",_exisitingATMs];
if (!(_exisitingATMs isEqualTo []) && typename _exisitingATMs isEqualTo "ARRAY") then
{
    systemChat "Deleting existing ATMs";
    {
        deleteVehicle _x;
    }forEach nearestObjects[[10000,10000,0],["Land_Atm_01_F"],20000];
};
systemChat "Deleting Map Markers";
{
    systemChat format["Deleting Marker %1",_x];
    deleteMarker _x;
}forEach allMapMarkers;
uisleep 3;
diag_log format["Spawning ATMs at %1",diag_tickTime];
{
    systemChat format["_x = %1 index = %2",_x];
    private _atm = createVehicle ["Land_Atm_01_F",[0,0,0], [], 0, "CAN_COLLIDE"];
     
    _atm setDir (_x select 1);
    _atm setPos (_x select 0);
    _mrkrName = format["atm%1",_forEachIndex];
    systemChat _mrkrName;
    uisleep 1;
    private _mrkr = createMarker[_mrkrName,_x select 0];
    _mrkr setMarkerColor "ColorRed";
    _mrkr setMarkerType "mil_dot";
    systemChat format["Created marker %1",_mrkr];
    
} forEach [
     [[24403.1, 13954.7],248],
     [[23181.2, 19779.6],56],
     [[37159.2, 20244.9],86],
     [[4071.08, 19456.9],86],
     [[30855.4, 9634.7],86],
     [[19032, 33977.2],86]
];
systemChat "ATMs spawned";

It is a really minor point, but for this application you can use count instead of forEach as you do not need the _forEachIndex except for debugging.

I hope this is helpful.

Link to comment
Share on other sites

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
  • Discord

×
×
  • Create New...