OK so for future readers the general syntax for rectangle based terraform parameters and orders is:
local terraformParametersArray = {}
terraformParametersArray[1]
(a number) --
terraform_type -- 1
level, 2
raise, 3
smooth, 4
ramp, 5 = restore
terraformParametersArray[2]
(a number) --
team -- teamID of the team doing the terraform
terraformParametersArray[3]
(a number) --
loop -- true
(1), and false
(0) --needs to be true to create closed rectangle, false only terraforms along the lasso line
terraformParametersArray[4]
(a number) --
terraform_command_height = height change value of the terraform order relative to the ground, uses positive numbers or negative numbers.
terraformParametersArray[5]
(a number) --
#coordinates -- how many (x,z) coordinate point there are in the rectangle/linedraw
terraformParametersArray[6]
(a number) --
#selectedconstructorsArray -- how many constructors will recieve this terraform order
terraformParametersArray[7]
(a number) --
volumeSelection -- 0
none, 1
only raise, 2 = only lower -- raise only will block terracommands with negative height input, lower only will block terracommands with positive height input. This parameter should normally be left 0, because it can interfere with restore and interefere with smooth.
terraformParametersArray[8] = (a number) -- rectangle corner 1, x1
terraformParametersArray[9] = (a number) -- rectangle corner 1, z1
terraformParametersArray[10] =(a number) -- rectangle corner 2, x2
terraformParametersArray[11] =(a number) -- rectangle corner 2, z2
terraformParametersArray[12] =(a number) -- rectangle corner 3, x3
terraformParametersArray[13] =(a number) -- rectangle corner 3, z3
terraformParametersArray[14] =(a number) -- rectangle corner 4, x4
terraformParametersArray[15] =(a number) -- rectangle corner 4, z4
--every additional param after parameter[15] must always be another constructor's unitid that will inherit the order to assisting the terraunits created by the commandid.
terraformParametersArray[16] =(a number) -- unitID == selectedconstructorsArray[a number index]
spGiveOrderToUnit(unitID, CMD_TERRAFORM_INTERNAL, terraformParametersArray, {"shift"})