Auto Tank System Fehler - "must be assigned to an array"

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
  • Hey ihr Brotfische!


    Ich hab ein Problem,ich gebe den Autos auf meinem Server einen Tank.. und das ganze klappt nicht ganz.
    Ich habe oben:


    new CarTanks[][] =
    {
    "60", "60", "60", "80", "60", "60",
    "80", "60", "60", "60", "60", "60",
    "60", "60", "60", "60", "60", "80", "60",
    "60", "60", "60", "60", "60", "60",
    "80", "60", "60", "60", "60", "60", "60",
    "80", "60", "60", "60", "60", "60", "60",
    "60", "60", "20", "60", "60", "80", "60",
    "60", "80", "30", "60", "60", "80", "60",
    "60", "60", "80", "60", "30", "60", "60",
    "80", "40", "30", "40", "20", "20", "60",
    "60","40", "80", "60", "40", "60", "60",
    "60", "60", "80", "60", "60", "60", "60", "0",
    "60", "60", "60", "30", "60", "60", "60",
    "60", "80", "60", "60", "60", "60", "60",
    "60", "60", "60", "60", "60", "20",
    "60", "60", "60", "80", "60",
    "60", "60", "0", "0", "80", "80", "40",
    "60", "60", "60", "60", "60", "80", "120",
    "80", "80", "30", "80", "60", "60",
    "60", "60", "60", "30", "50", "120", "60",
    "60", "60", "60", "0", "0", "60", "60",
    "120", "60", "60", "60", "60", "60", "60",
    "80", "60", "60", "60", "60", "120", "60",
    "60", "80", "80", "60", "60", "80", "60",
    "60", "120", "20", "60", "60", "60", "40",
    "0", "0", "60", "30", "60", "30",
    "60", "60", "210", "60", "60", "60", "40",
    "60", "60", "0", "60", "40", "60", "60", "60",
    "0", "0", "210", "80", "20", "60", "60",
    "60", "60", "80", "60", "80", "60",
    "60", "70", "70", "0", "0", "0", "80",
    "0", "0"
    };


    die ganzen max. Tank-Füllmengen aufgezählt,also für die 1. Modelid ist der Tank dann "60".. usw.


    Danach gebe ich einem Auto was mit CreateVehicle z.Bsp beim Autohaus erstellt wird,den Tank.


    mit
    new createdcar;
    createdcar = CreateVehicle(ahCars[id][model],.....);
    vTank[vid]=CarTanks[ahCars[id][model]-400];


    gebe ich dem grad erstelltem Auto den Tank,mit der Menge die ich im CarTanks hineingeschrieben habe.


    Aber wenn ich das denn Compile,steht dort einfach mal "must be assigned to an array".. nichts weiter.Er zeigt mir denn als Fehler einfach das letzte Zeichen in der
    vTank[vid]=CarTanks[ahCars[id][model]-400];
    Zeile an.


    Ich werd nicht schlau daraus xD


    Habt ihr ne Ahnung?

  • Warum den 2 Arrays einer reicht und vorallem warum als String die ganzen Zahlen ?
    Schau mal so sollte es passen:


    new CarTanks[] =
    {
    60, 60, 60, 80, 60, 60,
    80, 60, 60, 60, 60, 60,
    60, 60, 60, 60, 60, 80, 60,
    60, 60, 60, 60, 60, 60,
    80, 60, 60, 60, 60, 60, 60,
    80, 60, 60, 60, 60, 60, 60,
    60, 60, 20, 60, 60, 80, 60,
    60, 80, 30, 60, 60, 80, 60,
    60, 60, 80, 60, 30, 60, 60,
    80, 40, 30, 40, 20, 20, 60,
    60,40, 80, 60, 40, 60, 60,
    60, 60, 80, 60, 60, 60, 60, 0,
    60, 60, 60, 30, 60, 60, 60,
    60, 80, 60, 60, 60, 60, 60,
    60, 60, 60, 60, 60, 20,
    60, 60, 60, 80, 60,
    60, 60, 0, 0, 80, 80, 40,
    60, 60, 60, 60, 60, 80, 120,
    80, 80, 30, 80, 60, 60,
    60, 60, 60, 30, 50, 120, 60,
    60, 60, 60, 0, 0, 60, 60,
    120, 60, 60, 60, 60, 60, 60,
    80, 60, 60, 60, 60, 120, 60,
    60, 80, 80, 60, 60, 80, 60,
    60, 120, 20, 60, 60, 60, 40,
    0, 0, 60, 30, 60, 30,
    60, 60, 210, 60, 60, 60, 40,
    60, 60, 0, 60, 40, 60, 60, 60,
    0, 0, 210, 80, 20, 60, 60,
    60, 60, 80, 60, 80, 60,
    60, 70, 70, 0, 0, 0, 80,
    0, 0
    };