Ui::addTextComponentSubstringPlayerName: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
(yay)
Line 1: Line 1:
� Description :<br><br> Processes a string and removes the player name(max len 99)<br> You can use this function to create notifications/subtitles<br>--------------------------------------------------------------------<br>� Usage(Colors) :<br><br> ~r~ = red<br> ~y~ = yellow<br> ~g~ = green<br> ~b~ = light blue<br> ~w~ = white<br> ~p~ = purple<br> ~n~ = new line<br>--------------------------------------------------------------------<br>� Example (C++):<br><br>void ShowNotification(char *text)  <br>{ <br>        UI::_SET_NOTIFICATION_TEXT_ENTRY('STRING'); <br>        UI::ADD_TEXT_COMPONENT_SUBSTRING_PLAYER_NAME(text); <br>        UI::_DRAW_NOTIFICATION(FALSE, FALSE); // if first param = 1, the message flashes 1 or 2 times<br>}<br><br>� Colors example : <br><br>string red = '~r~Red test';<br>string white_and_yellow = '~w~White and ~y~yellow';<br>string text_with_double_line = 'First line.~n~Second line';<br><br>This native (along with 0x5F68520888E69014 and 0x94CF4AC034C9C986) do not actually filter anything. They simply add the provided text (as of 944)
� Description :<br><br> Processes a string and removes the player name(max len 99)<br> You can use this function to create notifications/subtitles<br>--------------------------------------------------------------------<br>� Usage(Colors) :<br><br> ~r~ = red<br> ~y~ = yellow<br> ~g~ = green<br> ~b~ = light blue<br> ~w~ = white<br> ~p~ = purple<br> ~n~ = new line<br>--------------------------------------------------------------------<br>� Example (C++):<br><br>void ShowNotification(char *text)  <br>{ <br>        UI::_SET_NOTIFICATION_TEXT_ENTRY('STRING'); <br>        UI::ADD_TEXT_COMPONENT_SUBSTRING_PLAYER_NAME(text); <br>        UI::_DRAW_NOTIFICATION(FALSE, FALSE); // if first param = 1, the message flashes 1 or 2 times<br>}<br><br>� Colors example : <br><br>string red = '~r~Red test';<br>string white_and_yellow = '~w~White and ~y~yellow';<br>string text_with_double_line = 'First line.~n~Second line';<br><br>This native (along with 0x5F68520888E69014 and 0x94CF4AC034C9C986) do not actually filter anything. They simply add the provided text (as of 944)
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">ui.addTextComponentSubstringPlayerName(text);</syntaxhighlight>
<syntaxhighlight lang="javascript">mp.game.ui.addTextComponentSubstringPlayerName(text);</syntaxhighlight>
=== Required Arguments ===
=== Required Arguments ===
*'''text:''' String
*'''text:''' String
Line 8: Line 8:
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
todo
// todo
</syntaxhighlight>
</syntaxhighlight>
==See also==
==See also==
{{Ui_function_c}}
{{Ui_s_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Revision as of 21:33, 6 May 2017

� Description :

Processes a string and removes the player name(max len 99)
You can use this function to create notifications/subtitles
--------------------------------------------------------------------
� Usage(Colors) :

~r~ = red
~y~ = yellow
~g~ = green
~b~ = light blue
~w~ = white
~p~ = purple
~n~ = new line
--------------------------------------------------------------------
� Example (C++):

void ShowNotification(char *text)
{
UI::_SET_NOTIFICATION_TEXT_ENTRY('STRING');
UI::ADD_TEXT_COMPONENT_SUBSTRING_PLAYER_NAME(text);
UI::_DRAW_NOTIFICATION(FALSE, FALSE); // if first param = 1, the message flashes 1 or 2 times
}

� Colors example :

string red = '~r~Red test';
string white_and_yellow = '~w~White and ~y~yellow';
string text_with_double_line = 'First line.~n~Second line';

This native (along with 0x5F68520888E69014 and 0x94CF4AC034C9C986) do not actually filter anything. They simply add the provided text (as of 944)

Syntax

mp.game.ui.addTextComponentSubstringPlayerName(text);

Required Arguments

  • text: String

Return value

  • Undefined

Example

// todo

See also