Autonamen beim Tacho anzeigen lassen

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 Leute,
    ich habe eine Frage
    Ich habe schon oft in Tachos von anderen Servern gesehen,dass zusätzlich noch der Vehicle Name, also
    wenn man z.B im Infernus sitzt, dort Infernus steht und sich die Autonamen halt immer ans Fahrzeug anpassen.
    Meine Frage ist jetzt wie mache ich so etwas am besten ?



    Danke im Voraus


    MFG

    Main: CPU: Intel Core i5-4440 @ 3,10 GHz | CPU-Cooling: Matterhorn -PURE- | RAM: 16GB Crucial Ballistix Sport DDR3-1600 DIMM CL9-9-9-24 |
    Motherboard: ASRock B85M Pro4 | GPU: Sapphire Radeon R9 390X Nitro 8GB GDDR5 |

    SSD: Samsung SSD 840 Evo 500GB | Power Supply: 550 Watt Corsair CS Series Modular 80+ Gold | Case: beQuiet! Silent Base 800


    As I walk through the valley of the shadow of death
    I take a look at my life and realize there's nothin' left.

  • new Fahrzeugname[][] = {
    "Landstalker",
    "Bravura",
    "Buffalo",
    "Linerunner",
    "Pereniel",
    "Sentinel",
    "Dumper",
    "Firetruck",
    "Trashmaster",
    "Stretch",
    "Manana",
    "Infernus",
    "Voodoo",
    "Pony",
    "Mule",
    "Cheetah",
    "Ambulance",
    "Leviathan",
    "Moonbeam",
    "Esperanto",
    "Taxi",
    "Washington",
    "Bobcat",
    "Mr Whoopee",
    "BF Injection",
    "Hunter",
    "Premier",
    "Enforcer",
    "Securicar",
    "Banshee",
    "Predator",
    "Bus",
    "Rhino",
    "Barracks",
    "Hotknife",
    "Trailer",
    "Previon",
    "Coach",
    "Cabbie",
    "Stallion",
    "Rumpo",
    "RC Bandit",
    "Romero",
    "Packer",
    "Monster Truck",
    "Admiral",
    "Squalo",
    "Seasparrow",
    "Pizzaboy",
    "Tram",
    "Trailer",
    "Turismo",
    "Speeder",
    "Reefer",
    "Tropic",
    "Flatbed",
    "Yankee",
    "Caddy",
    "Solair",
    "RC Van",
    "Skimmer",
    "PCJ-600",
    "Roller",
    "Freeway",
    "RC Baron",
    "RC Raider",
    "Glendale",
    "Oceanic",
    "Sanchez",
    "Sparrow",
    "Patriot",
    "Quad",
    "Coastguard",
    "Dinghy",
    "Hermes",
    "Sabre",
    "Rustler",
    "ZR-350",
    "Walton",
    "Regina",
    "Comet",
    "Fahrrad",
    "Burrito",
    "Camper",
    "Marquis",
    "Baggage",
    "Dozer",
    "Maverick",
    "News Chopper",
    "Rancher",
    "FBI Rancher",
    "Virgo",
    "Greenwood",
    "Jetmax",
    "Hotring",
    "Sandking",
    "Blista Compact",
    "Police Maverick",
    "Boxville",
    "Benson",
    "Mesa",
    "RC Goblin",
    "Hotring Racer",
    "Hotring Racer",
    "Bloodring Banger",
    "Rancher",
    "Super GT",
    "Elegant",
    "Journey",
    "Bike",
    "Bike",
    "Beagle",
    "Cropdust",
    "Stunt",
    "Tanker",
    "RoadTrain",
    "Nebula",
    "Majestic",
    "Buccaneer",
    "Shamal",
    "Hydra",
    "FCR-900",
    "NRG-500",
    "HPV1000",
    "Cement Truck",
    "Tow Truck",
    "Fortune",
    "Cadrona",
    "FBI Truck",
    "Willard",
    "Forklift",
    "Traktor",
    "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 Truck",
    "Monster Truck",
    "Uranus",
    "Jester",
    "Sultan",
    "Stratum",
    "Elegy",
    "Raindance",
    "RC Tiger",
    "Flash",
    "Tahoma",
    "Savanna",
    "Bandito",
    "Freight",
    "Trailer",
    "Kart",
    "Mower",
    "Duneride",
    "Sweeper",
    "Broadway",
    "Tornado",
    "AT-400",
    "DFT-30",
    "Huntley",
    "Stafford",
    "BF-400",
    "Newsvan",
    "Tug",
    "Trailer",
    "Emperor",
    "Wayfarer",
    "Euros",
    "Hotdog",
    "Club",
    "Trailer",
    "Trailer",
    "Andromada",
    "Dodo",
    "RC Cam",
    "Launch",
    "Polizeiwagen",
    "Polizeiwagen",
    "Polizeiwagen",
    "Cop Ranger",
    "Picador",
    "SWAT Van",
    "Alpha",
    "Phoenix",
    "Glendale",
    "Sadler",
    "Luggage Trailer",
    "Luggage Trailer",
    "Stair Trailer",
    "Boxville",
    "Farm Plow",
    "Utility Trailer"
    };


    Benutzung.


    Fahrzeugname[GetVehicleModel(GetPlayerVehicleID(playerid))-400]


    format(string,sizeof(string),"~b~Fahrzeug: ~y~%s",Fahrzeugname[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
    TextDrawSetString(Fahrzeug[playerid], string);
    TextDrawShowForPlayer(playerid, Fahrzeug[playerid]);

  • Gut erst einmal danke für deine Hilfe.
    Eine Frage: Wieso ziehst du dann 400 Ab?

    Main: CPU: Intel Core i5-4440 @ 3,10 GHz | CPU-Cooling: Matterhorn -PURE- | RAM: 16GB Crucial Ballistix Sport DDR3-1600 DIMM CL9-9-9-24 |
    Motherboard: ASRock B85M Pro4 | GPU: Sapphire Radeon R9 390X Nitro 8GB GDDR5 |

    SSD: Samsung SSD 840 Evo 500GB | Power Supply: 550 Watt Corsair CS Series Modular 80+ Gold | Case: beQuiet! Silent Base 800


    As I walk through the valley of the shadow of death
    I take a look at my life and realize there's nothin' left.

  • Weil die Vehicle Models bei 400 anfangen. Und das zweidimensionale Array bei 0.
    D.h. bei der Modelid 400-400 haste den Namen Landstalker von deinem Array.


    //edit:
    Genauer:
    Spieler sitzt im Landstalker, der hat die ID 1 und das Model 400 (http://wiki.sa-mp.com/wiki/Vehicles:All)
    Fahrzeugname[GetVehicleModel(GetPlayerVehicleID(playerid))-400]
    wird zu Fahrzeugname[GetVehicleModel(1)-400]
    wird zu Fahrzeugname[400-400]
    wird zu Fahrzeugname[0]
    wird zu "Landstalker"

  • Ah okay habe es verstanden.
    Ich danke dir .

    Main: CPU: Intel Core i5-4440 @ 3,10 GHz | CPU-Cooling: Matterhorn -PURE- | RAM: 16GB Crucial Ballistix Sport DDR3-1600 DIMM CL9-9-9-24 |
    Motherboard: ASRock B85M Pro4 | GPU: Sapphire Radeon R9 390X Nitro 8GB GDDR5 |

    SSD: Samsung SSD 840 Evo 500GB | Power Supply: 550 Watt Corsair CS Series Modular 80+ Gold | Case: beQuiet! Silent Base 800


    As I walk through the valley of the shadow of death
    I take a look at my life and realize there's nothin' left.