Fraktionsfahrzeug Problem

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,
    ich habe das Problem das wenn man nicht in der Fraktion ist das man nicht aus dem Fahrzeug geworfen wird.
    Ich hoffe Ihr könnt Helfen!


    Function IsAnFracCar(playerid)
    {
    new carid = GetPlayerVehicleID(playerid);
    if(IsPlayerConnected(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
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GRAD2, "d");
    }
    }


    lg :thumbup:

  • Dann wird diese Function aufgerufen:


    Function IsAnFracCar(playerid)
    {
    new carid = GetPlayerVehicleID(playerid);
    if(IsPlayerConnected(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
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GRAD2, "d");
    return 1;
    }
    }
    else if(carid == FBIVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2) { return 1; }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GRAD2, "d");
    return 1;
    }
    }
    if(carid == ArmyVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3) { return 1; }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GRAD2, "d");
    return 1;
    }
    }
    if(carid == MedVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4) { return 1; }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GRAD2, "d");
    return 1;
    }
    }
    if(carid == LCNVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5) { return 1; }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GRAD2, "d");
    return 1;
    }
    }
    if(carid == YakuzaVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6) { return 1; }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GRAD2, "d");
    return 1;
    }
    }
    if(carid == PraesiVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7) { return 1; }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GRAD2, "d");
    return 1;
    }
    }
    if(carid == HitmanVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 8 || PlayerInfo[playerid][pLeader] == 8) { return 1; }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GRAD2, "d");
    return 1;
    }
    }
    if(carid == NewsVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9) { return 1; }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GRAD2, "d");
    return 1;
    }
    }
    if(carid == FahrschulVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11) { return 1; }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GRAD2, "d");
    return 1;
    }
    }
    if(carid == fastspeedVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12) { return 1; }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GRAD2, "d");
    return 1;
    }
    }
    if(carid == fastspeedVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12) { return 1; }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GRAD2, "d");
    return 1;
    }
    }
    if(carid == GroveVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13) { return 1; }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GRAD2, "d");
    return 1;
    }
    }
    if(carid == BallasVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14) { return 1; }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GRAD2, "d");
    return 1;
    }
    }
    if(carid == LSBCVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15) { return 1; }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GRAD2, "d");
    return 1;
    }
    }
    if(carid == VagosVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16) { return 1; }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GRAD2, "d");
    return 1;
    }
    }
    if(carid == AztecasVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17) { return 1; }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GRAD2, "d");
    return 1;
    }
    }
    if(carid == BanditosVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 18 || PlayerInfo[playerid][pLeader] == 18) { return 1; }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GRAD2, "d");
    return 1;
    }
    }
    if(carid == RSVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 19 || PlayerInfo[playerid][pLeader] == 19) { return 1; }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GRAD2, "d");
    return 1;
    }
    }
    if(carid == TerrorVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 20 || PlayerInfo[playerid][pLeader] == 20) { return 1; }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GRAD2, "d");
    return 1;
    }
    }
    if(carid == WheelVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 21 || PlayerInfo[playerid][pLeader] == 21) { return 1; }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GRAD2, "d");
    return 1;
    }
    }
    if(carid == FeuerVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 22 || PlayerInfo[playerid][pLeader] == 22) { return 1; }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GRAD2, "d");
    return 1;
    }
    }
    if(carid == RMVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 23 || PlayerInfo[playerid][pLeader] == 23) { return 1; }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GRAD2, "d");
    return 1;
    }
    }
    if(carid == oAmtVehs[v])
    {
    if(PlayerInfo[playerid][pMember] == 24 || PlayerInfo[playerid][pLeader] == 24) { return 1; }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid, COLOR_GRAD2, "d");
    return 1;
    }
    }
    }
    }
    return 1;
    }

  • Ist ja nicht so, als hätte ich dir das damals nicht erklärt ^^


    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    if(newstate&PLAYER_STATE_DRIVER)
    {
    if(!GetPlayerVehicleSeat(playerid)){
    new carID = GetPlayerVehicleID(playerid);
    for(new i=0; i<sizeof(carvar); i++){
    if(carID == PolizeiVehs[i]){
    if(frakvar != frakid_cop){
    SendClientMessage(playerid, -1, "du bist kein cop");
    return RemovePlayerFromVehicle(playerid);
    }
    }
    }
    }
    }
    return 1;
    }


    Pass das mal auf dein Script an.


    mfg :thumbup:

  • Jo ich weiß nur ich es ging halt mal ohne den Public..