Difference between revisions of "DCS func setCode"
From DCS World Wiki - Hoggitworld.com
m (1 revision imported) |
|||
(One intermediate revision by the same user not shown) | |||
Line 36: | Line 36: | ||
[[DCS_Class_Spot|'''Spot Functions:''']] {{listofScriptingSpotFuncs}} | [[DCS_Class_Spot|'''Spot Functions:''']] {{listofScriptingSpotFuncs}} | ||
− | |examples= | + | |examples= The following creates a function that could be called to change the laser code to a passed value or if nothing is passed a default value like something an idiot would use for their luggage. |
+ | |||
+ | local ray = Spot.createLaser(jtac, {x = 0, y = 1, z = 0}, Unit.getByName('target'):getPoint(), 1337) | ||
+ | local function changeCodePlease(code) | ||
+ | local c = code or 1234 | ||
+ | ray:setCode(c) | ||
+ | end | ||
|notes= | |notes= | ||
}} | }} | ||
[[Category:Class Functions|setCode]] | [[Category:Class Functions|setCode]] | ||
+ | [[Category:Game Patch 1.2.6|setCode]] |