• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] help about GameTextForPlayer
#3
(2024-06-07, 11:03 AM)N0FeaR Wrote: GameTextForPlayer function does not support newline characters (\n) for creating multi-line texts. This is a limitation of the SA-MP text drawing functions. However, you can use the TextDraw system to achieve multi-line
Below is an example of how you can do this

PHP Code:
new Text:line1;
new 
Text:line2;

public 
OnGameModeInit() {
    line1 TextDrawCreate(320.0240.0"LINE ONE");
    TextDrawFont(line11);
    TextDrawLetterSize(line10.31.2);
    TextDrawColor(line10xFFFFFFFF);
    TextDrawSetOutline(line11);

    line2 TextDrawCreate(320.0255.0"LINE TWO");
    TextDrawFont(line21);
    TextDrawLetterSize(line20.31.2);
    TextDrawColor(line20xFFFFFFFF);
    TextDrawSetOutline(line21);
}

public 
OnPlayerConnect(playerid) {
    ShowPlayerGameText(playerid);
}

ShowPlayerGameText(playerid) {
    TextDrawShowForPlayer(playeridline1);
    TextDrawShowForPlayer(playeridline2);


I found a solution, thanks for the answer.
I used it this way and it worked:

PHP Code:
GameTextForPlayer(playerid"LINE ONE ~n~ LINE TWO"30004); 
RECEBA! É O CARA DA LUVA DE PEDREIRO!
GRAÇAS A DEUS PAI! O MELHOR DO MUNDO!

[Image: giphy.gif]
  Reply


Messages In This Thread
help about GameTextForPlayer - by LuvaDePedreiro - 2024-06-05, 09:52 PM
RE: help about GameTextForPlayer - by N0FeaR - 2024-06-07, 11:03 AM
RE: help about GameTextForPlayer - by LuvaDePedreiro - 2024-06-09, 12:03 PM
RE: help about GameTextForPlayer - by Mido - 2024-06-10, 07:11 PM

Forum Jump: