TD Select - 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: TD Select (
/showthread.php?tid=568743)
TD Select -
SkyLoKi - 24.03.2015
1. So... I create TextDraw for change color
PHP код:
for(new i=1; i < sizeof(ChangeColor); i++)
{
ChangeColor[i] = TextDrawCreate(X, Y, "box");
TextDrawLetterSize(ChangeColor[i], 0.0, 1.426062);
TextDrawTextSize(ChangeColor[i], 40, 0.0);
TextDrawAlignment(ChangeColor[i], 1);
TextDrawColor(ChangeColor[i], -1);
TextDrawUseBox(ChangeColor[i], 1);
TextDrawBoxColor(ChangeColor[i], Colors[i]);
TextDrawSetOutline(ChangeColor[i], 0);
TextDrawBackgroundColor(ChangeColor[i], 255);
TextDrawFont(ChangeColor[i], 1);
TextDrawSetProportional(ChangeColor[i], 1);
TextDrawSetShadow(ChangeColor[i], 0);
TextDrawSetSelectable(ChangeColor[i], 1);
X = X + 25;
count++;
if(count == 4)
{
Y = Y + 30.0;
X = 25.0;
count = 1;
}
}
2. Add TextDrawSetSelectable
3. Add the display of these TD for players
So I deduce that while TD, and their outputs normally
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_SUBMISSION)
{
for(new i; i < sizeof(ChangeColor); i++)
{
TextDrawShowForPlayer(playerid,ChangeColor[i]);
}
SelectTextDraw(playerid, 0xFF4040AA) ;
}
return 1;
}
And continue problem !!
Public this does not work
PHP код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
print("OnPlayerClickTextDraw 1");
if (_:clickedid == INVALID_TEXT_DRAW )
{
print("OnPlayerClickTextDraw 2");
for(new i; i < sizeof(ChangeColor); i++)
{
TextDrawHideForPlayer(playerid,ChangeColor[i]);
}
}
for(new i; i < sizeof(ChangeColor); i++)
{
print("OnPlayerClickTextDraw 3");
if(clickedid == ChangeColor[i])
{
SetPlayerColor( playerid, Colors[ i ] );
CancelSelectTextDraw( playerid ) ;
for(new j; j < sizeof(ChangeColor); j++)
{
TextDrawHideForPlayer(playerid,ChangeColor[j]);
}
}
}
return 1 ;
}
Original post (RU):
https://sampforum.blast.hk/showthread.php?tid=568742
Re: TD Select -
Vince - 24.03.2015
Sigh. Read the wiki for once. It's hard to not notice the big red warning box.
Re: TD Select -
SkyLoKi - 24.03.2015
Well ... I changed the size of the text, it is now no negative and not 0. But Public OnPlayerClickTextDraw still is not called
Re: TD Select -
SkyLoKi - 24.03.2015
Okay...
I nоt all changed. Now all work. Thanks