PlayerExitColshape: Difference between revisions
(Initial description) |
(Made example look cooler) |
||
| Line 6: | Line 6: | ||
==Example== | ==Example== | ||
<div class="header" style="background-color: #408DAE; color: #FFFFFF; border: 2px solid #408DAE;"> | |||
<div style="margin: 10px 10px 10px 10px;"><b>Server-Side</b></div> | |||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
let someColShape = mp.colshapes.newRectangle(0, 0, 100, 100); | let someColShape = mp.colshapes.newRectangle(0, 0, 100, 100); | ||
| Line 17: | Line 19: | ||
mp.events.add("playerExitColshape", playerExitColshapeHandler); | mp.events.add("playerExitColshape", playerExitColshapeHandler); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</div> | |||
==See also== | ==See also== | ||
[[Category:Player Events API]] | [[Category:Player Events API]] | ||
Revision as of 19:51, 18 September 2017
This event is triggered when a player exits a colshape.
Parameters
- player - player which exited the colshape
- shape - the colshape the player left
Example
Server-Side
let someColShape = mp.colshapes.newRectangle(0, 0, 100, 100);
function playerExitColshapeHandler(player, shape) {
if(shape == someColShape) {
console.log(player.name + " left the colshape!");
}
}
mp.events.add("playerExitColshape", playerExitColshapeHandler);