Alle Auto IDs

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 Com!


    Ich möchte alle AutoID's in einem enum speichern lassen.
    Habe es bis jetzt so:



    enum carID
    {
    400, 409, 415, 422, 434, 442, 459, 475, 482, 492,
    401, 410, 418, 423, 436, 444, 466, 477, 483, 494,
    402, 411, 419, 424, 438, 445, 467, 478, 489, 495,
    404, 413, 420, 426, 439, 451, 470, 479, 490, 496,
    405, 414, 421, 429, 440, 458, 474, 480, 491, 500,
    502, 503, 504, 505, 506, 507, 516, 517, 518, 525,
    526, 527, 528, 529, 532, 533, 534, 535, 536, 540,
    541, 542, 543, 545, 546, 547, 549, 550, 551, 552,
    554, 555, 556, 557, 558, 559, 560, 561, 562, 565,
    566, 567, 568, 575, 576, 579, 580, 582, 585, 587,
    589, 596, 597, 598, 599, 600, 601, 602, 603, 604,
    605
    }
    new carIDs[MAX_VEHICLES][carID];


    Doch ich bekomme ein Error: D:\Rockstar Games\gamemodes\LVRL.pwn(73) : error 001: expected token: "-identifier-", but found "-integer value-"


    Hilfe pls..

  • heyhooo ist doch sein Ding.
    mach mal hinter dem enum gleich ein {.
    Also enum{
    blablabla
    }


    weiß nicht ob ich recht habe aber ich kenns meißt so ;)

    "Imagine if the government went after corruption as hard as it goes after guys who run filesharing sites. Priorities. " - @Snowden
    "More worrying than FBI temporarily running a server that contained child porn, is hacking computers anywhere in the world with one warrant" - @josephfcox

  • Vielleicht ist es auch nur Quatsch was ich da mache.
    Der Primärgrund ist, weshalb ich das mache ist, weil ich Abfragen möchte ob er in einem Auto ist.
    So:



    if(sInfo[playerid][Autoschein] == 0)
    {
    if(GetPlayerVehicleSeat(playerid) == 0)
    {
    // blablabla
    }
    }


    Möchte abfragen ob der Spieler in ein Auto einsteigt.

  • nein ich glaub auch das das quatsch ist.
    Das wäre nämlich viel zu einfach.
    Frage mich aber auch wieso er dieses enum braucht ^^

    "Imagine if the government went after corruption as hard as it goes after guys who run filesharing sites. Priorities. " - @Snowden
    "More worrying than FBI temporarily running a server that contained child porn, is hacking computers anywhere in the world with one warrant" - @josephfcox

  • Die abfrage ob der spieler in ein auto steigt ist bei OnPlayerEnterVehicle (oderso heißt das :D )

    "Imagine if the government went after corruption as hard as it goes after guys who run filesharing sites. Priorities. " - @Snowden
    "More worrying than FBI temporarily running a server that contained child porn, is hacking computers anywhere in the world with one warrant" - @josephfcox

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • Das wird ja immer schlimmer. :thumbdown:


    Der Grund für den Fehler ist, dass in einem enum dürfen keine Zahlen stehen, dort müssen "Variablen" (Definitionen) stehen.
    Das kannst du so nicht machen.


    Wenn du abfragen willst, ob der Spieler in einem Auto mit einer der obigen IDs ist, musst du ein Array erstellen:
    new carIDs[] = {
    400, 409, 415, 422, 434, 442, 459, 475, 482, 492,
    401, 410, 418, 423, 436, 444, 466, 477, 483, 494,
    402, 411, 419, 424, 438, 445, 467, 478, 489, 495,
    404, 413, 420, 426, 439, 451, 470, 479, 490, 496,
    405, 414, 421, 429, 440, 458, 474, 480, 491, 500,
    502, 503, 504, 505, 506, 507, 516, 517, 518, 525,
    526, 527, 528, 529, 532, 533, 534, 535, 536, 540,
    541, 542, 543, 545, 546, 547, 549, 550, 551, 552,
    554, 555, 556, 557, 558, 559, 560, 561, 562, 565,
    566, 567, 568, 575, 576, 579, 580, 582, 585, 587,
    589, 596, 597, 598, 599, 600, 601, 602, 603, 604,
    605
    };


    Edit:
    Noch die Abfrage gratis dazu:
    stock IstInAuto(playerid)
    {
    new id = GetVehicleModel(GetPlayerVehicleID(playerid));
    for(new i = 0; i<sizeof(carIDs); i++) if(id == carIDs[i]) return 1;
    return 0;
    }



    Im Post unter mir:
    @NeonReflexe: Man lernt, indem man liest. Du lernst ja in der Schule auch, indem du zuhörst, und nicht indem der Lehrer dir zuhört. ;) (PS: Bester Song ever, Wise Guys :thumbup: ).

    3HZXdYd.png

    2 Mal editiert, zuletzt von Jeffry () aus folgendem Grund: Tippfehler

  • Hah ich wusste es aber mir ist das mit dem "=" nichtmehr eingefallen.
    Naja Jeffry die leute müssen lernen :D

    "Imagine if the government went after corruption as hard as it goes after guys who run filesharing sites. Priorities. " - @Snowden
    "More worrying than FBI temporarily running a server that contained child porn, is hacking computers anywhere in the world with one warrant" - @josephfcox


  • new AutoIDs[]=
    {
    400, 409, 415, 422, 434, 442, 459, 475, 482, 492,
    401, 410, 418, 423, 436, 444, 466, 477, 483, 494,
    402, 411, 419, 424, 438, 445, 467, 478, 489, 495,
    404, 413, 420, 426, 439, 451, 470, 479, 490, 496,
    405, 414, 421, 429, 440, 458, 474, 480, 491, 500,
    502, 503, 504, 505, 506, 507, 516, 517, 518, 525,
    526, 527, 528, 529, 532, 533, 534, 535, 536, 540,
    541, 542, 543, 545, 546, 547, 549, 550, 551, 552,
    554, 555, 556, 557, 558, 559, 560, 561, 562, 565,
    566, 567, 568, 575, 576, 579, 580, 582, 585, 587,
    589, 596, 597, 598, 599, 600, 601, 602, 603, 604,
    605
    };


    public OnPlayerStateChange(playerid,newstate,oldstate)
    {
    if(newstate==PLAYER_STATE_DRIVER)
    {
    new vehicleid=GetPlayerVehicleID(playerid);
    new model=GetVehicleModel(GetPlayerVehicleID(playerid));
    for(new i=0;i<sizeof(AutoIDs);i++)
    {
    if(model==AutoIDs[i])
    {
    SendClientMessage(playerid,-1,"Du bist in ein Auto eingestiegen.");
    break;
    }
    }
    }
    }