Dialog Error

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
  • tag


    Hab nen Dialog gemacht wo er sich waffen holen kann und er zeigt mir 26 Errors an


    Hab den Dialog Definiert etc


    if(strcmp(cmdtext,"/waffen",true)==0)
    {
    ShowPlayerDialog(playerid,Waffen,DIALOG_STYLE_LIST,"Waffen Menü","Shotgun 5.000$\nMesser 200$\nKettenSäge 15.000$\nMolotov 25.000$\nArmor 500$\Health 500$","Fertig","Beenden");
    }


    if(dialogid==Waffen)
    {
    if(response==0)
    {
    return 1;
    }
    if(response==1)
    {
    return 1;
    }
    if(listitem == 0)
    {
    GivePlayerWeapon(playerid,26,250);
    GivePlayerMoney(playerid,-5000);
    return 1;
    }
    if(listitem == 1)
    {
    GivePlayerWeapon(playerid,4,1);
    GivePlayerMoney(playerid,-200);
    return 1;
    }
    if(listitem == 2)
    {
    GivePlayerWeapon(playerid,9,1);
    GivePlayerMoney(playerid,-15000);
    return 1;
    }
    if(listitem == 3)
    {
    GivePlayerWeapon(playerid,18,20);
    GivePlayerMoney(playerid,-25000);
    return 1;
    }
    if(listitem == 4)
    {
    SetPlayerArmour(playerid,100);
    GivePlayerMoney(playerid,-500);
    return 1;
    }
    if(listitem == 5)
    {
    SetPlayerHealth(playerid,100);
    GivePlayerMoney(playerid,-500);
    return 1;
    }

  • Klammerfehler, leider ist alels bisschen verschoben aber wie ich sehe fehlt ganz unten eine } klammer

  • Probiers mal so, sollte gehen:

    if(dialogid==Waffen)
    {
    if(response==0)
    {
    return 1;
    }
    if(response==1)
    {
    switch(listitem)
    case 0:
    {
    GivePlayerWeapon(playerid,26,250);
    GivePlayerMoney(playerid,-5000);
    return 1;
    }
    case 1:
    {
    GivePlayerWeapon(playerid,4,1);
    GivePlayerMoney(playerid,-200);
    return 1;
    }
    case 2:
    {
    GivePlayerWeapon(playerid,9,1);
    GivePlayerMoney(playerid,-15000);
    return 1;
    }
    case 3:
    {
    GivePlayerWeapon(playerid,18,20);
    GivePlayerMoney(playerid,-25000);
    return 1;
    }
    case 4:
    {
    SetPlayerArmour(playerid,100);
    GivePlayerMoney(playerid,-500);
    return 1;
    }
    case 5:
    {
    SetPlayerHealth(playerid,100);
    GivePlayerMoney(playerid,-500);
    return 1;
    }
    }
    }

  • : error 017: undefined symbol "SpielerSpeichern"
    : error 017: undefined symbol "dcmd_tban"
    : error 017: undefined symbol "dcmd_tunban"
    : error 017: undefined symbol "SpielerName"
    error 017: undefined symbol "isPlayerAnAdmin"
    error 017: undefined symbol "isPlayerAnAdmin"
    : error 017: undefined symbol "isPlayerAnAdmin"
    : error 017: undefined symbol "isPlayerAnAdmin"


    : error 027: invalid character constant
    : error 027: invalid character constant
    : error 079: inconsistent return types (array & non-array)
    error 079: inconsistent return types (array & non-array)
    Crror 017: undefined symbol "Login"
    error 079: inconsistent return types (array & non-array)
    error 079: inconsistent return types (array & non-array)
    : error 079: inconsistent return types (array & non-array)
    ) : error 017: undefined symbol "Register"
    : error 079: inconsistent return types (array & non-array)
    : error 079: inconsistent return types (array & non-array)
    : error 001: expected token: "{", but found "case"
    : error 079: inconsistent return types (array & non-array)
    : error 079: inconsistent return types (array & non-array)
    error 079: inconsistent return types (array & non-array)
    : error 079: inconsistent return types (array & non-array)
    error 079: inconsistent return types (array & non-array)


    Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    26 Errors.

  • So geht's:


    if(dialogid==Waffen)
    {
    if(response==0)
    {
    return 1;
    }
    if(response==1)
    {
    return 1;
    }
    if(listitem == 0)
    {
    GivePlayerWeapon(playerid,26,250);
    GivePlayerMoney(playerid,-5000);
    return 1;
    }
    if(listitem == 1)
    {
    GivePlayerWeapon(playerid,4,1);
    GivePlayerMoney(playerid,-200);
    return 1;
    }
    if(listitem == 2)
    {
    GivePlayerWeapon(playerid,9,1);
    GivePlayerMoney(playerid,-15000);
    return 1;
    }
    if(listitem == 3)
    {
    GivePlayerWeapon(playerid,18,20);
    GivePlayerMoney(playerid,-25000);
    return 1;
    }
    if(listitem == 4)
    {
    SetPlayerArmour(playerid,100);
    GivePlayerMoney(playerid,-500);
    return 1;
    }
    if(listitem == 5)
    {
    SetPlayerHealth(playerid,100);
    GivePlayerMoney(playerid,-500);
    return 1;
    }
    }

    Back to the roots!