10 Errors!

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
  • Heyho ihr Brotfische,


    Ich habe da ein Problem; Ich versuche PrivatCars abzuspeichern nach dem Autokauf aber bekomme
    10 Errors, was soll ich tun?


    Code:

    Spoiler anzeigen
    PrivatCar[playerid][CarName] = SellCar[i][CarName];
    PrivatCar[playerid][PlayerName] = GetName(playerid);
    PrivatCar[playerid][modelid] = SellCar[playerid][modelid];
    PrivatCar[playerid][CarKey[playerid]][Float:pcX[CarKey[playerid]] = 553.5764;
    PrivatCar[playerid][CarKey[playerid]][Float:pcY[CarKey[playerid]] = -1263.9396;
    PrivatCar[playerid][CarKey[playerid]][Float:pcZ[CarKey[playerid]] = 16.9468;
    PrivatCar[playerid][CarKey[playerid]][Float:pcA[CarKey[playerid]] = 307.2815;


    Errors:

    Spoiler anzeigen
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3435) : error 091: ambiguous constant; tag override is required (symbol "CarName")
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3435) : error 047: array sizes do not match, or destination array is too small
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3436) : warning 213: tag mismatch
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3436) : error 032: array index out of bounds (variable "PrivatCar")
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3436) : error 047: array sizes do not match, or destination array is too small
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3437) : error 091: ambiguous constant; tag override is required (symbol "modelid")
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3437) : error 047: array sizes do not match, or destination array is too small
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3438) : error 028: invalid subscript (not an array or too many subscripts): "pcX"
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3438) : warning 215: expression has no effect
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3438) : error 001: expected token: ";", but found "]"
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3438) : error 029: invalid expression, assumed zero
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3438) : fatal error 107: too many error messages on one line

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

    Spoiler anzeigen
    10 Errors.


  • PrivatCar[playerid][CarName] = SellCar[i][CarName];
    PrivatCar[playerid][PlayerName] = GetName(playerid);
    PrivatCar[playerid][modelid] = SellCar[playerid][modelid];
    PrivatCar[playerid][CarKey[playerid]][pcX[CarKey[playerid]] = 553.5764;
    PrivatCar[playerid][CarKey[playerid]][pcY[CarKey[playerid]] = -1263.9396;
    PrivatCar[playerid][CarKey[playerid]][pcZ[CarKey[playerid]] = 16.9468;
    PrivatCar[playerid][CarKey[playerid]][pcA[CarKey[playerid]] = 307.2815;


    Warum schreibst du da auch Float hin??

    Mit freundlichen Grüßen,


    Fabi.StaR :love::saint:


  • Jetzt habe ich Warnings weg, aber Errors sind immernoch da -.-


    Spoiler anzeigen
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3435) : error 091: ambiguous constant; tag override is required (symbol "CarName")
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3435) : error 047: array sizes do not match, or destination array is too small
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3436) : warning 213: tag mismatch
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3436) : error 032: array index out of bounds (variable "PrivatCar")
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3436) : error 047: array sizes do not match, or destination array is too small
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3437) : error 091: ambiguous constant; tag override is required (symbol "modelid")
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3437) : error 047: array sizes do not match, or destination array is too small
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3438) : error 028: invalid subscript (not an array or too many subscripts): "pcX"
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3438) : warning 215: expression has no effect
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3438) : error 001: expected token: ";", but found "]"
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3438) : error 029: invalid expression, assumed zero
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3438) : fatal error 107: too many error messages on one line

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

    Spoiler anzeigen
    10 Errors.

  • Also mein Code sieht jetzt so aus:


    Spoiler anzeigen
    PrivatCar[playerid][CarKey[playerid]][CarName] = SellCar[i][CarName];
    PrivatCar[playerid][CarKey[playerid]][PlayerName] = GetName(playerid);
    PrivatCar[playerid][CarKey[playerid]][modelid] = SellCar[playerid][modelid];
    PrivatCar[playerid][CarKey[playerid]][pcX[CarKey[playerid]] = 553.5764;
    PrivatCar[playerid][CarKey[playerid]][pcY[CarKey[playerid]] = -1263.9396;
    PrivatCar[playerid][CarKey[playerid]][pcZ[CarKey[playerid]] = 16.9468;
    PrivatCar[playerid][CarKey[playerid]][pcA[CarKey[playerid]] = 307.2815;


    Errors nurnoch 5:

    Spoiler anzeigen
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3436) : error 047: array sizes do not match, or destination array is too small
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3438) : error 028: invalid subscript (not an array or too many subscripts): "pcX"
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3438) : warning 215: expression has no effect
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3438) : error 001: expected token: ";", but found "]"
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3438) : error 029: invalid expression, assumed zero
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3438) : fatal error 107: too many error messages on one line

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

    Spoiler anzeigen
    5 Errors.


    Mein Enum oO:

    Spoiler anzeigen
    #define MAX_KEYS 5
    enum PrivatCars
    {
    CarName[64],
    PlayerName[64],
    modelid,
    Float:pcX,
    Float:pcY,
    Float:pcZ,
    Float:pcA
    }
    new PrivatCar[MAX_PLAYERS][MAX_KEYS][PrivatCars];

  • Falsch .. MAX_PLAYER_NAME ^^


    Aber trotzdem danke :P


    Immernoch 4 Erros


    Spoiler anzeigen
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3438) : error 028: invalid subscript (not an array or too many subscripts): "pcX"
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3438) : warning 215: expression has no effect
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3438) : error 001: expected token: ";", but found "]"
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3438) : error 029: invalid expression, assumed zero
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3438) : fatal error 107: too many error messages on one line

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

    Spoiler anzeigen
    4 Errors.

  • Da fehlte jewals ein ]

    PrivatCar[playerid][CarKey[playerid]][pcX[CarKey[playerid]]] = 553.5764;
    PrivatCar[playerid][CarKey[playerid]][pcY[CarKey[playerid]]] = -1263.9396;
    PrivatCar[playerid][CarKey[playerid]][pcZ[CarKey[playerid]]] = 16.9468;
    PrivatCar[playerid][CarKey[playerid]][pcA[CarKey[playerid]]] = 307.2815;

  • Also es sieht so aus::


    Spoiler anzeigen
    PrivatCar[playerid][CarKey[playerid]][pcX[CarKey[playerid]]] = 553.5764; //Betroffene Zeile
    PrivatCar[playerid][CarKey[playerid]][pcY[CarKey[playerid]]] = -1263.9396;
    PrivatCar[playerid][CarKey[playerid]][pcZ[CarKey[playerid]]] = 16.9468;
    PrivatCar[playerid][CarKey[playerid]][pcA[CarKey[playerid]]] = 307.2815;


    Errors:

    Spoiler anzeigen
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3438) : error 028: invalid subscript (not an array or too many subscripts): "pcX"
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3438) : warning 215: expression has no effect
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3438) : error 001: expected token: ";", but found "]"
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3438) : error 029: invalid expression, assumed zero
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\SelfmadeBT.pwn(3438) : fatal error 107: too many error messages on one line

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

    Spoiler anzeigen
    4 Errors.

  • In der Zeile mit dem Error ist dein Array dreidimensional:

    Zitat

    PrivatCar[playerid][CarKey[playerid]][pcX[CarKey[playerid]]] = 553.5764;


    Aber sonst sind die anderen Arrays mit gleichem Namen zweidimensional

    Zitat

    PrivatCar[playerid][CarName] = SellCar[CarName];
    PrivatCar[playerid][PlayerName] = GetName(playerid);
    PrivatCar[playerid][modelid] = SellCar[playerid][modelid];


    Und hier liegt der Fehler.