[Ajuda] Clicaveis
#1

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!
Reply
#2

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.
Reply
#3

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

Hum tendi.
Reply
#5

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)