PlayerExitColshape: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
(Added client-side example)
Line 14: Line 14:
     if(shape == someColShape) {
     if(shape == someColShape) {
       console.log(player.name + " left the colshape!");
       console.log(player.name + " left the colshape!");
    }
  }
  mp.events.add("playerExitColshape", playerExitColshapeHandler);
</syntaxhighlight>
</div>
<div class="header" style="background-color: #AE4040; color: #FFFFFF; border: 2px solid #AE4040;">
<div style="margin: 10px 10px 10px 10px;"><b>Client-Side</b></div>
<syntaxhighlight lang="javascript">
  let someColShape = mp.colshapes.newRectangle(0, 0, 100, 100);
  function playerExitColshapeHandler(shape) {
    if(shape == someColShape) {
      //Local player left the colshape
     }
     }
   }
   }

Revision as of 20:25, 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);


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

Streaming

Vehicle

Waypoint