how to refresh a textdraw (preview model) - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: how to refresh a textdraw (preview model) (
/showthread.php?tid=641592)
how to refresh a textdraw (preview model) -
Klayton - 17.09.2017
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
Re: how to refresh a textdraw (preview model) -
Kane - 17.09.2017
What do you mean refresh?
Use
PlayerTextDrawSetPreviewModel and then re show the textdraw.
Re: how to refresh a textdraw (preview model) -
Klayton - 17.09.2017
Just the color of the preview model, If a player click on red for example; the preview model phone refresh on red, you know ?
Re: how to refresh a textdraw (preview model) -
Kane - 17.09.2017
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/
Re: how to refresh a textdraw (preview model) -
Klayton - 17.09.2017
Yeah thank's !
Re: how to refresh a textdraw (preview model) -
Dignity - 17.09.2017
Quote:
Originally Posted by Arthur Kane
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.
Re: how to refresh a textdraw (preview model) -
Kane - 17.09.2017
Quote:
Originally Posted by Dignity
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.
Re: how to refresh a textdraw (preview model) -
Klayton - 18.09.2017
Yeah thank's guys, fixed !
Re: how to refresh a textdraw (preview model) -
Klayton - 18.09.2017
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' ?
Re: how to refresh a textdraw (preview model) -
Kane - 18.09.2017
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(playerid, PlayerText: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.
Re: how to refresh a textdraw (preview model) -
Klayton - 18.09.2017
Yeah thank's ! (FIXED)