SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 07/04/2013, 07:13 PM   #61
MP2
Godfather
 
MP2's Avatar
 
Join Date: Jan 2011
Location: England
Posts: 5,255
Reputation: 748
Default Re: y_text and y_languages

But say I wanted to make a 'list' of 10 textdraws on the screen. I would use a loop and the height would be, for example, 100+(i*10), if the list started at Y-100 and went down Y-10 every time. I would need to get the raw text to be able to do this. Is there absolutely no way of doing this?

Surely the text that is passed to GameTextForPlayer etc. interally has the colours processed at that point - can't that be passed to a function for what I want? By just specifying the type of style (client-message, TD/gametext etc.)?
__________________
>> Click here for ALL of my releases
mGates - Create AUTOMATIC gates with ONE FUNCTION (+ restrictions i.e. team members only)
IEE (Interior Enter/Exits) - Create enex markers with one function
Cuffs - Cuff offsets for ALL SKINS!
vfunc - Vehicle functions. GetVehicleColor and synced random colors.
gBug - Prevent the 'G' bug (players being able to enter moving vehicles by pressing G then running after them).
MP2 is offline   Reply With Quote
Old 07/04/2013, 09:02 PM   #62
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629
Posts: 13,235
Reputation: 1900
Default Re: y_text and y_languages

There is "Text_GetLastID", with which you can do:

pawn Code:
Text_Send(whoever, whatever);
new Text:td = Text:Text_GetLastID();
if (td != Text:-1)
{
    TD_TextPosition(td, x, y);
}

"Text_GetLastID" is a bit of a hack for manipulating TDs, and returns -1 if the display style is not a text draw.
__________________
Y_Less is offline   Reply With Quote
Old 01/05/2013, 11:04 AM   #63
Pupak
Little Clucker
 
Pupak's Avatar
 
Join Date: Apr 2013
Posts: 5
Reputation: 0
Default Re: y_text and y_languages

Hello! This line is from my language file:
Code:
banCheck = Error: #WHITEYou have been banned by administrator #RED%s#WHITE.\n#REDReason:{WHITE} %s
Note "\n#RED" part. There is #RED in front of "Reason" but it appears to be white in-game, altough when I put whitespace after new line ("\n #RED") it appears to be red text in-game but then it looks like this.

First case: http://i39.tinypic.com/351fw4k.png
Second case: http://i43.tinypic.com/plh1w.png

Is there any solution for this? I don't want to have whitespace before "Reason: ...". Thanks!
Pupak is offline   Reply With Quote
Old 01/05/2013, 12:16 PM   #64
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629
Posts: 13,235
Reputation: 1900
Default Re: y_text and y_languages

I think that might be a bug, I'll try fix it.
__________________
Y_Less is offline   Reply With Quote
Old 01/05/2013, 06:50 PM   #65
Pupak
Little Clucker
 
Pupak's Avatar
 
Join Date: Apr 2013
Posts: 5
Reputation: 0
Default Re: y_text and y_languages

This is a temporary solution for me (if anyone else has the problem):

Script:
Code:
Text_Send(playerid, $banned);
Text_Send(playerid, $banReason);
Language file:
Code:
banned = Error: #WHITEYou have been banned by administrator #RED%s#WHITE.
banReason = Reason: #WHITE%s.
Lang data file:
Code:
<entry name="banned" style="client" colour="X11_RED" />
<entry name="banReason" style="client" colour="X11_RED" />
Just use as much entries as you need.
Pupak is offline   Reply With Quote
Reply

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



All times are GMT. The time now is 10:12 PM.


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