LUA Command to Drop Contact

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
Posts: 74
Joined: Wed Oct 19, 2011 4:28 pm

LUA Command to Drop Contact

Post by tmoilanen »

How do you drop a contact via LUA?

I created a Unit Remains in Area Trigger for x time, after which the airfield group changes to the red side via the code below. The airfield still remains as a contact on the red side after this event, and I would like to add syntax that drops the contact.

Code: Select all

local myside = 'AIRCOM'
 local mynewside = 'VKS'
 local myname = {'Kirkenes Airport'}
 for i = 1, #myname

Any help would be appreciated.
Posts: 1557
Joined: Thu Nov 15, 2018 7:24 pm

RE: LUA Command to Drop Contact

Post by KnightHawk75 »

Once you get the contact wrapper from the side in question's perspective you can just call wrapperVar:DropContact();

local c = GetContact(side='oldside',guid='TheContactGuidHere') --reminders it's not the same as unit guid.

While back you can find example of something similar: (#10 shows cleaning up the contact)
Post Reply

Return to “Lua Legion”