Jump to content

Placed Map Objects Accurately Using Infistar Anti-Hack


Recommended Posts

Maybe it's just me, but whenever I spawn a building/object via Infistar, it seems to go in a random spot.

It's pretty difficult to place objects accurately.

 

So, when I found out you could make a file called admin_start.sqf in your ArmA 2 Operation Arrowhead folder and press ALT+F11 to execute the script, I made this script to make my placements more accurate.

 

(This code will place the object directly on your head so make sure to have God Mode on.)

 

Make a file called admin_start.sqf in your ArmA 2 Operation Arrowhead folder (same folder as your ArmA2OA.exe) then paste this code in:

_objectPlaced = "Land_Misc_Cargo2C";



// Automagically grab position of player (for output later).

_objectPosition = (getPos player);



// Spawn object on top of player.

_placement = _objectPlaced createVehicle getPos player;



// Set its position to ontop of the player

_placement setPos (getPos player);



// Get the direction the player is facing + alter rotation

_placement setDir (getDir player + 180);



// Wait 3 seconds

sleep 3;



// Set the height of the object (in meters) if required

//_placement setPos [(getPos _placement) select 0, (getPos _placement) select 1, 0.2];



systemchat format ["Placed %1 at %2 - remember to INSERT it into the database",_objectPlaced,_objectPosition];

Go ingame, position yourself, press ALT+F11. You can alt-tab out of the game to change the classname without having to restart the server.

 

You can find classnames for almost everything here:
http://www.armatechsquad.com/ArmA2Class151656165165341654165165165165f/index.php

 

The code is very simple (probably not 100% perfect but t works) and commented to help.

_objectPlaced = "Land_Misc_Cargo2C";

is where you place the classname of the object you wish to spawn.

 

If you wish to set the height of the object, remove the "//" from the line, enable the Infistar Debug Monitor and use the last numbers in the brackets.

For example:

_placement setPos [(getPos _placement) select 0, (getPos _placement) select 1, 12.34];

will set the object to 12.34 (meters) in the air.

 

I find this very useful for admin events and helping players position tricky objects in their bases.

 

Thanks to:
Infistar for the Admin Tools.

BioHazard for assistance in testing.

 

 

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

×
×
  • Create New...