13.07.2015, 21:05
Hello, I was wondering why when I click on a TextDraw it selects other, kind, was to select just that I'm with the arrow on top, not the one with the arrow on top and the other nearby, I think this bug happens with many people, how can I fix it? just that I fix the person clicks on that clickable TextDraw and click, click others that have nothing to do, I will show my code I've done so far:
PHP код:
new PlayerText:pTextdrawSkins0;
new PlayerText:pTextdrawSkins1;
new PlayerText:pTextdrawSkins2;
new PlayerText:pTextdrawSkins3;
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
if(playertextid == pTextdrawSkins0)
{
PlayerTextDrawHide(playerid, PlayerText:pTextdrawSkins0);
PlayerTextDrawHide(playerid, PlayerText:pTextdrawSkins1);
PlayerTextDrawHide(playerid, PlayerText:pTextdrawSkins2);
PlayerTextDrawHide(playerid, PlayerText:pTextdrawSkins3);
CancelSelectTextDraw(playerid);
AccountData[playerid][pChar] = GetPlayerSkin(playerid);
SetPlayerPos(playerid, 207.1889,-129.8818,1003.5078);
SetPlayerFacingAngle(playerid, 0.2991);
TogglePlayerControllable(playerid, 1);
SetCameraBehindPlayer(playerid);
SendClientMessage(playerid, -1, "debug: skin confirmada!");
}
if(playertextid == pTextdrawSkins1)
{
PlayerTextDrawHide(playerid, PlayerText:pTextdrawSkins0);
PlayerTextDrawHide(playerid, PlayerText:pTextdrawSkins1);
PlayerTextDrawHide(playerid, PlayerText:pTextdrawSkins2);
PlayerTextDrawHide(playerid, PlayerText:pTextdrawSkins3);
CancelSelectTextDraw(playerid);
SetPlayerPos(playerid, 207.1889,-129.8818,1003.5078);
SetPlayerFacingAngle(playerid, 0.2991);
TogglePlayerControllable(playerid, 1);
SetCameraBehindPlayer(playerid);
SendClientMessage(playerid, -1, "debug: skin cancelada!");
}
if(playertextid == pTextdrawSkins3)
{
PassarSkin(playerid, 0);
SendClientMessage(playerid, -1, "debug: proxima skin!");
}
if(playertextid == pTextdrawSkins2)
{
PassarSkin(playerid, 1);
SendClientMessage(playerid, -1, "debug: proxima skin!");
}
}
/////
PlayerTextDrawShow(playerid, PlayerText:pTextdrawSkins0);
PlayerTextDrawShow(playerid, PlayerText:pTextdrawSkins1);
PlayerTextDrawShow(playerid, PlayerText:pTextdrawSkins2);
PlayerTextDrawShow(playerid, PlayerText:pTextdrawSkins3);
SelectTextDraw(playerid, 0x848484FF);
if (AccountData[playerid][pSex] == 1) SetPlayerSkin(playerid, 1);
else SetPlayerSkin(playerid, 9);
SetPlayerPos(playerid, 201.9326,-126.9587,1003.5078);
SetPlayerFacingAngle(playerid, 179.2377);
SetPlayerCameraPos(playerid,201.9442,-130.1344,1003.5078);
SetPlayerCameraLookAt(playerid, 201.7470,-126.8547,1003.9588);
TogglePlayerControllable(playerid, 0);
SetPlayerInterior(playerid, 3);
SendClientMessage(playerid, -1, "debug: escolha a skin.");
////
pTextdrawSkins0 = CreatePlayerTextDraw(playerid,190.000000, 372.000000, "Confirmar");
PlayerTextDrawBackgroundColor(playerid,pTextdrawSkins0, 255);
PlayerTextDrawFont(playerid,pTextdrawSkins0, 3);
PlayerTextDrawColor(playerid,pTextdrawSkins0, -1);
PlayerTextDrawSetOutline(playerid,pTextdrawSkins0, 0);
PlayerTextDrawSetProportional(playerid,pTextdrawSkins0, 1);
PlayerTextDrawSetShadow(playerid,pTextdrawSkins0, 1);
PlayerTextDrawSetSelectable(playerid,pTextdrawSkins0, 1);
pTextdrawSkins1 = CreatePlayerTextDraw(playerid,407.000000, 373.000000, "Cancelar");
PlayerTextDrawBackgroundColor(playerid,pTextdrawSkins1, 255);
PlayerTextDrawFont(playerid,pTextdrawSkins1, 3);
PlayerTextDrawColor(playerid,pTextdrawSkins1, -1);
PlayerTextDrawSetOutline(playerid,pTextdrawSkins1, 0);
PlayerTextDrawSetProportional(playerid,pTextdrawSkins1, 1);
PlayerTextDrawSetShadow(playerid,pTextdrawSkins1, 1);
PlayerTextDrawSetSelectable(playerid,pTextdrawSkins1, 1);
pTextdrawSkins2 = CreatePlayerTextDraw(playerid,211.000000, 217.000000, "~<~");
PlayerTextDrawBackgroundColor(playerid,pTextdrawSkins2, 255);
PlayerTextDrawFont(playerid,pTextdrawSkins2, 3);
PlayerTextDrawColor(playerid,pTextdrawSkins2, -1);
PlayerTextDrawSetOutline(playerid,pTextdrawSkins2, 0);
PlayerTextDrawSetProportional(playerid,pTextdrawSkins2, 1);
PlayerTextDrawSetShadow(playerid,pTextdrawSkins2, 1);
PlayerTextDrawSetSelectable(playerid,pTextdrawSkins2, 1);
pTextdrawSkins3 = CreatePlayerTextDraw(playerid,453.000000, 217.000000, "~>~");
PlayerTextDrawBackgroundColor(playerid,pTextdrawSkins3, 255);
PlayerTextDrawFont(playerid,pTextdrawSkins3, 3);
PlayerTextDrawColor(playerid,pTextdrawSkins3, -1);
PlayerTextDrawSetOutline(playerid,pTextdrawSkins3, 0);
PlayerTextDrawSetProportional(playerid,pTextdrawSkins3, 1);
PlayerTextDrawSetShadow(playerid,pTextdrawSkins3, 1);
PlayerTextDrawSetSelectable(playerid,pTextdrawSkins3, 1);