OnColShapeLeave: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 6: Line 6:
onColShapeLeave ( player thePlayer )
onColShapeLeave ( player thePlayer )
</syntaxhighlight>  
</syntaxhighlight>  
==Variables==
* The source of this event refers to the col object in which a player has left
*'''player''': A player element representing the player who exited the col shape.


==Example==  
==Example==  
Line 19: Line 24:
end
end
</syntaxhighlight>
</syntaxhighlight>
==See Also==
{{Event_functions}}

Revision as of 15:33, 2 December 2006

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

Syntax

onColShapeLeave ( player thePlayer )


Variables

  • The source of this event refers to the col object in which a player has left
  • player: A player element representing the player who exited the col shape.

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

See Also