Beiträge von Sam Cooper

    Der Fehler ist immer noch .. ;(



    enum carInfo
    {
    frakid,
    frakname[64],
    carid,
    Float:PosX,
    Float:PosY,
    Float:PosZ,
    Float:PosA,
    Farbe1,
    Farbe2,
    }
    new AutoInfo[MAX_VEHICLES][carInfo];


    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    for (new i=0; i< MAX_VEHICLES; i++)
    {
    if(newstate==PLAYER_STATE_DRIVER)
    {
    if(!strcmp(AutoInfo[i][frakname],"lspd",true))
    {
    if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1)
    {
    SendClientMessage(playerid,0xFF0000FF,"Du bist in der Fraktion");
    }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,0xFF0000FF,"Du bist nicht in der Fraktion");
    }
    }
    if(!strcmp(AutoInfo[i][frakname],"lcn",true))
    {
    if(PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pMember] == 5)
    {
    SendClientMessage(playerid,0xFF0000FF,"Du bist in der Fraktion");
    }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,0xFF0000FF,"Du bist nicht in der Fraktion");
    }
    }
    if(!strcmp(AutoInfo[i][frakname],"oamt",true))
    {
    if(PlayerInfo[playerid][pLeader] == 4 || PlayerInfo[playerid][pMember] == 4)
    {
    SendClientMessage(playerid,0xFF0000FF,"Du bist in der Fraktion");
    }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,0xFF0000FF,"Du bist nicht in der Fraktion");
    }
    }
    if(!strcmp(AutoInfo[i][frakname],"zivi",true))
    {
    if(PlayerInfo[playerid][pLeader] == 0 || PlayerInfo[playerid][pMember] == 0)
    {

    }
    else
    {


    }
    }
    }
    }
    return 1;
    }



    stock LoadAutosData()
    {
    for(new i;i<MAX_VEHICLES;i++)
    {
    new query[128],data[128],bedienung[40], carname[64];
    format(bedienung,sizeof(bedienung),"id='%i'",i);
    format(query,sizeof(query),"SELECT * FROM cardata WHERE %s", bedienung);//Die query
    mysql_query(query);
    mysql_store_result();
    if(mysql_num_rows())// Eine Abfrage zur Sicherheit
    {
    format(carname,sizeof(carname),"%s",AutoInfo[i][frakname]);
    mysql_fetch_field("FrakName",carname);
    AutoInfo[i][frakname]= carname;

    mysql_fetch_field("fn",data);
    AutoInfo[i][frakid]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("CarID",data);
    AutoInfo[i][carid]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("X",data);
    AutoInfo[i][PosX]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("Y",data);
    AutoInfo[i][PosY]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("Z",data);
    AutoInfo[i][PosZ]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("A",data);
    AutoInfo[i][PosA]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("Farbe1",data);
    AutoInfo[i][Farbe1]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("Farbe2",data);
    AutoInfo[i][Farbe2]=strval(data);
    strdel(data,0,100);
    }
    AutoInfo[i][frakname] = CreateVehicle(AutoInfo[i][carid],AutoInfo[i][PosX],AutoInfo[i][PosY],AutoInfo[i][PosZ],AutoInfo[i][PosA],AutoInfo[i][Farbe1],AutoInfo[i][Farbe2],-1);
    mysql_free_result();
    printf("%s",carname);
    }
    return printf("Autos wurden Geladen");
    }



    Server-Log:



    Loaded log file: "server_log.txt".
    ----------


    SA-MP Dedicated Server
    ----------------------
    v0.3c R2, (C)2005-2011 SA-MP Team


    [20:38:43]
    [20:38:43] Server Plugins
    [20:38:43] --------------
    [20:38:43] Loading plugin: mysql.so
    [20:38:43] SA:MP MySQL Plugin v2.1.1 Loaded.
    [20:38:43] [MySQL] Thread running. Threadsafe: Yes.
    [20:38:43] Loaded.
    [20:38:43] Loading plugin: sscanf.so
    [20:38:43]


    [20:38:43] ===============================


    [20:38:43] sscanf plugin loaded.


    [20:38:43] (c) 2009 Alex "Y_Less" Cole


    [20:38:43] ===============================


    [20:38:43] Loaded.
    [20:38:43] Loading plugin: streamer.so
    [20:38:43]


    *** Streamer Plugin v2.5.2 by Incognito loaded ***


    [20:38:43] Loaded.
    [20:38:43] Loaded 3 plugins.


    [20:38:43]
    [20:38:43] Filter Scripts
    [20:38:43] ---------------
    [20:38:43] Loading filter script 'base.amx'...
    [20:38:43]
    --Base FS loaded.


    [20:38:43] Loading filter script 'gl_actions.amx'...
    [20:38:43] Loading filter script 'gl_property.amx'...
    [20:38:43]
    -----------------------------------
    [20:38:43] Grand Larceny Property Filterscript
    [20:38:43] -----------------------------------


    [20:38:43] Loading filter script 'gl_realtime.amx'...
    [20:38:43] Loaded 4 filter scripts.


    [20:38:43] [MySQL] Connected (0) to 'root'@'127.0.0.1 via TCP/IP'.
    [20:38:43] [MySQL] Server Version 5.0.51a-24+lenny5.
    [20:38:43]
    [20:38:43] lspd
    [20:38:43] lspd
    [20:38:43] lcn
    [20:38:43] zivi
    [20:38:43]
    [20:38:43] Autos wurden Geladen
    [20:38:43] Could Not Read Interiors file ( properties/interiors.txt )
    [20:38:43] Reading File: blank
    [20:38:43] Reading File: properties/houses.txt
    [20:38:43] Reading File: properties/businesses.txt
    [20:38:43] Reading File: properties/banks.txt
    [20:38:43] Reading File: properties/police.txt
    [20:38:43]
    ----------------------------------
    [20:38:43] Blank Gamemode by your name here
    [20:38:43] ----------------------------------


    [20:38:43] Number of vehicle models: 2
    [20:39:51] Incoming connection: 91.64.74.154:61766
    [20:39:51] [join] [NCR]Ingo has joined the server (0:91.64.74.154)
    [20:40:19] [MySQL] Error (0): Failed to exeute query. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[NCR]Ingo' at line 1.
    [20:40:19] [MySQL] Error (0): Function: mysql_store_result called when no prior successful query executed. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[NCR]Ingo' at line 1.
    [20:40:19] [MySQL] Error (0): Function: mysql_num_rows called when no result stored. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[NCR]Ingo' at line 1.
    [20:40:19] Player [NCR]Ingo logged in
    [20:41:01] [part] [NCR]Ingo has left the server (0:1)





    MFG


    Ingo

    Ich hab das jetzt so gemacht nur jetzt kann ich in jedes fahrzeug einsteigen :(


    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    for (new i=0; i< MAX_VEHICLES; i++)
    {
    if(newstate==PLAYER_STATE_DRIVER)
    {
    if(!strcmp(AutoInfo[i][frakname],"lspd",true))
    {
    if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1)
    {
    SendClientMessage(playerid,0xFF0000FF,"Du bist in der Fraktion");
    return 1;
    }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,0xFF0000FF,"Du bist nicht in der Fraktion");
    return 1;
    }
    }
    if(!strcmp(AutoInfo[i][frakname],"lcn",true))
    {
    if(PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pMember] == 5)
    {
    SendClientMessage(playerid,0xFF0000FF,"Du bist in der Fraktion");
    return 1;
    }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,0xFF0000FF,"Du bist nicht in der Fraktion");
    return 1;
    }
    }
    if(!strcmp(AutoInfo[i][frakname],"oamt",true))
    {
    if(PlayerInfo[playerid][pLeader] == 4 || PlayerInfo[playerid][pMember] == 4)
    {
    SendClientMessage(playerid,0xFF0000FF,"Du bist in der Fraktion");
    return 1;
    }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,0xFF0000FF,"Du bist nicht in der Fraktion");
    return 1;
    }
    }
    if(!strcmp(AutoInfo[i][frakname],"zivi",true))
    {
    if(PlayerInfo[playerid][pLeader] == 0 || PlayerInfo[playerid][pMember] == 0)
    {
    return 1;
    }
    else
    {
    return 1;
    }
    }
    }
    }
    return 1;
    }




    stock LoadAutosData()
    {
    for(new i;i<MAX_VEHICLES;i++)
    {
    new query[128],data[128],bedienung[40], carname[64];
    format(bedienung,sizeof(bedienung),"id='%i'",i);
    format(query,sizeof(query),"SELECT * FROM cardata WHERE %s", bedienung);//Die query
    mysql_query(query);
    mysql_store_result();
    if(mysql_num_rows())// Eine Abfrage zur Sicherheit
    {
    format(carname,sizeof(carname),"%s",AutoInfo[i][frakname]);
    mysql_fetch_field("FrakName",carname);
    AutoInfo[i][frakname]= carname;

    mysql_fetch_field("fn",data);
    AutoInfo[i][frakid]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("CarID",data);
    AutoInfo[i][carid]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("X",data);
    AutoInfo[i][PosX]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("Y",data);
    AutoInfo[i][PosY]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("Z",data);
    AutoInfo[i][PosZ]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("A",data);
    AutoInfo[i][PosA]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("Farbe1",data);
    AutoInfo[i][Farbe1]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("Farbe2",data);
    AutoInfo[i][Farbe2]=strval(data);
    strdel(data,0,100);
    }
    AutoInfo[i][frakname] = CreateVehicle(AutoInfo[i][carid],AutoInfo[i][PosX],AutoInfo[i][PosY],AutoInfo[i][PosZ],AutoInfo[i][PosA],AutoInfo[i][Farbe1],AutoInfo[i][Farbe2],-1);
    mysql_free_result();
    printf("%s",carname);
    }
    return printf("Autos wurden Geladen");
    }




    Weiß Keiner Eine Richtige Lösung ????????



    MFG


    Ingo

    Danke für deine Antwort nur ich werde aus jedem Auto Raus geworfen mit dem grund (Du bist nicht in der Fraktion !)


    enum carInfo
    {
    frakid,
    carid,
    Float:PosX,
    Float:PosY,
    Float:PosZ,
    Float:PosA,
    Farbe1,
    Farbe2,
    }
    new AutoInfo[MAX_VEHICLES][carInfo];




    public OnGameModeInit()
    {
    LoadAutosData();
    for(new i;i<MAX_VEHICLES;i++)
    {
    AutoInfo[i][frakid] = CreateVehicle(AutoInfo[i][carid],AutoInfo[i][PosX],AutoInfo[i][PosY],AutoInfo[i][PosZ],AutoInfo[i][PosA],AutoInfo[i][Farbe1],AutoInfo[i][Farbe2],-1);
    }
    return 1;
    }



    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    for (new i=0; i< MAX_VEHICLES; i++)
    {
    if(newstate==PLAYER_STATE_DRIVER)
    {
    if(PlayerInfo[playerid][pLeader] == AutoInfo[i][frakid] || PlayerInfo[playerid][pMember] == AutoInfo[i][frakid])
    {
    SendClientMessage(playerid,0xFF0000FF,"Du bist in der Fraktion");
    return 1;
    }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,0xFF0000FF,"Du bist nicht in der Fraktion");
    return 1;
    }
    }
    }
    return 1;
    }



    stock LoadAutosData()
    {
    for(new i;i<MAX_VEHICLES;i++)
    {
    new query[128],data[128],bedienung[40];
    format(bedienung,sizeof(bedienung),"id='%i'",i);
    format(query,sizeof(query),"SELECT * FROM cardata WHERE %s", bedienung);//Die query
    mysql_query(query);
    mysql_store_result();
    if(mysql_num_rows())// Eine Abfrage zur Sicherheit
    {
    mysql_fetch_field("fn",data);
    AutoInfo[i][frakid]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("CarID",data);
    AutoInfo[i][carid]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("X",data);
    AutoInfo[i][PosX]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("Y",data);
    AutoInfo[i][PosY]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("Z",data);
    AutoInfo[i][PosZ]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("A",data);
    AutoInfo[i][PosA]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("Farbe1",data);
    AutoInfo[i][Farbe1]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("Farbe2",data);
    AutoInfo[i][Farbe2]=strval(data);
    strdel(data,0,100);
    }
    mysql_free_result();
    }
    return printf("Autos wurden Geladen");
    }


    Ich Hoffe mir kan jetzt einer helfen ich hab einfach maol das Ganze system gepostet von auto system :(



    MYSQL:




    //Edit Bild Hinzugefügt

    Da kommen Fehler .



    D:\pawno\2411.pwn(337) : error 033: array must be indexed (variable "AutoInfo")
    D:\pawno\2411.pwn(341) : error 033: array must be indexed (variable "AutoInfo")



    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    for (new i=0; i< MAX_VEHICLES; i++)
    {
    if(i == AutoInfo[frakid])
    {
    if(newstate==PLAYER_STATE_DRIVER)
    {
    if(PlayerInfo[playerid][pLeader] == AutoInfo[frakid] || PlayerInfo[playerid][pMember] == AutoInfo[frakid])
    {
    SendClientMessage(playerid,0xFF0000FF,"Du bist in der Fraktion");
    return 1;
    }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,0xFF0000FF,"Du bist nicht in der Fraktion");
    return 1;
    }
    }
    }
    }
    return 1;
    }

    Werde ich mal testen Antwort Folgt:


    So Jetzt gibt es ein Anderes Problem ich kann in jedes Fahrzeug ein steige und wen ich aussteige kommt(Du bist nicht in der Fraktion);



    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    for (new i=0; i< MAX_VEHICLES; i++)
    {
    if(i == AutoInfo[i][frakid])
    {
    if(newstate==PLAYER_STATE_DRIVER)
    {
    if(PlayerInfo[playerid][pLeader] == AutoInfo[i][frakid] || PlayerInfo[playerid][pMember] == AutoInfo[i][frakid])
    {
    SendClientMessage(playerid,0xFF0000FF,"Du bist in der Fraktion");
    return 1;
    }
    }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,0xFF0000FF,"Du bist nicht in der Fraktion");
    return 1;
    }
    }
    }
    return 1;
    }


    //edit Antwort

    Hallo mein Lieben Leute,


    Ich hab eine abfrage gemacht aber wen ich in gam bin dan kann nur die fraktion mit der nummer 1 Alle autos fahren und die anderen keine warum ?



    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    for (new i=0; i< MAX_VEHICLES; i++)
    {
    if(newstate==PLAYER_STATE_DRIVER)
    {
    if(AutoInfo[i][frakid] != 1)
    {
    if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1)
    {
    SendClientMessage(playerid,ROT,"Du bist in der Fraktion !");
    return 1;
    }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,ROT,"Du bist nicht in der Fraktion !");
    return 1;
    }
    }
    }
    if(newstate==PLAYER_STATE_DRIVER)
    {
    if(AutoInfo[i][frakid] != 5)
    {
    if(PlayerInfo[playerid][pLeader] != 5 || PlayerInfo[playerid][pMember] != 5)
    {
    SendClientMessage(playerid,ROT,"Du bist in der Fraktion !");
    return 1;
    }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,ROT,"Du bist nicht in der Fraktion !");
    return 1;
    }
    }
    }
    if(newstate==PLAYER_STATE_DRIVER)
    {
    if(AutoInfo[i][frakid] != 0)
    {
    if(PlayerInfo[playerid][pLeader] == 0 || PlayerInfo[playerid][pMember] == 0)
    {
    return 1;
    }
    }
    }
    }
    return 1;
    }



    Hier die Mysql-Abfrage



    stock LoadAutosData()
    {
    for(new i;i<MAX_VEHICLES;i++)
    {
    new query[128],data[128],bedienung[40];
    format(bedienung,sizeof(bedienung),"id='%i'",i);
    format(query,sizeof(query),"SELECT * FROM cardata WHERE %s", bedienung);//Die query
    mysql_query(query);
    mysql_store_result();
    if(mysql_num_rows())// Eine Abfrage zur Sicherheit
    {
    mysql_fetch_field("Fraknummer",data);
    AutoInfo[i][frakid]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("CarID",data);
    AutoInfo[i][carid]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("X",data);
    AutoInfo[i][PosX]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("Y",data);
    AutoInfo[i][PosY]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("Z",data);
    AutoInfo[i][PosZ]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("A",data);
    AutoInfo[i][PosA]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("Farbe1",data);
    AutoInfo[i][Farbe1]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("Farbe2",data);
    AutoInfo[i][Farbe2]=strval(data);
    strdel(data,0,100);
    }
    mysql_free_result();
    }
    return printf("Autos wurden Geladen");
    }



    public OnGameModeInit()
    {
    for(new i;i<MAX_VEHICLES;i++)
    {
    AutoInfo[i][frakid] = CreateVehicle(AutoInfo[i][carid],AutoInfo[i][PosX],AutoInfo[i][PosY],AutoInfo[i][PosZ],AutoInfo[i][PosA],AutoInfo[i][Farbe1],AutoInfo[i][Farbe2],-1);
    }
    return 1;
    }


    Bitte um Hilfe


    MFG
    Ingo


    //Edit Titel bearbeitet

    Wenn ich eine Abfrage mache das das auto nur für die fraktion ist kan man die anderen auch nur für eine fahren warum ??
    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    for (new i=0; i< MAX_VEHICLES; i++)
    {
    if(newstate==PLAYER_STATE_DRIVER)
    {
    if(AutoInfo[i][frakid] == 1)
    {
    if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1)
    {
    SendClientMessage(playerid,ROT,"Du bist in der Fraktion !");
    return 1;
    }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,ROT,"Du bist nicht in der Fraktion !");
    return 1;
    }
    }
    }
    if(newstate==PLAYER_STATE_DRIVER)
    {
    if(AutoInfo[i][frakid] == 5)
    {
    if(PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pMember] == 5)
    {
    SendClientMessage(playerid,ROT,"Du bist in der Fraktion !");
    return 1;
    }
    else
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,ROT,"Du bist nicht in der Fraktion !");
    return 1;
    }
    }
    }
    if(newstate==PLAYER_STATE_DRIVER)
    {
    if(AutoInfo[i][frakid] == 0)
    {
    if(PlayerInfo[playerid][pLeader] == 0 || PlayerInfo[playerid][pMember] == 0)
    {
    return 1;
    }
    }
    }
    }
    return 1;
    }
    stock LoadAutosData()
    {
    for(new i;i<MAX_VEHICLES;i++)
    {
    new query[128],data[128],bedienung[40];
    format(bedienung,sizeof(bedienung),"id='%i'",i);
    format(query,sizeof(query),"SELECT * FROM cardata WHERE %s", bedienung);//Die query
    mysql_query(query);
    mysql_store_result();
    if(mysql_num_rows())// Eine Abfrage zur Sicherheit
    {
    mysql_fetch_field("Fraknummer",data);
    AutoInfo[i][frakid]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("CarID",data);
    AutoInfo[i][carid]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("X",data);
    AutoInfo[i][PosX]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("Y",data);
    AutoInfo[i][PosY]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("Z",data);
    AutoInfo[i][PosZ]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("A",data);
    AutoInfo[i][PosA]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("Farbe1",data);
    AutoInfo[i][Farbe1]=strval(data);
    strdel(data,0,100);

    mysql_fetch_field("Farbe2",data);
    AutoInfo[i][Farbe2]=strval(data);
    strdel(data,0,100);
    }
    mysql_free_result();
    }
    return printf("Autos wurden Geladen");
    }

    Hallo Liebe Community,


    ich habe ein Problem aus meiner daten bank werden ja fahrzeuge geladen .


    nur wen ich die so machen will das die nur für eine fraktion fahr bar ist geht es nicht man kann als Zivi ein steigen und kan fahren -.-


    kann man mir da helfen ???



    enum carInfo
    {
    frakid,
    carid,
    Float:PosX,
    Float:PosY,
    Float:PosZ,
    Float:PosA,
    Farbe1,
    Farbe2,
    }
    new AutoInfo[MAX_VEHICLES][carInfo];


    Uner OnGameModeInit:
    for(new i;i<MAX_VEHICLES;i++)
    {
    AutoInfo[i][frakid] = CreateVehicle(AutoInfo[i][carid],AutoInfo[i][PosX],AutoInfo[i][PosY],AutoInfo[i][PosZ],AutoInfo[i][PosA],AutoInfo[i][Farbe1],AutoInfo[i][Farbe2],-1);
    }

    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    for(new i;i<MAX_VEHICLES;i++)
    {
    if(newstate==PLAYER_STATE_DRIVER)
    {
    //new Vehicle = GetPlayerVehicleID(playerid);
    if(AutoInfo[i][frakid] == PolizeiAuto)
    {
    if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1)
    {
    RemovePlayerFromVehicle(playerid);
    SendClientMessage(playerid,ROT,"Du bist nicht in der Fraktion !");
    }
    else
    {


    }
    }
    }
    }
    return 1;
    }

    stock LoadAutosData()
    {
    for(new i;i<MAX_VEHICLES;i++)
    {
    new query[128],data[128],bedienung[40];
    format(bedienung,sizeof(bedienung),"id='%i'",i);
    format(query,sizeof(query),"SELECT * FROM cardata WHERE %s", bedienung);//Die query
    mysql_query(query);
    mysql_store_result();
    if(mysql_num_rows())// Eine Abfrage zur Sicherheit
    {
    mysql_fetch_field("FrakName",data);
    AutoInfo[i][frakid]=strval(data);

    mysql_fetch_field("CarID",data);
    AutoInfo[i][carid]=strval(data);

    mysql_fetch_field("X",data);
    AutoInfo[i][PosX]=strval(data);

    mysql_fetch_field("Y",data);
    AutoInfo[i][PosY]=strval(data);

    mysql_fetch_field("Z",data);
    AutoInfo[i][PosZ]=strval(data);

    mysql_fetch_field("A",data);
    AutoInfo[i][PosA]=strval(data);

    mysql_fetch_field("Farbe1",data);
    AutoInfo[i][Farbe1]=strval(data);

    mysql_fetch_field("Farbe2",data);
    AutoInfo[i][Farbe2]=strval(data);
    }
    mysql_free_result();
    }
    return printf("Autos wurden Geladen");
    }


    //Edit1: Title Bearbeite
    //Edit2: //Edit1 Vergessen