PlayerResurrect: Difference between revisions
(→Syntax) |
No edit summary |
||
| Line 1: | Line 1: | ||
{{ | This event is called everytime a player resurrects. | ||
{{ClientsideCsJsEvent}} | |||
{{CSharpContainer| | |||
<syntaxhighlight lang="c#"> | |||
public delegate void OnPlayerResurrectDelegate(); | |||
</syntaxhighlight> | |||
{{Parameters}} | |||
* This event has no parameters | |||
{{Example}} | |||
The example below shows a chat message to the client when they respawn. | |||
== | <syntaxhighlight lang="c#"> | ||
Events.OnPlayerResurrect += OnPlayerResurrect; | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="c#"> | |||
public void OnPlayerResurrect() | |||
{ | |||
RAGE.Chat.Output($"YOU'RE ALIVE!?"); | |||
} | |||
</syntaxhighlight> | |||
}} | |||
{{JSContainer| | |||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
mp.events.add('playerResurrect', () => {}); | mp.events.add('playerResurrect', () => {}); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{Parameters}} | |||
* '''none''', this event has no params. | * '''none''', this event has no params. | ||
{{Example}} | |||
The example below shows up a message for a player when he resurrects. | The example below shows up a message for a player when he resurrects. | ||
| Line 21: | Line 38: | ||
}); | }); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | |||
Revision as of 10:54, 29 November 2018
This event is called everytime a player resurrects.
Client-Side Event
C# Syntax
public delegate void OnPlayerResurrectDelegate();
Parameters
- This event has no parameters
Example
The example below shows a chat message to the client when they respawn.
Events.OnPlayerResurrect += OnPlayerResurrect;
public void OnPlayerResurrect()
{
RAGE.Chat.Output($"YOU'RE ALIVE!?");
}
JavaScript Syntax
mp.events.add('playerResurrect', () => {});
Parameters
- none, this event has no params.
Example
The example below shows up a message for a player when he resurrects.
mp.events.add('playerResurrect', () => {
mp.gui.chat.push('Like a fenix raised from the ashes, you came back to us!');
});