SA-MP Forums Archive
[Ajuda] Clicaveis - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Clicaveis (/showthread.php?tid=383181)



Clicaveis - Don_Speed - 06.10.2012

Ola!
Tentando criar textdraw clicaveis deu esses erros e avisos.
pawn Код:
C:\Documents and Settings\Maurilio\Desktop\Text.pwn(17) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Maurilio\Desktop\Text.pwn(21) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Maurilio\Desktop\Text.pwn(25) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Maurilio\Desktop\Text.pwn(36) : warning 213: tag mismatch
C:\Documents and Settings\Maurilio\Desktop\Text.pwn(37) : warning 213: tag mismatch
C:\Documents and Settings\Maurilio\Desktop\Text.pwn(38) : warning 213: tag mismatch
C:\Documents and Settings\Maurilio\Desktop\Text.pwn(39) : warning 213: tag mismatch
C:\Documents and Settings\Maurilio\Desktop\Text.pwn(40) : warning 213: tag mismatch
C:\Documents and Settings\Maurilio\Desktop\Text.pwn(41) : warning 213: tag mismatch
C:\Documents and Settings\Maurilio\Desktop\Text.pwn(47) : warning 213: tag mismatch
C:\Documents and Settings\Maurilio\Desktop\Text.pwn(48) : warning 213: tag mismatch
C:\Documents and Settings\Maurilio\Desktop\Text.pwn(49) : warning 213: tag mismatch
C:\Documents and Settings\Maurilio\Desktop\Text.pwn(50) : warning 213: tag mismatch
C:\Documents and Settings\Maurilio\Desktop\Text.pwn(51) : warning 213: tag mismatch
C:\Documents and Settings\Maurilio\Desktop\Text.pwn(52) : warning 213: tag mismatch
C:\Documents and Settings\Maurilio\Desktop\Text.pwn(58) : warning 213: tag mismatch
C:\Documents and Settings\Maurilio\Desktop\Text.pwn(59) : warning 213: tag mismatch
C:\Documents and Settings\Maurilio\Desktop\Text.pwn(60) : warning 213: tag mismatch
C:\Documents and Settings\Maurilio\Desktop\Text.pwn(61) : warning 213: tag mismatch
C:\Documents and Settings\Maurilio\Desktop\Text.pwn(62) : warning 213: tag mismatch
C:\Documents and Settings\Maurilio\Desktop\Text.pwn(63) : warning 213: tag mismatch
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
Porem eu segui esse tuto > https://sampforum.blast.hk/showthread.php?tid=340781

CODE \/
pawn Код:
#include a_samp
new PlayerText:Login[MAX_PLAYERS];
new PlayerText:Skin[MAX_PLAYERS];
new PlayerText:Regras[MAX_PLAYERS];
public OnFilterScriptInit()
{
    return 1;
}
public OnFilterScriptExit()
{
    return 1;
}
public OnPlayerConnect(playerid)
{
    Login[playerid] = CreatePlayerTextDraw(playerid, 240.0, 580.0, "Logar/Registrar");
    PlayerTextDrawShow(playerid, Login[playerid]);
    PlayerTextDrawSetSelectable(PlayerText:Login, true);// Poder Clicar
   
    Skin[playerid] = CreatePlayerTextDraw(playerid, 240.0, 580.0, "Skin");
    PlayerTextDrawShow(playerid, Skin[playerid]);
    PlayerTextDrawSetSelectable(PlayerText:Skin, true);// Poder Clicar
   
    Regras[playerid] = CreatePlayerTextDraw(playerid, 240.0, 580.0, "Logar/Registrar");
    PlayerTextDrawShow(playerid, Regras[playerid]);
    PlayerTextDrawSetSelectable(PlayerText:Regras, true); // Poder Clicar
   
    SelectTextDraw(playerid, 0x00FF00FF);// Cor Setinha
    return 1;
}
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
    if(playertextid == Login[playerid])
    {
         // login
         CancelSelectTextDraw(playerid);
         TextDrawHideForAll(Login[playerid]);
         TextDrawDestroy(Login[playerid]);
         TextDrawHideForAll(Skin[playerid]);
         TextDrawDestroy(Skin[playerid]);
         TextDrawHideForAll(Regras[playerid]);
         TextDrawDestroy(Regras[playerid]);
    }
    if(playertextid == Skin[playerid])
    {
         // Skin
         CancelSelectTextDraw(playerid);
         TextDrawHideForAll(Login[playerid]);
         TextDrawDestroy(Login[playerid]);
         TextDrawHideForAll(Skin[playerid]);
         TextDrawDestroy(Skin[playerid]);
         TextDrawHideForAll(Regras[playerid]);
         TextDrawDestroy(Regras[playerid]);
    }
    if(playertextid == Regras[playerid])
    {
         // Regras
         CancelSelectTextDraw(playerid);
         TextDrawHideForAll(Login[playerid]);
         TextDrawDestroy(Login[playerid]);
         TextDrawHideForAll(Skin[playerid]);
         TextDrawDestroy(Skin[playerid]);
         TextDrawHideForAll(Regras[playerid]);
         TextDrawDestroy(Regras[playerid]);
    }
    return 1;
}
Nao intendi o que ta errado , pode me dizer o meu erro!



Re: Clicaveis - Abravanel - 06.10.2012

Consertei para vocк. Olhe as linhas modificadas e compare com as suas!
pawn Код:
#include a_samp
new PlayerText:Login[MAX_PLAYERS];
new PlayerText:Skin[MAX_PLAYERS];
new PlayerText:Regras[MAX_PLAYERS];
public OnFilterScriptInit()
{
    return 1;
}
public OnFilterScriptExit()
{
    return 1;
}
public OnPlayerConnect(playerid)
{
    Login[playerid] = CreatePlayerTextDraw(playerid, 240.0, 580.0, "Logar/Registrar");
    PlayerTextDrawShow(playerid, Login[playerid]);
    PlayerTextDrawSetSelectable(playerid, Login[playerid], true);// Poder Clicar

    Skin[playerid] = CreatePlayerTextDraw(playerid, 240.0, 580.0, "Skin");
    PlayerTextDrawShow(playerid, Skin[playerid]);
    PlayerTextDrawSetSelectable(playerid, Skin[playerid], true);// Poder Clicar

    Regras[playerid] = CreatePlayerTextDraw(playerid, 240.0, 580.0, "Logar/Registrar");
    PlayerTextDrawShow(playerid, Regras[playerid]);
    PlayerTextDrawSetSelectable(playerid,Regras[playerid], true); // Poder Clicar

    SelectTextDraw(playerid, 0x00FF00FF);// Cor Setinha
    return 1;
}
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
    if(playertextid == Login[playerid])
    {
        // login
        CancelSelectTextDraw(playerid);
        PlayerTextDrawHide(playerid, Login[playerid]);
        PlayerTextDrawDestroy(playerid, Login[playerid]);
        PlayerTextDrawHide(playerid, Skin[playerid]);
        PlayerTextDrawDestroy(playerid, Skin[playerid]);
        PlayerTextDrawHide(playerid, Regras[playerid]);
        PlayerTextDrawDestroy(playerid, Regras[playerid]);
    }
    if(playertextid == Skin[playerid])
    {
        // Skin
        CancelSelectTextDraw(playerid);
        PlayerTextDrawHide(playerid, Login[playerid]);
        PlayerTextDrawDestroy(playerid, Login[playerid]);
        PlayerTextDrawHide(playerid, Skin[playerid]);
        PlayerTextDrawDestroy(playerid, Skin[playerid]);
        PlayerTextDrawHide(playerid, Regras[playerid]);
        PlayerTextDrawDestroy(playerid, Regras[playerid]);
    }
    if(playertextid == Regras[playerid])
    {
        // Regras
        CancelSelectTextDraw(playerid);
        PlayerTextDrawHide(playerid, Login[playerid]);
        PlayerTextDrawDestroy(playerid, Login[playerid]);
        PlayerTextDrawHide(playerid, Skin[playerid]);
        PlayerTextDrawDestroy(playerid, Skin[playerid]);
        PlayerTextDrawHide(playerid, Regras[playerid]);
        PlayerTextDrawDestroy(playerid, Regras[playerid]);
    }
    return 1;
}
Abrзs.


Re: Clicaveis - arakuta - 06.10.2012

PlayerTextDraw nгo й global, logo sempre defina sempre pra quem faze-lo, com playerid, killerid, loop o que seja =)


Re: Clicaveis - Don_Speed - 06.10.2012

Hum tendi.


Re: Clicaveis - CaioMiglioli - 06.10.2012

pawn Код:
#include a_samp
new Text:Login[MAX_PLAYERS];
new Text:Skin[MAX_PLAYERS];
new Text:Regras[MAX_PLAYERS];
public OnFilterScriptInit()
{
    return 1;
}
public OnFilterScriptExit()
{
    return 1;
}
public OnPlayerConnect(playerid)
{
    Login[playerid] = TextDrawCreate(240.0, 580.0, "Logar/Registrar");
    TextDrawShowForPlayer(playerid, Login[playerid]);
    TextDrawSetSelectable(Text:Login[playerid], true);// Poder Clicar

    Skin[playerid] = TextDrawCreate(240.0, 580.0, "Skin");
    TextDrawShowForPlayer(playerid, Skin[playerid]);
    TextDrawSetSelectable(Text:Skin[playerid], true);// Poder Clicar

    Regras[playerid] = TextDrawCreate(240.0, 580.0, "Logar/Registrar");
    TextDrawShowForPlayer(playerid, Regras[playerid]);
    TextDrawSetSelectable(Text:Regras[playerid], true); // Poder Clicar
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == KEY_SUBMISSION)
    {
        SelectTextDraw(playerid, 0x00FF00FF);
    }
    return 1;
}

public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(clickedid == Login[playerid])
    {
         // login
         CancelSelectTextDraw(playerid);
         TextDrawHideForAll(Login[playerid]);
         TextDrawDestroy(Login[playerid]);
         TextDrawHideForAll(Skin[playerid]);
         TextDrawDestroy(Skin[playerid]);
         TextDrawHideForAll(Regras[playerid]);
         TextDrawDestroy(Regras[playerid]);
    }
    if(clickedid == Skin[playerid])
    {
         // Skin
         CancelSelectTextDraw(playerid);
         TextDrawHideForAll(Login[playerid]);
         TextDrawDestroy(Login[playerid]);
         TextDrawHideForAll(Skin[playerid]);
         TextDrawDestroy(Skin[playerid]);
         TextDrawHideForAll(Regras[playerid]);
         TextDrawDestroy(Regras[playerid]);
    }
    if(clickedid == Regras[playerid])
    {
         // Regras
         CancelSelectTextDraw(playerid);
         TextDrawHideForAll(Login[playerid]);
         TextDrawDestroy(Login[playerid]);
         TextDrawHideForAll(Skin[playerid]);
         TextDrawDestroy(Skin[playerid]);
         TextDrawHideForAll(Regras[playerid]);
         TextDrawDestroy(Regras[playerid]);
    }
    return 1;
}
Tente e veja se deu certo, nгo testei...

@Edit, nгo tinha visto a outra resposta... Malditos ninjas, mal posso prever seus movimentos