Beiträge von Jeffry

    ocmd:parken(playerid)
    {
    for(new i=0; i<sizeof(cInfo); i++)
    {
    if(cInfo[i][id_x]==0)continue;
    if(cInfo[i][besitzer]!=sInfo[playerid][db_id])continue;
    if(cInfo[i][id_x] != GetPlayerVehicleID(playerid)) continue;
    GetVehiclePos(cInfo[i][id_x],cInfo[i][c_x],cInfo[i][c_y],cInfo[i][c_z]);
    GetVehicleZAngle(cInfo[i][id_x],cInfo[i][c_r]);
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(cInfo[i][id_x],engine,lights,alarm,doors,bonnet,boot,objective);
    new query[256];
    format(query,sizeof(query),"UPDATE autos SET x='%f',y='%f',z='%f',r='%f',doors='%d' WHERE id='%i'",cInfo[i][c_x],cInfo[i][c_y],cInfo[i][c_z],cInfo[i][c_r],doors,cInfo[i][db_id]);
    mysql_function_query(dbhandle,query,false,"","");
    new string[144];
    format(string, sizeof(string), "Du hast soeben dein Fahrzeug (%s) geparkt!", GetVehicleFriendlyName(cInfo[i][id_x]));
    SendClientMessage(playerid,LEUCHTENDBLAU, string);
    }
    return 1;
    }

    #if defined FILTERSCRIPT
    und irgendwo drunter das
    #endif
    weg machen.


    Vielleicht steht da auch noch ein "#else", das machst auch weg, samt dem Zeug was zwischen dem else und dem endif steht.



    ODER du fügst unter die Include ein:
    #define FILTERSCRIPT 1

    public OnPlayerCarsLoad(playerid)
    {
    new num_fields,num_rows, doors;
    cache_get_data(num_rows,num_fields,dbhandle);
    if(!num_rows)return 1;
    for(new i=0; i<num_rows; i++)
    {
    new id=getFreeCarID();
    cInfo[id][model]=cache_get_field_content_int(i,"model",dbhandle);
    cInfo[id][besitzer]=cache_get_field_content_int(i,"besitzer",dbhandle);
    cInfo[id][c_x]=cache_get_field_content_float(i,"x",dbhandle);
    cInfo[id][c_y]=cache_get_field_content_float(i,"y",dbhandle);
    cInfo[id][c_z]=cache_get_field_content_float(i,"z",dbhandle);
    cInfo[id][c_r]=cache_get_field_content_float(i,"r",dbhandle);
    cInfo[id][db_id]=cache_get_field_content_int(i,"id",dbhandle);
    doors=cache_get_field_content_int(i,"doors",dbhandle);
    cInfo[id][id_x]=CreateVehicle(cInfo[id][model],cInfo[id][c_x],cInfo[id][c_y],cInfo[id][c_z],cInfo[id][c_r],-1,-1,-1);
    SetVehicleParamsEx(cInfo[id][id_x],0,0,0,doors,0,0,0);
    }
    return 1;
    }


    saveCarToDB(playerid,carid)
    {
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(cInfo[carid][id_x],engine,lights,alarm,doors,bonnet,boot,objective);
    new query[128];
    format(query,sizeof(query),"INSERT INTO autos (besitzer,model,x,y,z,r,doors) VALUES ('%i','%i','%f','%f','%f','%f','%d')",sInfo[playerid][db_id],cInfo[carid][model],cInfo[carid][c_x],cInfo[carid][c_y],cInfo[carid][c_z],cInfo[carid][c_r],doors);
    mysql_function_query(dbhandle,query,true,"carSavedToDB","i",carid);
    return 1;
    }


    Beachte, dass du die Spalte "doors" auch in der Datenbank erstellen musst.
    Außerdem fehlt noch immer der Teil, mit dem du ein Auto speicherst, aktualisierst (nicht hinzufügst!).

    ocmd:parken(playerid)
    {
    for(new i=0; i<sizeof(cInfo); i++)
    {
    if(cInfo[i][id_x]==0)continue;
    if(cInfo[i][besitzer]!=sInfo[playerid][db_id])continue;
    if(cInfo[i][id_x] != GetPlayerVehicleID(playerid)) continue;
    GetVehiclePos(cInfo[i][id_x],cInfo[i][c_x],cInfo[i][c_y],cInfo[i][c_z]);
    GetVehicleZAngle(cInfo[i][id_x],cInfo[i][c_r]);
    new query[256];
    format(query,sizeof(query),"UPDATE autos SET x='%f',y='%f',z='%f',r='%f' WHERE id='%i'",cInfo[i][c_x],cInfo[i][c_y],cInfo[i][c_z],cInfo[i][c_r],cInfo[i][db_id]);
    mysql_function_query(dbhandle,query,false,"","");
    new string[144];
    format(string, sizeof(string), "Du hast soeben dein Fahrzeug (%s) geparkt!", GetVehicleFriendlyName(cInfo[i][id_x]));
    SendClientMessage(playerid,BLAU, string);
    }
    return 1;
    }

    Bekommst du im Compiler eine Meldung mit relativ vielen Zahlen?
    Wenn ja, füge das mal unter die Includes ein:
    #pragma dynamic 100000
    (Den Wert bis dahin erhöhen, bis die Meldung weg ist.)



    Außerdem sprengst du bei z.B. OnPlayerStateChange ein Array der Größe 27 mit einem Wert 28. Schau mal welche Variable du mit [28] deklariert hast, und ändere das zu [29]. Ebenfalls bei den anderen "Array Index out of bounds".

    if(i == INVALID_PLAYER_ID)continue;


    Das macht so keinen Sinn und wird auch nicht funktionieren.


    So:
    stock GetPlayers()
    {
    new count = 0;
    for(new i=0, j=GetMaxPlayers(); i<j; i++)
    {
    if(!IsPlayerConnected(i)) continue;
    if(IsPlayerNPC(i)) continue;
    count++;
    }
    return count;
    }