SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 24/08/2009, 12:50 AM   #1
Zafire1410
Big Clucker
 
Join Date: Aug 2009
Posts: 75
Reputation: 0
Default How to use vars in textdraws

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

i need something like this

Code:
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
Zafire1410 is offline  
Old 24/08/2009, 12:53 AM   #2
LuxurioN™
Gangsta
 
LuxurioN™'s Avatar
 
Join Date: Oct 2007
Posts: 908
Reputation: 137
Default Re: How to use vars in textdraws

Use function:

Code:
TextDrawSetString
LuxurioN™ is offline  
Old 24/08/2009, 12:55 AM   #3
Zafire1410
Big Clucker
 
Join Date: Aug 2009
Posts: 75
Reputation: 0
Default Re: How to use vars in textdraws

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

Code:
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
Zafire1410 is offline  
Old 24/08/2009, 01:01 AM   #4
JaTochNietDan
High-roller
 
JaTochNietDan's Avatar
 
Join Date: Apr 2007
Location: Republic of Ireland
Posts: 2,502
Reputation: 363
Default Re: How to use vars in textdraws

Just like you did the MySQL thing

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

Then put TextDrawCreate(3.0,431.0,string);
__________________
Releases:
[Includes]: [jBan] | [jBanLite]
[Plugins]: [FileManager] | [Execute]
[Applications]: [Remote Administrator *NEW] | [Script King] | [RCON GUI]
JaTochNietDan is offline  
Old 24/08/2009, 01:02 AM   #5
LuxurioN™
Gangsta
 
LuxurioN™'s Avatar
 
Join Date: Oct 2007
Posts: 908
Reputation: 137
Default Re: How to use vars in textdraws

Code:
format(tmp, sizeof(tmp), "Good Night %s ",PlayerName(playerid));
LuxText[i] = TextDrawCreate(163.000000,342.000000,tmp);
LuxurioN™ is offline  
Old 24/08/2009, 01:17 AM   #6
Zafire1410
Big Clucker
 
Join Date: Aug 2009
Posts: 75
Reputation: 0
Default Re: How to use vars in textdraws

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 Code:
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);
}
Zafire1410 is offline  
Old 24/08/2009, 01:30 AM   #7
LuxurioN™
Gangsta
 
LuxurioN™'s Avatar
 
Join Date: Oct 2007
Posts: 908
Reputation: 137
Default Re: How to use vars in textdraws

tried putting:

Code:
%d
Code:
format(texttt1, sizeof(texttt1),"%d:%d Para entregar el auto", m1, m2);
LuxurioN™ is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[TEXTDRAWS] Textdraws mixed up KnooL Help Archive 22 23/06/2010 03:52 PM
Local vs. Global vars CC. Help Archive 0 25/03/2010 04:06 PM
[REALESE][.INC] Full Global Vars V0.2 (very early realese) DeadlyCola Filterscripts 7 26/10/2009 10:14 AM
I think im abusing VARS Paladin Help Archive 9 02/08/2009 08:18 PM
Adding new vars to the server.cfg ledzep Help Archive 6 27/06/2009 12:08 PM


All times are GMT. The time now is 04:31 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.