Error mit mein Tacho

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
  • Hallo Breadfish,
    ich habe ein Error mit mein Tacho finde den Fehler aber nicht.


    format(string, 50,"~g~Fahrzeug: ~w~%s~n~~g~Tank: ~w~%d(%s)~n~~g~Km/h: ~w~%d~n~~g~Zustant: ~w~%d", CarName[GetVehicleModel(veh-400], Tank[veh], GetPlayerVehicleType(veh2), floatround(Geschwindigkeit), GetVehicleHealth(veh, health));
    error 001: expected token: ",", but found "]"

    Mit freundlichen Grüßen,
    Chriss aka. xDesertx

  • public UpdateTacho() //Tacho Public
    {
    for(new i = 0;i<MAX_PLAYERS;i++)
    {
    if(IsPlayerConnected(i) && GetPlayerState(i) == PLAYER_STATE_DRIVER && !IsPlayerNPC(i))
    {
    new veh = GetPlayerVehicleID(i);
    new veh2 = GetVehicleModel(veh);
    new float:health;
    new Float:Strecke,Float:Geschwindigkeit;
    GetVehiclePos(GetPlayerVehicleID(i),X1[i],Y1[i],Z1[i]);
    Strecke = floatsqroot(floatpower(floatabs(floatsub(X1[i],X2[i])),2)+floatpower(floatabs(floatsub(Y1[i],Y2[i])),2)+floatpower(floatabs(floatsub(Z1[i],Z2[i])),2));
    Geschwindigkeit = (Strecke / (TACHOTIMER /1000)) * 3.6;
    new string[124];
    format(string, 124,"~g~Fahrzeug: ~w~%s~n~~g~Tank: ~w~%d(%s)~n~~g~Km/h: ~w~%d~n~~g~Zustant: ~w~%d", CarName[GetVehicleModel(veh-400)], Tank[veh], GetPlayerVehicleType(veh2), floatround(Geschwindigkeit), GetVehicleHealth(veh, health));//Feher Zeile
    TextDrawSetString(Textdraw3[i],string);
    GetVehiclePos(GetPlayerVehicleID(i),X2[i],Y2[i],Z2[i]);
    TextDrawShowForPlayer(i,Textdraw3[i]);
    }
    else
    {
    TextDrawHideForPlayer(i,Textdraw3[i]);
    }
    }
    return 1;
    }
    Habe Warnung "Tag mismatch" (Zeile mit // makiert)

    Mit freundlichen Grüßen,
    Chriss aka. xDesertx

  • Mehr fehler
    vielleich Hilft das:
    new CarName[][] =
    {
    "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel",
    "Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus",
    "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam",
    "Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BF Injection",
    "Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus",
    "Rhino", "Barracks", "Hotknife", "Trailer", "Previon", "Coach", "Cabbie",
    "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral",
    "Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer", "Turismo", "Speeder",
    "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair", "Berkley's RC Van",
    "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale",
    "Oceanic","Sanchez", "Sparrow", "Patriot", "Quad", "Coastguard", "Dinghy",
    "Hermes", "Sabre", "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX",
    "Burrito", "Camper", "Marquis", "Baggage", "Dozer", "Maverick", "News Chopper",
    "Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring", "Sandking",
    "Blista Compact", "Police Maverick", "Boxvillde", "Benson", "Mesa", "RC Goblin",
    "Hotring Racer A", "Hotring Racer B", "Bloodring Banger", "Rancher", "Super GT",
    "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster", "Stunt",
    "Tanker", "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra",
    "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck", "Fortune",
    "Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer",
    "Remington", "Slamvan", "Blade", "Freight", "Streak", "Vortex", "Vincent",
    "Bullet", "Clover", "Sadler", "Firetruck", "Hustler", "Intruder", "Primo",
    "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite",
    "Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratium",
    "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito",
    "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper",
    "Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400",
    "News Van", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club",
    "Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car",
    "Police Car", "Police Car", "Police Ranger", "Picador", "S.W.A.T", "Alpha",
    "Phoenix", "Glendale", "Sadler", "Luggage", "Luggage", "Stairs", "Boxville",
    "Tiller", "Utility Trailer"
    };

    Mit freundlichen Grüßen,
    Chriss aka. xDesertx