PlayerExitColshape: Difference between revisions
(Added client-side example) |
CocaColaBear (talk | contribs) No edit summary |
||
| Line 9: | Line 9: | ||
<div style="margin: 10px 10px 10px 10px;"><b>Server-Side</b></div> | <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); | |||
function playerExitColshapeHandler(player, shape) { | |||
if(shape == someColShape) { | |||
console.log(`${player.name} left the colshape!`); | |||
} | } | ||
} | |||
mp.events.add("playerExitColshape", playerExitColshapeHandler); | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</div> | </div> | ||
| Line 25: | Line 25: | ||
<div style="margin: 10px 10px 10px 10px;"><b>Client-Side</b></div> | <div style="margin: 10px 10px 10px 10px;"><b>Client-Side</b></div> | ||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
let someColShape = mp.colshapes.newRectangle(0, 0, 100, 100); | |||
function playerExitColshapeHandler(shape) { | |||
if(shape == someColShape) { | |||
//Local player left the colshape | |||
} | } | ||
} | |||
mp.events.add("playerExitColshape", playerExitColshapeHandler); | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</div> | </div> | ||
Revision as of 20:41, 15 October 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);
Client-Side
let someColShape = mp.colshapes.newRectangle(0, 0, 100, 100);
function playerExitColshapeHandler(shape) {
if(shape == someColShape) {
//Local player left the colshape
}
}
mp.events.add("playerExitColshape", playerExitColshapeHandler);
See also
Checkpoint
Colshape
Entity
Player
- playerChat
- playerCommand
- playerDamage
- playerDeath
- playerJoin
- playerQuit
- playerReady
- playerSpawn
- playerWeaponChange
Streaming
Vehicle
- playerStartEnterVehicle
- playerEnterVehicle
- playerStartExitVehicle
- playerExitVehicle
- trailerAttached
- vehicleDamage
- vehicleDeath
- vehicleHornToggle
- vehicleSirenToggle