PlayerEnterColshape: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
mNo edit summary
Line 1: Line 1:
This event is triggered when a player enters a colshape.  
This event is triggered when a player enters a colshape.  


Default dimension for Colshapes is 0, and the player must be in the same dimension than the Colshape for them to collide.
Default dimension for Colshapes is 0, and the player must be in the same dimension as the Colshape for them to collide.
{{ServersideCsJsEvent}}
{{ServersideCsJsEvent}}



Revision as of 16:25, 27 November 2018

This event is triggered when a player enters a colshape.

Default dimension for Colshapes is 0, and the player must be in the same dimension as the Colshape for them to collide.

Server-Side
Event

 C#  JavaScript



JavaScript Syntax

Parameters

  • player - player which entered the colshape
  • shape - the colshape the player entered

Example

let someColShape = mp.colshapes.newRectangle(0, 0, 100, 100);

function playerEnterColshapeHandler(player, shape) {
  if(shape == someColShape) {
    console.log(`${player.name} entered the colshape`);
  }
}

mp.events.add("playerEnterColshape", playerEnterColshapeHandler);


Client-Side Event

 C#  JavaScript


JavaScript Syntax

mp.events.add('playerEnterColshape', (shape) => {
    mp.game.graphics.notify(`You entered a colshape with id "${shape.id}".`);
});


See also

Checkpoint

Colshape

Entity

Player

Streaming

Vehicle

Waypoint