Textdraw klickbar machen ..

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Hallo,


    ich habe 2 Warnings: C:\Dokumente und Einstellungen\Meiner\Desktop\New Samp Project\gamemodes\NSP.pwn(150) : warning 213: tag mismatch
    C:\Dokumente und Einstellungen\Meiner\Desktop\New Samp Project\gamemodes\NSP.pwn(153) : warning 213: tag mismatch
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    2 Warnings.


    Hier der code
    public OnPlayerClickTextDraw(playerid, Text:clickedid)
    {
    if(_:clickedid != INVALID_TEXT_DRAW)
    {
    if(clickedid == LoginT[playerid]) // 1 Warning
    {
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Bitte gib dein Passwort ein:","Login","Abbrechen"); }
    else if(clickedid == RegisterT[playerid]) // 2 Warning
    {
    ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register","Bitte Gib ein Passwort an:","Register","Exit");
    }
    /*CancelSelectTextDraw(playerid);
    }
    PlayerTextDrawHide(playerid,ConnectT2[playerid]);
    PlayerTextDrawHide(playerid,ConnectT1[playerid]);
    PlayerTextDrawHide(playerid,RegisterT[playerid]);
    PlayerTextDrawHide(playerid,LoginT[playerid]);
    CancelSelectTextDraw(playerid);
    }*/
    }
    return 1;
    }

  • C:\Dokumente und Einstellungen\Meiner\Desktop\New Samp Project\gamemodes\NSP.pwn(150) : error 033: array must be indexed (variable "LoginT")
    C:\Dokumente und Einstellungen\Meiner\Desktop\New Samp Project\gamemodes\NSP.pwn(153) : error 033: array must be indexed (variable "RegisterT")
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    2 Errors.


    jetzt ist es so: if(clickedid == LoginT)
    {
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Bitte gib dein Passwort ein:","Login","Abbrechen"); }
    else if(clickedid == RegisterT)
    {
    ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register","Bitte Gib ein Passwort an:","Register","Exit");
    }

  • Passt alles nun aber wenn ich connectem erscheint kein Textdraw:new PlayerText:RegisterT[MAX_PLAYERS];
    new PlayerText:LoginT[MAX_PLAYERS];


    public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
    {
    if(_:playertextid != INVALID_TEXT_DRAW)
    {
    if(playertextid == LoginT[playerid])
    {
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Bitte gib dein Passwort ein:","Login","Abbrechen");
    PlayerTextDrawHide(playerid,LoginT[playerid]);
    }
    else if(playertextid == RegisterT[playerid])
    {
    ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register","Bitte Gib ein Passwort an:","Register","Exit");
    PlayerTextDrawHide(playerid,RegisterT[playerid]);
    }
    /*CancelSelectTextDraw(playerid); //Schließt den TD (Abbrechen) CancelSelectTextDraw = zu deutsch SchließeAusgewähltenTextdraw
    }
    PlayerTextDrawHide(playerid,ConnectT2[playerid]);
    PlayerTextDrawHide(playerid,ConnectT1[playerid]);
    PlayerTextDrawHide(playerid,RegisterT[playerid]);
    PlayerTextDrawHide(playerid,LoginT[playerid]);
    CancelSelectTextDraw(playerid);
    }*/
    }
    return 1;
    }
    public OnPlayerConnect(playerid)
    {
    RegisterT[playerid] = CreatePlayerTextDraw(playerid, 226.875000, 208.250000, "Beginne ein Neues Leben!");
    PlayerTextDrawLetterSize(playerid, RegisterT[playerid], 0.449999, 1.600000);
    PlayerTextDrawAlignment(playerid, RegisterT[playerid], 1);
    PlayerTextDrawColor(playerid, RegisterT[playerid], 255);
    PlayerTextDrawSetShadow(playerid, RegisterT[playerid], 0);
    PlayerTextDrawSetOutline(playerid, RegisterT[playerid], 1);
    PlayerTextDrawBackgroundColor(playerid, RegisterT[playerid], 51);
    PlayerTextDrawFont(playerid, RegisterT[playerid], 1);
    PlayerTextDrawSetSelectable(playerid, ConnectT2[playerid], true);
    PlayerTextDrawSetProportional(playerid, RegisterT[playerid], 1);


    LoginT[playerid] = CreatePlayerTextDraw(playerid, 226.875000, 208.250000, "Logge dich in dein Leben ein!");
    PlayerTextDrawLetterSize(playerid, LoginT[playerid], 0.449999, 1.600000);
    PlayerTextDrawAlignment(playerid, LoginT[playerid], 1);
    PlayerTextDrawColor(playerid, LoginT[playerid], 255);
    PlayerTextDrawSetShadow(playerid, LoginT[playerid], 0);
    PlayerTextDrawSetOutline(playerid, LoginT[playerid], 1);
    PlayerTextDrawBackgroundColor(playerid, LoginT[playerid], 51);
    PlayerTextDrawFont(playerid, LoginT[playerid], 1);
    PlayerTextDrawSetProportional(playerid, LoginT[playerid], 1);
    PlayerTextDrawSetSelectable(playerid, ConnectT2[playerid], true);


    if(mysql_CheckAccount(playerid) == 0)
    {
    PlayerTextDrawShow(playerid,ConnectT2[playerid]);
    PlayerTextDrawShow(playerid,ConnectT1[playerid]);
    PlayerTextDrawShow(playerid,RegisterT[playerid]);
    //ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register","Bitte Gib ein Passwort an:","Register","Exit");
    }
    else if(mysql_CheckAccount(playerid) == 1)
    {
    PlayerTextDrawShow(playerid,ConnectT2[playerid]);
    PlayerTextDrawShow(playerid,ConnectT1[playerid]);
    PlayerTextDrawShow(playerid,LoginT[playerid]);
    //ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Bitte gib dein Passwort ein:","Login","Abbrechen");
    }
    return 1;
    }

  • stock mysql_CheckAccount(playerid)
    {
    new Query[128],Name[MAX_PLAYER_NAME],count;
    GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
    mysql_real_escape_string(Name, Name);
    format(Query, sizeof(Query), "SELECT * FROM `accounts` WHERE `Name` = '%s'", Name);
    mysql_query(Query);
    mysql_store_result();
    count = mysql_num_rows();
    mysql_free_result();
    return count;
    }


    stock CreateAccount(playerid, pass[])
    {
    new query[256],Name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
    mysql_real_escape_string(Name,Name);
    mysql_real_escape_string(pass,pass);
    format(query, sizeof(query), "INSERT INTO `accounts` (`Name`, `Passwort`) VALUES ('%s', '%s')", Name, pass);
    mysql_query(query);
    return true;
    }


    stock mysql_ReturnPasswort(Name[])
    {
    new query[130], Get[130];
    mysql_real_escape_string(Name, Name);
    format(query, 128, "SELECT `passwort` FROM `accounts` WHERE `Name` = '%s'", Name);
    mysql_query(query);
    mysql_store_result();
    mysql_fetch_row(Get);
    mysql_free_result();
    return Get;
    }


    findet ihr hier fehler?


    Kann es sein das es daran liegt das es keine tabelle erstellt wird :D =?

    Einmal editiert, zuletzt von Maurice. ()