Portal SAMP
[Ajuda] TextDrawSetSelectable - Versão de Impressão

+- Portal SAMP (https://portalsamp.com)
+-- Fórum: SA-MP (https://portalsamp.com/forumdisplay.php?fid=5)
+--- Fórum: Área de suporte (https://portalsamp.com/forumdisplay.php?fid=6)
+--- Tópico: [Ajuda] TextDrawSetSelectable (/showthread.php?tid=4918)



TextDrawSetSelectable - Mackor - 14/11/2024

Não sei o que acontece que na hora que eu clico em cima de fechar e não fecha, o Selectable foi adicionado.


Código PHP:
new Text:TextIdentity[11];

public 
OnGameModeInit()
{
 
   TextIdentity[10] = TextDrawCreate(393.000259.000"Fechar");
    TextDrawLetterSize(TextIdentity[10], 0.2801.500);
    TextDrawTextSize(TextIdentity[10], 428.0000.000);
    TextDrawAlignment(TextIdentity[10], TEXT_DRAW_ALIGN_LEFT);
    TextDrawColour(TextIdentity[10], -1);
    TextDrawUseBox(TextIdentity[10], true);
    TextDrawBoxColour(TextIdentity[10], 150);
    TextDrawSetShadow(TextIdentity[10], 1);
    TextDrawSetOutline(TextIdentity[10], 1);
    TextDrawBackgroundColour(TextIdentity[10], 150);
    TextDrawFont(TextIdentity[10], TEXT_DRAW_FONT_3);
    TextDrawSetProportional(TextIdentity[10], false);
    TextDrawSetSelectable(TextIdentity[10], true);



Código PHP:
public OnPlayerClickPlayerTextDraw(playeridPlayerText:playertextid)
{
    if(playertextid == TextIdentity[10])
   {
        for(new 011i++) TextDrawHideForPlayer(playeridTextIdentity[i]);

        CancelSelectTextDraw(playerid);
    }
}


forward IdentityCard(playeridtargetid);
public 
IdentityCard(playeridtargetid)
{
new 
atext[20];

if(
PlayerInfo[playerid][pSex] == 1)
atext "Masculino";

else if(
PlayerInfo[playerid][pSex] == 2)
atext "Feminino";

    TextDrawSetPreviewModel(TextIdentity[9], GetPlayerSkin(playerid));
TextDrawSetString(TextIdentity[3], "%d"PlayerInfo[playerid][pRecord]);
TextDrawSetString(TextIdentity[5], "%d/%d/%d"PlayerInfo[playerid][pDayRecord], PlayerInfo[playerid][pMonthRecord], PlayerInfo[playerid][pYearRecord]);
TextDrawSetString(TextIdentity[7], "%s"atext);

for(new 
011i++)
    TextDrawShowForPlayer(targetidTextIdentity[i]);

    SelectTextDraw(targetid, -1);
return 
1;




RE: TextDrawSetSelectable - BitSain - 14/11/2024

Use o OnPlayerClickTextDraw para textdraws globais, use OnPlayerClickPlayerTextDraw para textdraws de tipo player.

A textdraw que você quer manipular é global.