PlayerResurrect: Difference between revisions
m (category) |
mNo edit summary |
||
| Line 1: | Line 1: | ||
This event is called everytime a player resurrects. | This event is called everytime a player resurrects. | ||
{{ClientsideCsJsEvent}} | {{ClientsideCsJsEvent}} | ||
{{CSharpContainer| | {{CSharpContainer| | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="csharp"> | ||
public delegate void OnPlayerResurrectDelegate(); | public delegate void OnPlayerResurrectDelegate(); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{Parameters}} | {{Parameters}} | ||
''This event has no parameters'' | |||
{{Example}} | {{Example}} | ||
The example below shows a chat message to the client when they respawn. | The example below shows a chat message to the client when they respawn. | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="csharp"> | ||
Events.OnPlayerResurrect += OnPlayerResurrect; | Events.OnPlayerResurrect += OnPlayerResurrect; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="csharp"> | ||
public void OnPlayerResurrect() | public void OnPlayerResurrect() | ||
{ | { | ||
| Line 28: | Line 30: | ||
{{Parameters}} | {{Parameters}} | ||
''This event has no parameters'' | |||
{{Example}} | {{Example}} | ||
| Line 40: | Line 42: | ||
}} | }} | ||
== See also == | |||
* [[playerSpawn]] | |||
[[Category:Player]] | [[Category:Player]] | ||
[[Category:Client-side Event]] | [[Category:Client-side Event]] | ||
Revision as of 14:05, 23 May 2019
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
This event has no parameters
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!');
});