SetSearchLightEndRadius: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
DezZolation (talk | contribs) No edit summary |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Client function}} | {{Client function}} | ||
This function sets the end radius of a [[Element/Searchlight|searchlight]] element. | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool setSearchLightEndRadius ( searchlight theSearchlight, float endRadius ) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[Element/Searchlight|searchLight]]:setEndRadius|endRadius|getSearchLightEndRadius}} | {{OOP||[[Element/Searchlight|searchLight]]:setEndRadius|endRadius|getSearchLightEndRadius}} | ||
Line 19: | Line 18: | ||
==Example== | ==Example== | ||
This example creates a skywalker light on top of Los Santos' skyscraper and turns it on/off every second by setting it's ending radius and starting radius to 0. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- | skywalkerLight = createSearchLight (1544, -1353.5, 330, 1528, -1347, 360, 0.2, 3, false) | ||
setTimer (function () | |||
if not off then | |||
setSearchLightStartRadius (skywalkerLight, 0) | |||
setSearchLightEndRadius (skywalkerLight, 0) | |||
off = true | |||
else | |||
setSearchLightStartRadius (skywalkerLight, 0.2) | |||
setSearchLightEndRadius (skywalkerLight, 3) | |||
off = false | |||
end | |||
end, 1000, 0) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See also== | ==See also== | ||
{{Client_searchlight_functions}} | {{Client_searchlight_functions}} |
Latest revision as of 11:12, 20 March 2019
This function sets the end radius of a searchlight element.
Syntax
bool setSearchLightEndRadius ( searchlight theSearchlight, float endRadius )
OOP Syntax Help! I don't understand this!
- Method: searchLight:setEndRadius(...)
- Variable: .endRadius
- Counterpart: getSearchLightEndRadius
Required Arguments
- theSearchLight: the searchlight to modify the property of.
- endRadius: the radius of the searchlight's light cone in its end.
Returns
If every argument is correct, this function returns true. If not, it will return false plus an error message.
Example
This example creates a skywalker light on top of Los Santos' skyscraper and turns it on/off every second by setting it's ending radius and starting radius to 0.
skywalkerLight = createSearchLight (1544, -1353.5, 330, 1528, -1347, 360, 0.2, 3, false) setTimer (function () if not off then setSearchLightStartRadius (skywalkerLight, 0) setSearchLightEndRadius (skywalkerLight, 0) off = true else setSearchLightStartRadius (skywalkerLight, 0.2) setSearchLightEndRadius (skywalkerLight, 3) off = false end end, 1000, 0)
See also
- createSearchLight
- getSearchLightEndPosition
- getSearchLightEndRadius
- getSearchLightStartPosition
- getSearchLightStartRadius
- setSearchLightEndPosition
- setSearchLightEndRadius
- setSearchLightStartPosition
- setSearchLightStartRadius