SA-MP Forums Archive
Textdraw don't want to change color - 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: Textdraw don't want to change color (/showthread.php?tid=343636)



Textdraw don't want to change color - martanius - 18.05.2012

Hi, I have some problem with SelectTextDraw(playerid,color);

I have created txtdraw :

Код:
userpanel = TextDrawCreate(0,428,"User panel");
TextDrawLetterSize(userpanel,1.000000,2.000000);
TextDrawAlignment(userpanel,0);
TextDrawBackgroundColor(userpanel,0x000000FF);
TextDrawFont(userpanel,0);
TextDrawUseBox(userpanel,1);
TextDrawBoxColor(userpanel,0x000000FF);
TextDrawTextSize(userpanel,700.000000,438.000000);
TextDrawSetOutline(userpanel,0);
TextDrawSetProportional(userpanel,1);
TextDrawSetShadow(userpanel,1);
In OnPlayerconnect :

Код:
PlayerTextDrawSetSelectable(playerid,PlayerText:userpanel[playerid],1);
   TextDrawShowForPlayer(playerid,userpanel[playerid]);
and in keystatechange :

Код:
if((newkeys & (KEY_FIRE | KEY_LOOK_BEHIND)) == (KEY_FIRE | KEY_LOOK_BEHIND)){
    SelectTextDraw(playerid,0xFF4040AA);
   }
But when I press CTRL+ NUM1 and set cursor on textdraw, textdraw is still white


Re: Textdraw don't want to change color - SuperViper - 18.05.2012

You're not creating the textdraw as a player textdraw. There are different functions for it.

TextDrawCreate should be CreatePlayerTextDraw.

TextDrawShowForPlayer should be PlayerTextDrawShow

The others should have 'Player' behind them and the first parameter should be playerid.


Re: Textdraw don't want to change color - Rac3r - 19.05.2012

I 'think' you need to hide and show the textdraw again, for the colour to updated.


Re: Textdraw don't want to change color - JAMMIEISFTW - 19.05.2012

Quote:
Originally Posted by Rac3r
Посмотреть сообщение
I 'think' you need to hide and show the textdraw again, for the colour to updated.
Yea u do.