OnColShapeLeave

From Multi Theft Auto: Wiki
Revision as of 06:40, 12 September 2006 by Erorr404 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This event is triggered when a player leaves a collision shape.

Syntax

onColShapeLeave ( player thePlayer )

Example

This example kills the player whenever they leave a certain collision shape:

jailZone = createColCircle ( 1024, 1024, 15, 50 ) -- create a collision shape

-- call 'jailZoneLeave' whenever a player leaves the collision shape:
addEventHandler ( "onColShapeLeave", jailZone, "jailZoneLeave" )
function jailZoneLeave ( thePlayer )
   killPlayer ( thePlayer ) -- kill the player
   outputChatBox ( "You are not allowed to leave the jail!", thePlayer )
end