Ui::addTextComponentSubstringPlayerName: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
No edit summary
Line 13: Line 13:
{{Ui_s_function_c}}
{{Ui_s_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:UI API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Revision as of 14:54, 20 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