PlayerCreateWaypoint: Difference between revisions

From RAGE Multiplayer Wiki
mNo edit summary
No edit summary
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
'''DOES NOT SEEM TO WORK IN CURRENT 0.3.7 VERSION'''
{{ClientsideCsJsEvent}}
Triggered when a player creates a waypoint on the map.


Event triggered when a player creates a waypoint
{{CSharpContainer|
<syntaxhighlight lang="c#">
public delegate void OnPlayerCreateWaypointDelegate(Vector3 position);
</syntaxhighlight>


==Parameters==
{{Parameters}}
* '''player'''
* '''position''': Position of created waypoint.
* '''position''', Vector3 position of the waypoint


==Example==
{{Example}}
<syntaxhighlight lang="javascript">
The example below shows up a message for a player when waypoint is set and sends the coordinates.
mp.events.add("playerCreateWaypoint", (player, position) => {
 
// Do what you want.
<syntaxhighlight lang="c#">
RAGE.Events.OnPlayerCreateWaypoint += OnWaypointCreated;
</syntaxhighlight>
<syntaxhighlight lang="c#">
public void OnWaypointCreated(Vector3 position)
{
    RAGE.Chat.Output($"You have just created a waypoint with coords: {position}");
}
</syntaxhighlight>
}}
 
{{JSContainer|
=== Parameters ===
* '''position''': {{RageType|Vector3}}
 
== Examples ==
{{ClientsideCode|
<pre>
mp.events.add("playerCreateWaypoint", (position) => {
    mp.console.logInfo(`New waypoint created at: ${position.x}, ${position.y}, ${position.z}`);
});
});
</syntaxhighlight>
</pre>
}}
}}
 
== See Also ==
{{Player_events_clientside}}
 
[[Category:Waypoint]]
[[Category:Clientside API]]
[[Category:Client-side Event]]

Latest revision as of 18:49, 18 February 2021

Client-Side Event

 C#  JavaScript


Triggered when a player creates a waypoint on the map.


C# Syntax

public delegate void OnPlayerCreateWaypointDelegate(Vector3 position);

Parameters

  • position: Position of created waypoint.

Example

The example below shows up a message for a player when waypoint is set and sends the coordinates.

RAGE.Events.OnPlayerCreateWaypoint += OnWaypointCreated;
public void OnWaypointCreated(Vector3 position)
{
    RAGE.Chat.Output($"You have just created a waypoint with coords: {position}");
}


JavaScript Syntax

Parameters

  • position: Vector3

Examples

Client-Side
mp.events.add("playerCreateWaypoint", (position) => {
    mp.console.logInfo(`New waypoint created at: ${position.x}, ${position.y}, ${position.z}`);
});


See Also

Browser

Checkpoints

Colshapes

Console

Common

Damage

Vehicles

Voice chat

Streaming

Graphics

Waypoint

Misc