IsElementWithinMarker: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
m (→Example) |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 5: | Line 5: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">bool isElementWithinMarker ( element theElement, marker theMarker )</syntaxhighlight> | <syntaxhighlight lang="lua">bool isElementWithinMarker ( element theElement, marker theMarker )</syntaxhighlight> | ||
{{OOP||[[element]]:isWithinMarker||}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
Line 15: | Line 16: | ||
==Example== | ==Example== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
dutymarker = createMarker(126.56, 254.98, 78.9, | local dutymarker = createMarker(126.56, 254.98, 78.9, "cylinder", 2.0, 255, 0, 0, 150) | ||
function duty(thePlayer | function duty(thePlayer) | ||
if isElementWithinMarker(thePlayer, dutymarker) then | |||
giveWeapon(thePlayer, 22, 100, 1) | |||
else | |||
outputChatBox("You are not at the right place!", thePlayer, 255, 0, 0) | |||
end | |||
end | end | ||
addCommandHandler("duty", duty) | addCommandHandler("duty", duty) | ||
Line 29: | Line 30: | ||
==See Also== | ==See Also== | ||
{{Marker functions}} | {{Marker functions}} | ||
[[ru:isElementWithinMarker]] |
Latest revision as of 10:53, 18 August 2018
This function is used to determine if an element is within a marker.
Syntax
bool isElementWithinMarker ( element theElement, marker theMarker )
OOP Syntax Help! I don't understand this!
- Method: element:isWithinMarker(...)
Required Arguments
Returns
Returns true if the element is within the marker, false otherwise
Example
local dutymarker = createMarker(126.56, 254.98, 78.9, "cylinder", 2.0, 255, 0, 0, 150) function duty(thePlayer) if isElementWithinMarker(thePlayer, dutymarker) then giveWeapon(thePlayer, 22, 100, 1) else outputChatBox("You are not at the right place!", thePlayer, 255, 0, 0) end end addCommandHandler("duty", duty)