How to use vars in textdraws
#1

I need help i dont know how to use vars into a textdraw

i need something like this

Код:
Textdraw1 = TextDrawCreate(3.000000,431.000000,"$s:$s Para entregar el auto", m1, m2);
That is what i make, that obvious dont works i need help there
Reply
#2

Use function:

Код:
TextDrawSetString
Reply
#3

Quote:
Originally Posted by ► © The LuxurioN™
Use function:

Код:
TextDrawSetString
i dont understand that :S:S can you help me please i only need

Textdraw1 = TextDrawCreate(3.000000,431.000000,"(m1)m2) Para entregar el auto");

:S:S
Reply
#4

Just like you did the MySQL thing

format(string,sizeof(string),"Your stuff %s",var);

Then put TextDrawCreate(3.0,431.0,string);
Reply
#5

Код:
format(tmp, sizeof(tmp), "Good Night %s ",PlayerName(playerid));
LuxText[i] = TextDrawCreate(163.000000,342.000000,tmp);
Reply
#6

thx i dont get errors in compile the problem is when enter in the server display ": para entregar el auto" dont text the vars like dont exist on something i using this fs http://forum.sa-mp.com/index.php?topic=116078.0 for countdow

here some part of my code

pawn Код:
forward contarprin2(playerid);

new m1;
new m2;
new count2;

public OnGameModeInit()
{
  AddCountDown(1, 0, 2);
  LoadTextDraws();
}

public OnPlayerSpawn(playerid)
{
    count2 = SetTimer("contarprin2",1000,false);
    return 1;
}

public contarprin2(playerid)
{
  m1 = GetCountDownMinutes(1);
  m2 = GetCountDownSeconds(1);
  TextDrawShowForPlayer(playerid,Textdraw1);
}

LoadTextDraws()
{
    new texttt1[256];
    format(texttt1, sizeof(texttt1),"%s:%s Para entregar el auto", m1, m2);
    Textdraw1 = TextDrawCreate(3.000000,431.000000,texttt1);
    TextDrawAlignment(Textdraw1,0);
    TextDrawBackgroundColor(Textdraw1,0x000000ff);
    TextDrawFont(Textdraw1,3);
    TextDrawLetterSize(Textdraw1,0.799999,1.500000);
    TextDrawColor(Textdraw1,0xffffffff);
    TextDrawSetOutline(Textdraw1,1);
    TextDrawSetProportional(Textdraw1,1);
    TextDrawSetShadow(Textdraw1,1);
}
Reply
#7

tried putting:

Код:
%d
Код:
format(texttt1, sizeof(texttt1),"%d:%d Para entregar el auto", m1, m2);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)