DIALOG_STYLE_LIST Dynamische Listitems

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • DIALOG_STYLE_LIST Dynamische Listitems

    Ich habe schon mehrere Stichworte in die SuFu eingegeben, komme aber nicht an mein Ziel.
    Ich möchte die Anzahl der Einträge aus der MySQL Datenbank auslesen und sie in einen Dialog wiedergeben
    (DIALOY_STYLE_LIST). Wenn ich 4 Einträge habe sollen auch die 4 In der Liste erscheinen, habe ich 6 sollen 6 stk erscheinen.


    In bedanke mich für jede Hilfe, die mir weiterhilft :thumbsup:

    MFG
    EllBundy
  • Ungefähr so:

    Irgendwo rufst du ja deine Query auf:

    PAWN-Quellcode

    1. mysql_tquery(handle,"SELECT * FROM `example`", "OnQueryLoaded", "d", playerid);


    Dann erstellst du die Funktion:

    PAWN-Quellcode

    1. forward OnQueryLoaded(playerid);
    2. public OnQueryLoaded(playerid)
    3. {
    4. new rows;
    5. cache_get_row_count(rows);
    6. new dialogstr[4096],addstr[256];
    7. for(new i; i<rows; i++)
    8. {
    9. //irgendwelche Sachen halt auslesen (wichtig: i und nicht 0 verwenden)
    10. format(addstr, sizeof(addstr),"%s test %d mit %f", test1, test2, test3);
    11. strcat(dialogstr, addstr);
    12. }
    13. ShowPlayerDialog(playerid, 1000, DIALOG_STYLE_LIST, "Dynamischer Listendialog", dialogstr, "Auswählen", "Schliessen");
    14. return 1;
    15. }
    Alles anzeigen
    Ich helfe zu allen Fragen bezüglich PAWN Scripting gerne weiter.
    Ich biete auch einen Scripting Service an: Scripting Service

    Konversation: Konversation starten

    Discord: LeonMrBonnie#2251

  • Hey danke für deine Antwort, aber bleibe nun bei meinem Letzten erstell Dialog stehen !

    Response Dialog:

    PAWN-Quellcode

    1. case DIALOG_ADMINHAUSC2:
    2. {
    3. if(!response){ return ShowPlayerDialog(playerid, DIALOG_ADMINHAUSC2, DIALOG_STYLE_INPUT, str, "Gebe nun den Betrag ein:", "Weiter", "Zurück"); }
    4. switch(HausCreate[playerid][chKaufart])
    5. {
    6. case 1:
    7. {
    8. if(strval(inputtext) > 250){ HausCreate[playerid][chKaufpreis] = strval(inputtext); CreateHouse(playerid, 2); }
    9. else{ return ShowPlayerDialog(playerid, DIALOG_ADMINHAUSC2, DIALOG_STYLE_INPUT, "Haussystem -> Kaufart -> Coins", "Gebe nun den Betrag ein:\nDer Betrag muss höher als 250 Coins sein !", "Weiter", "Zurück");}
    10. }
    11. case 2:
    12. {
    13. if(strval(inputtext) > 500000){ HausCreate[playerid][chKaufpreis] = strval(inputtext); CreateHouse(playerid, 2); }
    14. else{ return ShowPlayerDialog(playerid, DIALOG_ADMINHAUSC2, DIALOG_STYLE_INPUT, "Haussystem -> Kaufart -> SA$", "Gebe nun den Betrag ein:\nDer Betrag muss höher als 500000 Coins sein !", "Weiter", "Zurück");}
    15. } // Bis hier hin wird alles ausgeführt !!!
    16. }
    17. mysql_pquery(handle,"SELECT * FROM 'interior' WHERE art = 'haus'", "GetInteriorList", "d", playerid);
    18. }
    Alles anzeigen


    GetInteriorList:

    PAWN-Quellcode

    1. public GetInteriorList(playerid)
    2. {
    3. new rows;
    4. cache_get_row_count(rows);
    5. new dialogstr[4096],addstr[32],intname[32];
    6. for(new i; i<rows; i++)
    7. {
    8. cache_get_value_name_int(i, "ID", HausCreate[playerid][chIntID]);
    9. cache_get_value_name(i, "name", intname);
    10. format(addstr, sizeof(addstr),"[%d]%s\n",HausCreate[playerid][chIntID], intname);
    11. strcat(dialogstr, addstr);
    12. }
    13. ShowPlayerDialog(playerid, DIALOG_ADMINHAUSC3, DIALOG_STYLE_LIST, "Haussystem -> Interior", dialogstr, "Weiter", "Zurück");
    14. return 1;
    15. }
    Alles anzeigen


    Eine weitere Frage !
    Wie kann ich die ID übermitteln, damit ich bei dem listitem die richtige ID bekomme ?
  • Du könntest so machen, dass du einfach statt DIALOG_STYLE_LIST einfach DIALOG_STYLE_TABLIST verwendest.
    Dann musst du nur Zeile 10 zu dem ändern:

    PAWN-Quellcode

    1. format(addstr, sizeof(addstr),"%d\t%s\n",HausCreate[playerid][chIntID], intname);

    Und Zeile 13:

    PAWN-Quellcode

    1. ShowPlayerDialog(playerid, DIALOG_ADMINHAUSC3, DIALOG_STYLE_TABLIST, "Haussystem -> Interior", dialogstr, "Weiter", "Zurück");


    Dann kannst du beim OnDialogResponse einfach inputtext verwenden.
    Inputtext ist dann die ID des Hauses als String.
    Ich helfe zu allen Fragen bezüglich PAWN Scripting gerne weiter.
    Ich biete auch einen Scripting Service an: Scripting Service

    Konversation: Konversation starten

    Discord: LeonMrBonnie#2251

  • Werde ich so abändern, aber zum Testen müsste ich den Dialog angezeigt bekommen, was ja erstmal mein Hauptproblem ist.

    PAWN-Quellcode

    1. mysql_tquery(handle,"SELECT * FROM 'interior' WHERE art = 'haus'", "GetInteriorList", "d", playerid);


    PAWN-Quellcode

    1. mysql_pquery(handle,"SELECT * FROM 'interior' WHERE art = 'haus'", "GetInteriorList", "d", playerid);


    Beide Varianten funktionieren nicht. Der letzte Dialog wird ausgeführt, aber die Interiorliste erscheint nicht.
  • mysql_tquery(handle,"SELECT * FROM 'interior' WHERE art = 'haus'", "GetInteriorList", "d", playerid);

    Diese benutzt du in einem Query für strings. ( ' ' )
    Wenn du die Tabellennamen etc escapen willst verwende Backticks ( `` )

    Also so

    PAWN-Quellcode

    1. mysql_tquery(handle,"SELECT * FROM `interior` WHERE art = 'haus'", "GetInteriorList", "d", playerid);
    Ich helfe zu allen Fragen bezüglich PAWN Scripting gerne weiter.
    Ich biete auch einen Scripting Service an: Scripting Service

    Konversation: Konversation starten

    Discord: LeonMrBonnie#2251

  • log_ core.txt
    [20:43:53] [INFO] received Windows console close event; shutting log-core down

    warnings.txt

    PAWN-Quellcode

    1. [20:41:25] [plugins/mysql] mysql_connect: no password specified // Ist glaube ich weil ich kein passwort habe


    Habe nun folgende Anfragen ausprobiert, aber die TABLIST erscheint immer noch nicht

    tquery

    PAWN-Quellcode

    1. mysql_tquery(handle,"SELECT * FROM `interior` WHERE `art` = 'haus'", "GetInteriorList", "d", playerid);


    PAWN-Quellcode

    1. mysql_tquery(handle,"SELECT * FROM `interior` WHERE art = 'haus'", "GetInteriorList", "d", playerid);


    pquery

    PAWN-Quellcode

    1. mysql_pquery(handle,"SELECT * FROM `interior` WHERE `art` = 'haus'", "GetInteriorList", "d", playerid);

    PAWN-Quellcode

    1. mysql_pquery(handle,"SELECT * FROM `interior` WHERE art = 'haus'", "GetInteriorList", "d", playerid);



    Das kann doch nicht so schwer sein :huh: ?(

  • PAWN-Quellcode

    1. [20:15:31] [WARNING] mysql_connect: no password specified
    2. [20:16:27] [ERROR] error #1054 while executing query "INSERT INTO user (name, password) VALUES ('Ellbundy', MD5('Steven90'))": Unknown column 'password' in 'field list'
    3. [20:16:39] [ERROR] error #1054 while executing query "INSERT INTO user (name, password) VALUES ('Ellbundy', MD5('steven90'))": Unknown column 'password' in 'field list'
    4. [20:18:31] [WARNING] mysql_connect: no password specified
    5. [20:24:59] [WARNING] mysql_connect: no password specified
    6. [20:25:44] [WARNING] mysql_connect: no password specified
    7. [20:30:46] [WARNING] mysql_connect: no password specified
    8. [20:57:32] [WARNING] mysql_connect: no password specified
    9. [22:09:35] [WARNING] mysql_connect: no password specified
    10. [22:17:14] [WARNING] mysql_connect: no password specified
    11. [22:19:41] [WARNING] mysql_connect: no password specified
    12. [22:23:55] [WARNING] mysql_connect: no password specified
    13. [18:01:05] [WARNING] mysql_connect: no password specified
    14. [18:06:01] [WARNING] mysql_connect: no password specified
    15. [16:05:48] [WARNING] mysql_connect: no password specified
    16. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    17. [16:05:48] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    18. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    19. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    20. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    21. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    22. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    23. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    24. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    25. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    26. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    27. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    28. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    29. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    30. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    31. [16:05:48] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    32. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    33. [16:05:48] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    34. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    35. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    36. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    37. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    38. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    39. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    40. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    41. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    42. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    43. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    44. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    45. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    46. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    47. [16:05:48] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    48. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    49. [16:05:48] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    50. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    51. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    52. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    53. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    54. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    55. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    56. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    57. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    58. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    59. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    60. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    61. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    62. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    63. [16:05:48] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    64. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    65. [16:05:48] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    66. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    67. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    68. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    69. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    70. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    71. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    72. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    73. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    74. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    75. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    76. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    77. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    78. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    79. [16:05:48] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    80. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    81. [16:05:48] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    82. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    83. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    84. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    85. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    86. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    87. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    88. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    89. [16:05:48] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    90. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    91. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    92. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    93. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    94. [16:05:48] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    95. [16:05:48] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    96. [16:09:49] [WARNING] mysql_connect: no password specified
    97. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    98. [16:09:49] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    99. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    100. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    101. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    102. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    103. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    104. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    105. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    106. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    107. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    108. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    109. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    110. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    111. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    112. [16:09:49] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    113. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    114. [16:09:49] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    115. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    116. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    117. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    118. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    119. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    120. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    121. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    122. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    123. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    124. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    125. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    126. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    127. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    128. [16:09:49] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    129. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    130. [16:09:49] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    131. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    132. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    133. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    134. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    135. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    136. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    137. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    138. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    139. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    140. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    141. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    142. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    143. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    144. [16:09:49] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    145. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    146. [16:09:49] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    147. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    148. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    149. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    150. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    151. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    152. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    153. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    154. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    155. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    156. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    157. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    158. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    159. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    160. [16:09:49] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    161. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    162. [16:09:49] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    163. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    164. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    165. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    166. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    167. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    168. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    169. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    170. [16:09:49] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    171. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    172. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    173. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    174. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    175. [16:09:49] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    176. [16:09:49] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    177. [16:10:28] [WARNING] mysql_connect: no password specified
    178. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    179. [16:10:28] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    180. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    181. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    182. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    183. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    184. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    185. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    186. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    187. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    188. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    189. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    190. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    191. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    192. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    193. [16:10:28] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    194. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    195. [16:10:28] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    196. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    197. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    198. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    199. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    200. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    201. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    202. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    203. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    204. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    205. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    206. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    207. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    208. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    209. [16:10:28] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    210. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    211. [16:10:28] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    212. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    213. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    214. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    215. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    216. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    217. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    218. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    219. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    220. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    221. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    222. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    223. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    224. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    225. [16:10:28] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    226. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    227. [16:10:28] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    228. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    229. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    230. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    231. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    232. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    233. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    234. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    235. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    236. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    237. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    238. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    239. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    240. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    241. [16:10:28] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    242. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    243. [16:10:28] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    244. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    245. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    246. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    247. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    248. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    249. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    250. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    251. [16:10:28] [ERROR] cache_get_value_name_float: invalid row index '5' (number of rows: '5')
    252. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    253. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    254. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    255. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    256. [16:10:28] [ERROR] cache_get_value_name_int: invalid row index '5' (number of rows: '5')
    257. [16:10:28] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    258. [16:12:04] [WARNING] mysql_connect: no password specified
    259. [16:12:04] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    260. [16:12:04] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    261. [16:12:04] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    262. [16:12:05] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    263. [16:12:05] [ERROR] cache_get_value_name: invalid row index '5' (number of rows: '5')
    264. [16:27:26] [WARNING] mysql_connect: no password specified
    265. [19:41:06] [WARNING] mysql_connect: no password specified
    266. [19:42:33] [ERROR] error #1064 while executing query "SELECT name FROM 'interior' WHERE art = 'haus'": You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''interior' WHERE art = 'haus'' at line 1
    267. [19:42:57] [ERROR] error #1064 while executing query "SELECT name FROM 'interior' WHERE art = 'haus'": You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''interior' WHERE art = 'haus'' at line 1
    268. [19:45:45] [WARNING] mysql_connect: no password specified
    269. [19:47:42] [ERROR] error #1064 while executing query "SELECT * FROM 'interior' WHERE art = 'haus'": You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''interior' WHERE art = 'haus'' at line 1
    270. [19:48:55] [WARNING] mysql_connect: no password specified
    271. [19:50:12] [ERROR] error #1064 while executing query "SELECT * FROM 'interior' WHERE art = 'haus'": You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''interior' WHERE art = 'haus'' at line 1
    272. [20:05:02] [WARNING] mysql_connect: no password specified
    273. [20:05:11] [WARNING] mysql_connect: no password specified
    274. [20:14:56] [WARNING] mysql_connect: no password specified
    275. [20:22:36] [WARNING] mysql_connect: no password specified
    276. [20:23:12] [ERROR] error #1054 while executing query "SELECT * FROM `interior` WHERE art = `haus`": Unknown column 'haus' in 'where clause'
    277. [20:24:07] [WARNING] mysql_connect: no password specified
    278. [20:24:58] [WARNING] mysql_connect: no password specified
    279. [20:25:38] [ERROR] error #1054 while executing query "SELECT * FROM `interior` WHERE art = `haus`": Unknown column 'haus' in 'where clause'
    280. [20:41:25] [WARNING] mysql_connect: no password specified
    281. [20:44:06] [WARNING] mysql_connect: no password specified
    282. [20:47:29] [WARNING] mysql_connect: no password specified
    283. [20:48:53] [WARNING] mysql_connect: no password specified
    284. [20:57:06] [WARNING] mysql_connect: no password specified
    Alles anzeigen
  • gewöhn dir mal die backticks an und verwende die richtig!

    SQL-Abfrage

    1. SELECT * FROM 'interior' WHERE art = 'haus'



    Das ist Falsch!

    SQL-Abfrage

    1. SELECT * FROM `interior` WHERE `art` = 'haus';
    So sollte es aussehen

    SQL-Abfrage

    1. INSERT INTO user (name, password) VALUES ('Ellbundy', MD5('Steven90'))
    Nutz auch hier backticks

    SQL-Abfrage

    1. INSERT INTO `user` (`name`, `password`) VALUES ('Ellbundy', MD5('Steven90'));

    Aber mach mal ein Passwort in den Datenbanknutzer rein
    All in all it's just another brick in the wall
  • PAWN-Quellcode

    1. public GetInteriorList(playerid)
    2. {
    3. printf("Test2");
    4. new rows;
    5. cache_get_row_count(rows);
    6. printf("rows: %d", rows);
    7. new dialogstr[4096],addstr[32],intname[32],intid;
    8. for(new i = 0; i != rows; i++)
    9. {
    10. cache_get_value_name_int(i, "ID", intid);
    11. cache_get_value_name(i, "name", intname);
    12. format(addstr, sizeof(addstr),"%d\t%s\n",intid, intname);
    13. strcat(dialogstr, addstr);
    14. mysql_log();
    15. printf("Test3");
    16. }
    17. ShowPlayerDialog(playerid, DIALOG_ADMINHAUSC3, DIALOG_STYLE_TABLIST, "Haussystem -> Interior", dialogstr, "Weiter", "Abbrechen");
    18. printf("Test4");
    19. return 1;
    20. }
    Alles anzeigen


    Also habe nun testprint´s eingefügt, "Test2" und die Row anzahl werden korrekt angezeigt !
    "Test 3" und "Test 4" werden nicht ausgegeben
  • nimm mal den debug aus der schleife raus
    bin mir fast sicher dass der daran schuld ist

    Aber zum testen mach mal nen print davor
    also so

    Quellcode

    1. public GetInteriorList(playerid)
    2. {
    3. printf("Test2");
    4. new rows;
    5. cache_get_row_count(rows);
    6. printf("rows: %d", rows);
    7. new dialogstr[4096],addstr[32],intname[32],intid;
    8. for(new i = 0; i != rows; i++)
    9. {
    10. cache_get_value_name_int(i, "ID", intid);
    11. cache_get_value_name(i, "name", intname);
    12. format(addstr, sizeof(addstr),"%d\t%s\n",intid, intname);
    13. strcat(dialogstr, addstr);
    14. printf("Test3 vor log");
    15. mysql_log();
    16. printf("Test3 nach log");
    17. }
    18. ShowPlayerDialog(playerid, DIALOG_ADMINHAUSC3, DIALOG_STYLE_TABLIST, "Haussystem -> Interior", dialogstr, "Weiter", "Abbrechen");
    19. printf("Test4");
    20. return 1;
    21. }
    Alles anzeigen
    (Will mal wissen ob er bis dahin kommt
    wenn ja dann nimm den log da weg
    All in all it's just another brick in the wall
  • SA-MP Dedicated Server
    ----------------------
    v0.3.7-R2, (C)2005-2015 SA-MP Team

    [22:00:52] filterscripts = "" (string)
    [22:00:52]
    [22:00:52] Server Plugins
    [22:00:52] --------------
    [22:00:52] Loading plugin: mysql
    [22:00:52] >> plugin.mysql: R41-4 successfully loaded.
    [22:00:52] Loaded.
    [22:00:52] Loaded 1 plugins.

    [22:00:52]
    [22:00:52] Filterscripts
    [22:00:52] ---------------
    [22:00:52] Loaded 0 filterscripts.

    [22:00:52]
    --------------------------------------
    [22:00:52] Reallife Gamemode by EllBundy
    [22:00:52] --------------------------------------

    [22:00:52] [MySQL] Verbindungsaufbau...
    [22:00:52] [MySQL] Die Verbindung zur Datenbank wurde erfolgreich hergestellt! Handle: 1
    [22:00:52] Script[gamemodes/Reallife.amx]: Run time error 20: "Invalid index parameter (bad entry point)"
    [22:00:52] Number of vehicle models: 0
    [22:00:52] LOAD: Haus[1] | X[0.000000] | Y[0.000000] | Z[0.000000] | Int[3]
    [22:00:52] LOAD: Haus[2] | X[0.000000] | Y[0.000000] | Z[0.000000] | Int[2]
    [22:00:52] LOAD: Haus[3] | X[0.000000] | Y[0.000000] | Z[0.000000] | Int[2]
    [22:00:52] LOAD: Haus[4] | X[1105.630004] | Y[-311.832000] | Z[73.985099] | Int[2]
    [22:00:52] LOAD: Haus[5] | X[1102.530029] | Y[-311.401000] | Z[73.992202] | Int[0]
    [22:00:52] [HAUSSYSTEM] Es wurden 5 Häuser geladen.
    [22:01:14] [connection] 127.0.0.1:62393 requests connection cookie.
    [22:01:15] [connection] incoming connection: 127.0.0.1:62393 id: 0
    [22:01:15] [join] Ellbundy has joined the server (0:127.0.0.1)
    [22:01:30] Test
    [22:01:30] Test2
    [22:01:30] rows: 2