30.10.2013, 08:01
Hello,
I cannot select a textdraw I created, when I hover the mouse over it, the color changes. But when I click it, OnPlayerClickTextdraw gets called, but action for the textdraw isn't performed.
I create it like this:
And OnPlayerClickTextdraw
As you noticed there are two textdraws that are created identically. The weirdest part that the one with index 1 is working just fine.
That part "It is here" never gets printed.
I cannot select a textdraw I created, when I hover the mouse over it, the color changes. But when I click it, OnPlayerClickTextdraw gets called, but action for the textdraw isn't performed.
I create it like this:
pawn Код:
Furniture_Mode[playerid][0] = TextDrawCreate(360.0,372.0,"LD_POOL:ball");
Furniture_Mode[playerid][1] = TextDrawCreate(360.0,389.0,"LD_POOL:ball");
for(new i; i < 2; i++)
{
TextDrawFont(Furniture_Mode[playerid][i],4);
TextDrawTextSize(Furniture_Mode[playerid][i],15.0,15.0);
TextDrawSetSelectable(Furniture_Mode[playerid][i],1);
}
pawn Код:
if(clickedid == Furniture_Mode[playerid][0])
{
printf("it is here");
SendClientMessage(playerid,RED,"Number 0 is selected");
set.IsMovingObject[playerid] = true;
set.IsRotatingObject[playerid] = false;
TextDrawHideForPlayer(playerid,Furniture_Mode[playerid][0]);
TextDrawHideForPlayer(playerid,Furniture_Mode[playerid][1]);
TextDrawColor(Furniture_Mode[playerid][0],0xFF0000FF);
TextDrawColor(Furniture_Mode[playerid][1],0xFFFFFFFF);
TextDrawShowForPlayer(playerid,Furniture_Mode[playerid][0]);
TextDrawShowForPlayer(playerid,Furniture_Mode[playerid][1]);
return 1;
}
if(clickedid == Furniture_Mode[playerid][1])
{
SendClientMessage(playerid,RED,"Number 1 is selected");
set.IsRotatingObject[playerid] = true;
set.IsMovingObject[playerid] = false;
TextDrawHideForPlayer(playerid,Furniture_Mode[playerid][0]);
TextDrawHideForPlayer(playerid,Furniture_Mode[playerid][1]);
TextDrawColor(Furniture_Mode[playerid][0],0xFFFFFFFF);
TextDrawColor(Furniture_Mode[playerid][1],0xFF0000FF);
TextDrawShowForPlayer(playerid,Furniture_Mode[playerid][0]);
TextDrawShowForPlayer(playerid,Furniture_Mode[playerid][1]);
return 1;
}
As you noticed there are two textdraws that are created identically. The weirdest part that the one with index 1 is working just fine.
That part "It is here" never gets printed.