how to refresh a textdraw (preview model)
#1

Hey world, I have a question, how to refresh a textdraw with a preview model ?
Just refresh the color of player as choose for he phone (script like look lsrp)


http://prntscr.com/gme0bb


https://pastebin.com/vQnxFvdi
Reply
#2

What do you mean refresh?

Use PlayerTextDrawSetPreviewModel and then re show the textdraw.
Reply
#3

Just the color of the preview model, If a player click on red for example; the preview model phone refresh on red, you know ?
Reply
#4

http://dev.prineside.com/en/gtasa_sa...earch/?q=phone

They're different objects, you can't actually color it.

Specifically:
http://dev.prineside.com/en/gtasa_sa...-MobilePhone2/
http://dev.prineside.com/en/gtasa_sa...MobilePhone10/
http://dev.prineside.com/en/gtasa_sa...-MobilePhone8/
http://dev.prineside.com/en/gtasa_sa...-MobilePhone7/
http://dev.prineside.com/en/gtasa_sa...-MobilePhone3/
http://dev.prineside.com/en/gtasa_sa...-MobilePhone1/
http://dev.prineside.com/en/gtasa_sa...-MobilePhone9/
http://dev.prineside.com/en/gtasa_sa...-MobilePhone5/
http://dev.prineside.com/en/gtasa_sa...-MobilePhone4/
http://dev.prineside.com/en/gtasa_sa...-MobilePhone6/
Reply
#5

Yeah thank's !
Reply
#6

Quote:
Originally Posted by Arthur Kane
View Post
They're different objects, you can't actually color it.
You can change the color of a preview model by using TextDrawColor, or PlayerTextDrawColor respectively.
Reply
#7

Quote:
Originally Posted by Dignity
View Post
You can change the color of a preview model by using TextDrawColor, or PlayerTextDrawColor respectively.
That's what I thought at first but then I saw the objects with different colors and forgot about it.

Yeah, that's easier then! My mistake.
Reply
#8

Yeah thank's guys, fixed !
Reply
#9

But what use for example: Player choose a textdraw A, and click on "buy", how to assign a value of textdraw A after click on 'buy' ?
Reply
#10

Make a variable to store it in every time you select a color.

PHP Code:
#define PHONE_BLUE_COLOR (1)
new
    
PhoneColorSelect[MAX_PLAYERS];
    
public 
OnPlayerClickPlayerTextDraw(playeridPlayerText:playertextid)
{
    if(
_:playertextid != INVALID_TEXT_DRAW)
    {
        if(
playertextid == BlueColoredTextdraw)
        {
            
PhoneColorSelect[playerid] = PHONE_BLUE_COLOR
        }
    }
    
    return 
1;

I prefer to define the color numbers just so it's easier and there isn't a hassle of figuring out which is which.
Reply
#11

Yeah thank's ! (FIXED)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)