Eine Fraktion kann alle FCars fahren!

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 Zusammen,


    Neues Problem, bitte nach unten Scrollen!


    //Edit Problem bearbeitet, neues Problem

    Einmal editiert, zuletzt von Metin2 ()

  • Glaube das da keine Return rein darf, evtl.? weil das ist bisher das erste return unter OnPlayerStateChange, denke schon das es richtig ist, nur Fehlerhaft


    muss glaub ich immer vor der Anfrage noch ein if(newstate == PLAYER_STATE_DRIVER) immer davor setzen kann das sein? und die returns dann raus? wenn ja dann bitte ein beispiel, weil ich das noch nie gemacht habe mit der anfrage...^^


    [TVN]Phrasel das gitb es in meinem Script garnicht! ;I muss ich das erstellen, wenn ja wo? und wie heißst es genau?

  • Anderes Problem nun !!


    public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
    {
    new carid = GetPlayerVehicleID(playerid);
    {
    for(new v=0; v<MAX_VEHICLES; v++)
    {
    if(carid == PolizeiVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1) { return 1; }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    }
    return 1;
    }
    if(carid == FBIVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2) { return 1; }
    else
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    return 1;
    }
    if(carid == ArmyVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3) { return 1; }
    else
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    return 1;
    }
    if(carid == MedVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4) { return 1; }
    else
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    return 1;
    }
    if(carid == LCNVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5) { return 1; }
    else
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    return 1;
    }
    if(carid == YakuzaVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6) { return 1; }
    else
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    return 1;
    }
    if(carid == PraesiVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7) { return 1; }
    else
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    return 1;
    }
    if(carid == HitmanVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8) { return 1; }
    else
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    return 1;
    }
    if(carid == NewsVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9) { return 1; }
    else
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    return 1;
    }
    if(carid == FahrschulVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11) { return 1; }
    else
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    return 1;
    }
    if(carid == fastspeedVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12) { return 1; }
    else
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    return 1;
    }
    if(carid == fastspeedVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12) { return 1; }
    else
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    return 1;
    }
    if(carid == GroveVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13) { return 1; }
    else
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    return 1;
    }
    if(carid == BallasVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14) { return 1; }
    else
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    return 1;
    }
    if(carid == LSBCVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15) { return 1; }
    else
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    return 1;
    }
    if(carid == VagosVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16) { return 1; }
    else
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    return 1;
    }
    if(carid == AztecasVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17) { return 1; }
    else
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    return 1;
    }
    if(carid == BanditosVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 18 || PlayerInfo[playerid][pLeader] == 18) { return 1; }
    else
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    return 1;
    }
    if(carid == RSVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 19 || PlayerInfo[playerid][pLeader] == 19) { return 1; }
    else
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    return 1;
    }
    if(carid == TerrorVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 20 || PlayerInfo[playerid][pLeader] == 20) { return 1; }
    else
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    return 1;
    }
    if(carid == WheelVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 21 || PlayerInfo[playerid][pLeader] == 21) { return 1; }
    else
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    return 1;
    }
    if(carid == FeuerVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 22 || PlayerInfo[playerid][pLeader] == 22) { return 1; }
    else
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    return 1;
    }
    if(carid == RMVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 23 || PlayerInfo[playerid][pLeader] == 23) { return 1; }
    else
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    return 1;
    }
    if(carid == oAmtVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 24 || PlayerInfo[playerid][pLeader] == 24) { return 1; }
    else
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    return 1;
    }
    }
    }
    return 1;
    }


    Jetzt kann nur die Polizei mit allein Fraktion Fahrzeugen fahren, also die erste Fraktion?! Und Oamt kann nicht damit fahren, wieso das?! Bitte sehr um Hilfe...


    Gruß Metin2


    //EDIT weiterer Fehler

  • RemovePlayerForumVehicle gibt es garnicht? Außerdem ist das Problem das nur die Polizei mit jedem Fahrzeug fahren kann und sonst keiner...

  • RemovePlayerForumVehicle gibt es garnicht?


    Wiki wenn du es nicht verstehst.

    RTL - Das N steht für Niveau!
    MfG,
    StreetS


    Jegliche Freundesanfragen, die für mich keinen Sinn ergeben, werden professionell Ignoriert. (Gleiche mit Skype!)
    Wer es nicht kapiert wird in Breadfish & Skype blockiert.


    - Stolzer PAWN Scripter der Klasse Beherrscht

  • Ein return bricht immer noch einen Code ab, und gibt einen Wert wieder, versuche es ohne die ganzen returns.

  • Streets hatte mich verschrieben,


    ich meine


    RemovePlayerFromVehicle(playerid);

  • ich würde es unter OnPLayerState machen ist besser bei OnPlayerEnterVehicle wird er auch als beifahrer rausgeschmissen

    [tabmenu][tab='Angebote','http://cdn3.iconfinder.com/data/icons/glyph/227/Tag-48.png']

    + Die Preise liegen bei 5-100+€ Ablauf:
    + Entweder ihr addet mich in Skype (PN vorher Schreiben) oder Ihr schreibt eine PN an mich (Betreff - Euer Wunsch z.B. Filterscript)
    + So nun schreibt ihr mir was ihr alles in dem Script haben wollt ich werd euch dann sagen ob ich es hinbekomme.
    + Dann machen wir ein groben Preis aus. Ich werde das Script erstellen und es zusammen mit dem Kunden Testen.



    [tab='Kontakt','http://cdn3.iconfinder.com/data/icons/line/36/person_add-48.png']
    edmix23

    + Bitte beim Adden angeben wer ihr seit oder per PN bescheid sagen!
    [tab='Zahlungs Methoden','https://cdn3.iconfinder.com/data/icons/line/36/check_money-32.png']
    +Paypal!
    +Direkte Banküberweisung

  • Hab es nun unter Function OnPlayerStateChange, leider wenn ich nun in einen Wagen meiner Fraktion einsteig da kann ich nun auch damit Fahren, leider steht da du hast keine Schlüssel trotzdem kann ich damit Fahren, wenn ich nun in ein Wagen einem anderen Frak Car einsteige steht garnichts da und ich kann auch damit fahren, was ist das nur 8| Bitte um Hilfe, schon den ganzen Tag geht das nun nicht...


    Hinweis: es sind keine Frakcars wo spawnen, sondern die Cars kommen aus einer Datei, Fraktionsautohaus!


    Function OnPlayerStateChange(playerid, newstate, oldstate)
    {
    Belt[playerid] = 0;
    TextDrawShowForPlayer(playerid,TextForum);
    TextDrawShowForPlayer(playerid,ModeName);
    M_OnPlayerStateChange(playerid, newstate, oldstate);
    new string[256];


    if(newstate == PLAYER_STATE_DRIVER)
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Benutze die 'Rechte STRG' Taste um den Motor zu Starten, oder /motor | /radio und vergiss /anschnallen nicht!");
    }
    if(newstate == PLAYER_STATE_DRIVER)
    {
    new carid = GetPlayerVehicleID(playerid);
    {
    for(new v=0; v<MAX_VEHICLES; v++)
    {
    {
    if(carid == PolizeiVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    }
    }
    if(carid == FBIVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == ArmyVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == MedVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == LCNVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == YakuzaVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == PraesiVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == HitmanVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == NewsVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == FahrschulVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == fastspeedVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == fastspeedVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == GroveVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == BallasVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == LSBCVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == VagosVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == AztecasVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == BanditosVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 18 || PlayerInfo[playerid][pLeader] == 18)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == RSVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 19 || PlayerInfo[playerid][pLeader] == 19)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == TerrorVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 20 || PlayerInfo[playerid][pLeader] == 20)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == WheelVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 21 || PlayerInfo[playerid][pLeader] == 21)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == FeuerVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 22 || PlayerInfo[playerid][pLeader] == 22)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == RMVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 23 || PlayerInfo[playerid][pLeader] == 23)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == oAmtVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 24 || PlayerInfo[playerid][pLeader] == 24)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    }
    }
    }


    //Edit 2x Aktuelliersiren

    3 Mal editiert, zuletzt von Metin2 ()

  • Function OnPlayerStateChange(playerid, newstate, oldstate)
    {
    Belt[playerid] = 0;
    TextDrawShowForPlayer(playerid,TextForum);
    TextDrawShowForPlayer(playerid,ModeName);
    M_OnPlayerStateChange(playerid, newstate, oldstate);
    new string[256];


    if(newstate == PLAYER_STATE_DRIVER)
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Benutze die 'Rechte STRG' Taste um den Motor zu Starten, oder /motor | /radio und vergiss /anschnallen nicht!");
    }
    if(newstate == PLAYER_STATE_DRIVER)
    {
    new carid = GetPlayerVehicleID(playerid);
    {
    for(new v=0; v<MAX_VEHICLES; v++)
    {
    {
    if(carid == PolizeiVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    }
    }
    if(carid == FBIVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == ArmyVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == MedVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == LCNVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == YakuzaVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == PraesiVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == HitmanVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == NewsVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == FahrschulVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == fastspeedVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == fastspeedVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == GroveVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == BallasVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == LSBCVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == VagosVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == AztecasVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == BanditosVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 18 || PlayerInfo[playerid][pLeader] == 18)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == RSVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 19 || PlayerInfo[playerid][pLeader] == 19)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == TerrorVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 20 || PlayerInfo[playerid][pLeader] == 20)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == WheelVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 21 || PlayerInfo[playerid][pLeader] == 21)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == FeuerVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 22 || PlayerInfo[playerid][pLeader] == 22)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == RMVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 23 || PlayerInfo[playerid][pLeader] == 23)
    {
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(playerid,true);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    if(carid == oAmtVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 24 || PlayerInfo[playerid][pLeader] == 24)
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }
    }
    }
    }


    Schau oamtvehs an das sollte gehen

  • Das geht nicht, bitte weiterhin um Hilfe, was ist nur das Problem?!

  • versuch doch mal


    TogglePlayerControllable(playerid, 1);

  • Ok, ich habs nun weiter geschafft!


    if(carid == PolizeiVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }


    damit kann jede Fraktion nun fahren außer die Polizei, wie änder ich das nun so das nur die Polizei damit fahren kann und anderen Fraks nicht?

  • das müsste gehen guck mal


    if(carid == PolizeiVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)return 1;
    else{RemovePlayerFromVehicle(playerid);SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");}
    }
    }

  • Ich muss doch eigl nur:


    if(carid == PolizeiVehs[v])
    {
    if(!PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GRAD2, "Du hast keinen Schlüssel für dieses Auto.");
    }
    }


    so ein ! davor setzen oder?