IsElementWithinMarker: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
(i)
Line 15: Line 15:
==Example==
==Example==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--TODO
dutymarker = createMarker(126.56,254.98,78.9,255,0,0)
 
function duty(player, matchingDimension)
if (isElementWithinMarker(player, dutymarker) == true ) then
    giveWeapon(player, 22, 100, 1) 
else
    outputChatBox("You are not at the right place!", player,255,0,0)
end
end
addCommandHandler("duty", duty)
</syntaxhighlight>
</syntaxhighlight>



Revision as of 17:03, 5 June 2010

This function is used to determine if an element is within a marker.

Syntax

bool isElementWithinMarker ( element theElement, marker theMarker )

Required Arguments

  • theElement: The element you're checking.
  • theMarker: The marker you're checking.

Returns

Returns true if the element is within the marker, false otherwise

Example

dutymarker = createMarker(126.56,254.98,78.9,255,0,0)

function duty(player, matchingDimension)
 if (isElementWithinMarker(player, dutymarker) == true ) then
    giveWeapon(player, 22, 100, 1)  
 else
    outputChatBox("You are not at the right place!", player,255,0,0)
 end
end
addCommandHandler("duty", duty)

See Also