Login/Register Textdraw anklickbar Problem!

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
  • Guten Abend Ich versuche schon seit Stunden meinen Textdraw anclickbar zumachen und halt mit meinen Login/Register System zu verbinden Ich hoffe es kann mir bitte jemand helfen Ich bin am verzweifeln. Ich poste mal alles nötige unten! Ich bin noch anfänger sry :D


    Mein Problem ist halt das Ich den Textdraw nicht anklicken kann und das der auch nicht weg geht wen Ich einfach auch so unten auf diesen Spawn buttons drücke.



    new Text:Textdraw0;
    new Text:Textdraw1;
    new Text:Textdraw2;
    new Text:Textdraw3;
    new Text:Textdraw4;
    new Text:Textdraw5;
    new Text:Textdraw6;
    new PlayerText:Textdraw7[MAX_PLAYERS]; Der soll anklickbar werden!


    public OnGameModeInit()
    {


    Textdraw0 = TextDrawCreate(59.159591, 110.000030, "usebox");
    TextDrawLetterSize(Textdraw0, 0.000000, 36.627773);
    TextDrawTextSize(Textdraw0, 585.993957, 0.000000);
    TextDrawAlignment(Textdraw0, 1);
    TextDrawColor(Textdraw0, 0);
    TextDrawUseBox(Textdraw0, true);
    TextDrawBoxColor(Textdraw0, 102);
    TextDrawSetShadow(Textdraw0, 0);
    TextDrawSetOutline(Textdraw0, 0);
    TextDrawFont(Textdraw0, 0);


    Textdraw1 = TextDrawCreate(440.409973, 186.083297, "LD_SPAC:white");
    TextDrawLetterSize(Textdraw1, 0.001402, -0.017500);
    TextDrawTextSize(Textdraw1, -240.819900, 121.916633);
    TextDrawAlignment(Textdraw1, 1);
    TextDrawColor(Textdraw1, -1061109505);
    TextDrawSetShadow(Textdraw1, 0);
    TextDrawSetOutline(Textdraw1, 0);
    TextDrawBackgroundColor(Textdraw1, -1061109505);
    TextDrawFont(Textdraw1, 4);


    Textdraw2 = TextDrawCreate(66.061508, 131.833389, "Tipp des Tages!");
    TextDrawLetterSize(Textdraw2, 0.449999, 1.600000);
    TextDrawAlignment(Textdraw2, 1);
    TextDrawColor(Textdraw2, -16776961);
    TextDrawSetShadow(Textdraw2, 0);
    TextDrawSetOutline(Textdraw2, 1);
    TextDrawBackgroundColor(Textdraw2, -1061109505);
    TextDrawFont(Textdraw2, 3);
    TextDrawSetProportional(Textdraw2, 1);


    Textdraw3 = TextDrawCreate(454.465637, 132.416656, "Tipp der Woche!");
    TextDrawLetterSize(Textdraw3, 0.449999, 1.600000);
    TextDrawAlignment(Textdraw3, 1);
    TextDrawColor(Textdraw3, 65413);
    TextDrawSetShadow(Textdraw3, 0);
    TextDrawSetOutline(Textdraw3, 1);
    TextDrawBackgroundColor(Textdraw3, -1061109505);
    TextDrawFont(Textdraw3, 3);
    TextDrawSetProportional(Textdraw3, 1);


    Textdraw4 = TextDrawCreate(220.205047, 366.916687, "DayDream-Roleplay");
    TextDrawLetterSize(Textdraw4, 0.449999, 1.600000);
    TextDrawAlignment(Textdraw4, 1);
    TextDrawColor(Textdraw4, 16711935);
    TextDrawSetShadow(Textdraw4, 0);
    TextDrawSetOutline(Textdraw4, 1);
    TextDrawBackgroundColor(Textdraw4, 65535);
    TextDrawFont(Textdraw4, 2);
    TextDrawSetProportional(Textdraw4, 1);


    Textdraw5 = TextDrawCreate(91.361633, 229.833343, "Test");
    TextDrawLetterSize(Textdraw5, 0.449999, 1.600000);
    TextDrawAlignment(Textdraw5, 1);
    TextDrawColor(Textdraw5, -1);
    TextDrawSetShadow(Textdraw5, 0);
    TextDrawSetOutline(Textdraw5, 1);
    TextDrawBackgroundColor(Textdraw5, 51);
    TextDrawFont(Textdraw5, 3);
    TextDrawSetProportional(Textdraw5, 1);


    Textdraw6 = TextDrawCreate(494.758514, 228.083343, "Test");
    TextDrawLetterSize(Textdraw6, 0.449999, 1.600000);
    TextDrawAlignment(Textdraw6, 1);
    TextDrawColor(Textdraw6, -1);
    TextDrawSetShadow(Textdraw6, 0);
    TextDrawSetOutline(Textdraw6, 1);
    TextDrawBackgroundColor(Textdraw6, 51);
    TextDrawFont(Textdraw6, 2);
    TextDrawSetProportional(Textdraw6, 1);
    }


    public OnPlayerConnect(playerid)
    {


    TextDrawSetSelectable(Textdraw7, 1);
    Textdraw7[playerid] = CreatePlayerTextDraw(playerid, 243.162261, 234.500076, "Login/Register");
    PlayerTextDrawLetterSize(playerid, Textdraw7[playerid], 0.449999, 1.600000);
    PlayerTextDrawTextSize(playerid, Textdraw7[playerid], -69.341133, 205.916732);
    PlayerTextDrawAlignment(playerid, Textdraw7[playerid], 1);
    PlayerTextDrawColor(playerid, Textdraw7[playerid], 65535);
    PlayerTextDrawSetShadow(playerid, Textdraw7[playerid], 0);
    PlayerTextDrawSetOutline(playerid, Textdraw7[playerid], 1);
    PlayerTextDrawBackgroundColor(playerid, Textdraw7[playerid], -1061109505);
    PlayerTextDrawFont(playerid, Textdraw7[playerid], 2);
    PlayerTextDrawSetProportional(playerid, Textdraw7[playerid], 1);



    TextDrawShowForPlayer(playerid,Textdraw0);
    TextDrawShowForPlayer(playerid,Textdraw1);
    TextDrawShowForPlayer(playerid,Textdraw2);
    TextDrawShowForPlayer(playerid,Textdraw3);
    TextDrawShowForPlayer(playerid,Textdraw4);
    TextDrawShowForPlayer(playerid,Textdraw5);
    TextDrawShowForPlayer(playerid,Textdraw6);
    PlayerTextDrawShow(playerid,Textdraw7[playerid]);


    }



    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    if(dialogid==DIALOG_LOGIN)
    {
    if(response)
    {
    new name[MAX_PLAYER_NAME],query[128],passwort[35];
    GetPlayerName(playerid,name,sizeof(name));
    if(strlen(inputtext)>0)
    {
    mysql_escape_string(inputtext,passwort,dbhandle);
    format(query,sizeof(query),"SELECT * FROM spieler WHERE name='%s' AND password=MD5('%s')",name,passwort);
    mysql_function_query(dbhandle,query,true,"OnPasswordResponse","i",playerid);
    }
    else
    {
    //Keine Eingabe
    SendClientMessage(playerid,Rot,"Gibt bitte dein Passwort ein.");
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"{0091FF}Login","{FFFFFF}Herzlich Willkommen zurück auf dem {00FF28}DayDream-Roleplay {FFFFFF}Server. \nDie {FF0037}Datenbank {FFFFFF}hat einen {FF0037}Account {FFFFFF}unter diesen namen gefunden! \nBitte geben Sie ihr {FF0037}Passwort {FFFFFF}ein.","Login","Abbrechen");
    }
    }
    else
    {
    Kick(playerid);
    }
    return 1;
    }
    if(dialogid==DIALOG_REGISTER)
    {
    if(response)
    {
    new name[MAX_PLAYER_NAME],query[128],passwort[35];
    GetPlayerName(playerid,name,sizeof(name));
    if(strlen(inputtext)>3)
    {
    //Registrierungsfunktion
    mysql_escape_string(inputtext,passwort,dbhandle);
    format(query,sizeof(query),"INSERT INTO spieler (name,password) VALUES ('%s',MD5('%s')) ",name,passwort);
    mysql_function_query(dbhandle,query,true,"OnPlayerRegister","i",playerid);
    SpawnPlayer(playerid);
    SetPlayerSkin(playerid,22);
    }
    else
    {
    //Kleiner als 4 Zeichen
    SendClientMessage(playerid,Rot,"Dein Passwort muss mindestens 4 Zeichen lang sein.");
    ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"{0091FF}Registrierung","{FFFFFF}Herzlich Willkommen auf dem {00FF28}DayDream-Roleplay {FFFFFF}Server. \n Die {FF0037}Datenbank {FFFFFF}hat {FF0037}keinen Account {FFFFFF}unter diesen namen gefunden! \nBitte {FF0037}erstellen {FFFFFF}Sie sich einen {FF0037}Account!","Registrieren","Abbrechen");

    }
    }
    else
    {
    Kick(playerid);
    }
    return 1;
    }



    public OnUserCheck(playerid)
    {
    new num_rows,num_fields;
    cache_get_data(num_rows,num_fields,dbhandle);
    if(num_rows==0)
    {
    //Registrierung
    ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"{0091FF}Registrierung","{FFFFFF}Herzlich Willkommen auf dem {00FF28}DayDream-Roleplay {FFFFFF}Server. \n Die {FF0037}Datenbank {FFFFFF}hat {FF0037}keinen Account {FFFFFF}unter diesen namen gefunden! \nBitte {FF0037}erstellen {FFFFFF}Sie sich einen {FF0037}Account!","Registrieren","Abbrechen");


    }
    else
    {
    //Login
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"{0091FF}Login","{FFFFFF}Herzlich Willkommen zurück auf dem {00FF28}DayDream-Roleplay {FFFFFF}Server. \nDie {FF0037}Datenbank {FFFFFF}hat einen {FF0037}Account {FFFFFF}unter diesen namen gefunden! \nBitte geben Sie ihr {FF0037}Passwort {FFFFFF}ein.","Login","Abbrechen");
    }


    return 1;
    }


    public OnPasswordResponse(playerid)
    {
    new num_fields,num_rows;
    cache_get_data(num_rows,num_fields,dbhandle);
    if(num_rows==1)
    {
    //Passwort richtig
    sStats[playerid][sEingeloggt] = 1;
    sStats[playerid][sLevel] = cache_get_field_content_int(0,"Level",dbhandle);
    SetPlayerScore(playerid,sStats[playerid][sLevel]);
    sStats[playerid][sid] = cache_get_field_content_int(0,"id",dbhandle);
    SetPlayerMoney(playerid,cache_get_field_content_int(0,"Money",dbhandle));
    sStats[playerid][sAdmin] = cache_get_field_content_int(0,"Admin",dbhandle);
    sStats[playerid][sWanteds] = cache_get_field_content_int(0,"Wanteds",dbhandle);
    SetPlayerWantedLevel(playerid,sStats[playerid][sWanteds]);
    sStats[playerid][sTimeBan] = cache_get_field_content_int(0,"TimeBan",dbhandle);
    sStats[playerid][sWarning1] = cache_get_field_content_int(0,"Warning1",dbhandle);
    sStats[playerid][sWarning2] = cache_get_field_content_int(0,"Warning2",dbhandle);
    sStats[playerid][sWarning3] = cache_get_field_content_int(0,"Warning3",dbhandle);
    sStats[playerid][sMute] = cache_get_field_content_int(0,"Mute",dbhandle);
    sStats[playerid][sSkin] = cache_get_field_content_int(0,"Skin",dbhandle);
    sStats[playerid][sSupportsperre] = cache_get_field_content_int(0,"Supportsperre",dbhandle);
    SpawnPlayer(playerid);
    SetPlayerSkin(playerid,22);

    //Timeban
    if(gettime()<sStats[playerid][sTimeBan] && sStats[playerid][sTimeBan] > 0)
    {
    new string[128];
    new days,hours,mins;
    new wartezeit = sStats[playerid][sTimeBan];
    new restzeit= wartezeit -gettime();
    days = floatround(restzeit / 86400,floatround_floor);
    hours = restzeit - (days * 86400);
    hours = floatround(hours / 3600,floatround_floor);
    mins = restzeit - ( (days * 86400) + (hours * 3600) );
    mins = floatround(mins / 60,floatround_floor);
    format(string, sizeof(string), "Du bist noch für %d Minuten gebannt.(%d Stunden).",mins,hours);
    SendClientMessage(playerid, Rot,string);
    TogglePlayerControllable(playerid, false);
    savePlayer(playerid);
    Kick(playerid);
    return 1;
    }
    else
    {
    sStats[playerid][sTimeBan] = 0;
    }
    if(sStats[playerid][sLevel] == 999)
    {
    sStats[playerid][sLevel] = 2;
    return 1;
    }
    //Endmute
    if(sStats[playerid][sMute] == 1)
    {
    SetTimerEx("EndMute", 300956, false, "d", playerid);
    }
    else
    {
    sStats[playerid][sMute] = 0;
    }
    }
    else
    {
    //Passwort falsch
    SendClientMessage(playerid,Rot,"Das eingegebene Passwort ist falsch.");
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"{0091FF}Login","{FFFFFF}Herzlich Willkommen zurück auf dem {00FF28}DayDream-Roleplay {FFFFFF}Server. \nDie {FF0037}Datenbank {FFFFFF}hat einen {FF0037}Account {FFFFFF}unter diesen namen gefunden! \nBitte geben Sie ihr {FF0037}Passwort {FFFFFF}ein.","Login","Abbrechen");
    }
    return 1;
    }



    public OnPlayerRegister(playerid)
    {
    sStats[playerid][sdb_id] = cache_insert_id(dbhandle);
    return 1;
    }


    public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
    {
    if(playertextid == Textdraw7[playerid])
    {
    SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on a textdraw.");
    CancelSelectTextDraw(playerid);
    //Login/Register
    new name[MAX_PLAYER_NAME],query[128];
    GetPlayerName(playerid,name,sizeof(name));
    format(query,sizeof(query),"SELECT id FROM spieler WHERE name='%s'",name);
    mysql_function_query(dbhandle,query,true,"OnUserCheck","i",playerid);
    }
    return 1;
    }

  • Meinst du so ?


    Textdraw7[playerid] = CreatePlayerTextDraw(playerid, 243.162261, 234.500076, "Login/Register");
    PlayerTextDrawLetterSize(playerid, Textdraw7[playerid], 0.449999, 1.600000);
    PlayerTextDrawTextSize(playerid, Textdraw7[playerid], -69.341133, 205.916732);
    PlayerTextDrawAlignment(playerid, Textdraw7[playerid], 1);
    PlayerTextDrawColor(playerid, Textdraw7[playerid], 65535);
    PlayerTextDrawSetShadow(playerid, Textdraw7[playerid], 0);
    PlayerTextDrawSetOutline(playerid, Textdraw7[playerid], 1);
    PlayerTextDrawBackgroundColor(playerid, Textdraw7[playerid], -1061109505);
    PlayerTextDrawFont(playerid, Textdraw7[playerid], 2);
    PlayerTextDrawSetProportional(playerid, Textdraw7[playerid], 1);

    TextDrawSetSelectable(Textdraw7[playerid], 1);

  • danke bekomme aber diese warnings!


    C:\Users\Justin\Desktop\DayDream-Roleplay\gamemodes\DDRP.pwn(332) : warning 213: tag mismatch
    C:\Users\Justin\Desktop\DayDream-Roleplay\gamemodes\DDRP.pwn(332) : warning 213: tag mismatch
    C:\Users\Justin\Desktop\DayDream-Roleplay\gamemodes\DDRP.pwn(332) : warning 202: number of arguments does not match definition
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    3 Warnings.

  • Habe Ich grade schon gemacht und getestet geht trz nicht!


    Textdraw7[playerid] = CreatePlayerTextDraw(playerid, 243.162261, 234.500076, "Login/Register");
    PlayerTextDrawLetterSize(playerid, Textdraw7[playerid], 0.449999, 1.600000);
    PlayerTextDrawTextSize(playerid, Textdraw7[playerid], -69.341133, 205.916732);
    PlayerTextDrawAlignment(playerid, Textdraw7[playerid], 1);
    PlayerTextDrawColor(playerid, Textdraw7[playerid], 65535);
    PlayerTextDrawSetShadow(playerid, Textdraw7[playerid], 0);
    PlayerTextDrawSetOutline(playerid, Textdraw7[playerid], 1);
    PlayerTextDrawBackgroundColor(playerid, Textdraw7[playerid], -1061109505);
    PlayerTextDrawFont(playerid, Textdraw7[playerid], 2);
    PlayerTextDrawSetProportional(playerid, Textdraw7[playerid], 1);

    PlayerTextDrawSetSelectable(playerid, Textdraw7[playerid], 1);

    SelectTextDraw(playerid, 0xFFFFFFFF);

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen