Beiträge von Lιση

    Ok, ich teste es mal. Ich editiere dann den Beitrag.



    EDIT: Ich habe es probiert aber jetzt sind dort keine Objekte mehr?


    CreateObject(19447,1545.30004883,-1647.19995117,10.80000019,0.00000000,0.00000000,23.99963379);

    Hallo liebe Community,


    beim LSPD passiert das wenn man dort etwas gemappt hat, das dann der Boden bei weiterer Entfernung verschwindet. Und dann werden die LSPD Autos immer wo anders gespawnt. Hat da jemand eine Idee? (Wenn ich dazu Zeit finde, mache ich noch einen Screen)





    Mit freundlichen Grüßen,
    DexterA1



    Hab ich gemacht da kam "[15:51:04] 0 = 9?" raus. Aber er müsste die besitzerid ordnungsgemäß laden!



    Hier der Code wo er die Besitzerid lädt:
    public OnPlayerCarsLoad(playerid)
    {
    new num_fields,num_rows;
    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][vcolor1]=cache_get_field_content_int(i,"color1",dbhandle);
    cInfo[id][vcolor2]=cache_get_field_content_int(i,"color2",dbhandle);
    cInfo[id][tuning1]=cache_get_field_content_int(i,"tuning1",dbhandle);
    cInfo[id][tuning2]=cache_get_field_content_int(i,"tuning2",dbhandle);
    cInfo[id][tuning3]=cache_get_field_content_int(i,"tuning3",dbhandle);
    cInfo[id][tuning4]=cache_get_field_content_int(i,"tuning4",dbhandle);
    cInfo[id][tuning5]=cache_get_field_content_int(i,"tuning5",dbhandle);
    cInfo[id][tuning6]=cache_get_field_content_int(i,"tuning6",dbhandle);
    cInfo[id][tuning7]=cache_get_field_content_int(i,"tuning7",dbhandle);
    cInfo[id][tuning8]=cache_get_field_content_int(i,"tuning8",dbhandle);
    cInfo[id][tuning9]=cache_get_field_content_int(i,"tuning9",dbhandle);
    cInfo[id][tuning10]=cache_get_field_content_int(i,"tuning10",dbhandle);
    cInfo[id][tuning11]=cache_get_field_content_int(i,"tuning11",dbhandle);
    cInfo[id][tuning12]=cache_get_field_content_int(i,"tuning12",dbhandle);
    cInfo[id][tuning13]=cache_get_field_content_int(i,"tuning13",dbhandle);
    cInfo[id][tuning14]=cache_get_field_content_int(i,"tuning14",dbhandle);
    cInfo[id][lock]=cache_get_field_content_int(i,"lock",dbhandle);
    cInfo[id][db_id]=cache_get_field_content_int(i,"id",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],cInfo[id][vcolor1],cInfo[id][vcolor2],-1);
    AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning1]);
    AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning2]);
    AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning3]);
    AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning4]);
    AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning5]);
    AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning6]);
    AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning7]);
    AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning8]);
    AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning9]);
    AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning10]);
    AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning11]);
    AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning12]);
    AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning13]);
    AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning14]);
    if(cInfo[id][lock]==1)
    {
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(cInfo[id][id_x], engine, lights, alarm, doors, bonnet, boot, objective);
    SetVehicleParamsEx(cInfo[id][id_x], engine, lights, alarm, VEHICLE_PARAMS_ON, bonnet, boot, objective);
    //for(new x=0;x<GetMaxPlayers();x++)
    //{
    //SetVehicleParamsForPlayer(id,x,0,1);
    //}
    }
    }
    return 1;
    }


    loadPlayerCars(playerid)
    {
    new query[128];
    format(query,sizeof(query),"SELECT * FROM autos WHERE besitzer='%i'",sInfo[playerid][pid]);
    mysql_function_query(dbhandle,query,true,"OnPlayerCarsLoad","i",playerid);
    return 1;
    }





    Mit freundlichen Grüßen,
    DexterA1

    Seltsam ich habe es mal printen lassen in diesem Command:


    if(strcmp(cmd, "/ltest", true) == 0)
    {
    new vehicleid;
    if(IsPlayerInAnyVehicle(playerid))// Falls der Spieler in einem Fahrzeug sitzt
    {
    vehicleid = GetPlayerVehicleID(playerid);
    }
    if(cInfo[vehicleid][besitzer]==sInfo[playerid][pid])
    {
    print("sein Auto");
    }
    else
    {
    print("nicht sein Auto");
    }
    return 1;
    }



    und es kam "nicht sein Auto" raus. Obwohl alles stimmt! Hilfe bitte!


    Ich brauche immernoch Hilfe!

    Ich hab ja


    if(cInfo[vehicleid][besitzer]==sInfo[playerid][pid])


    reingepackt. Besitzer = die ID des Players in der Datenbank vom Besitzer und pid ist die id vom player in der Datenbank. Aber dann kommt immer das es mir nicht gehören würde. Aber es gehört mir.



    Also er müsste praktisch wenn ich die id 9 hätte und in der datenbank bei besitzer die id 9 steht es mir erlauben macht er aber nicht.




    Sorry, doof formuliert.

    pierre65:
    Ja in der Datenbank


    for(new i=0; i<sizeof(cInfo); i++)
    {
    if(cInfo[i][id_x]==0)continue;
    if(cInfo[i][besitzer]!=sInfo[playerid][pid])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]);
    GetVehicleColor(cInfo[i][id_x], cInfo[i][vcolor1], cInfo[i][vcolor2]);
    cInfo[i][tuning1]=GetVehicleComponentInSlot(cInfo[i][id_x], 0);
    cInfo[i][tuning2]=GetVehicleComponentInSlot(cInfo[i][id_x], 1);
    cInfo[i][tuning3]=GetVehicleComponentInSlot(cInfo[i][id_x], 2);
    cInfo[i][tuning4]=GetVehicleComponentInSlot(cInfo[i][id_x], 3);
    cInfo[i][tuning5]=GetVehicleComponentInSlot(cInfo[i][id_x], 4);
    cInfo[i][tuning6]=GetVehicleComponentInSlot(cInfo[i][id_x], 5);
    cInfo[i][tuning7]=GetVehicleComponentInSlot(cInfo[i][id_x], 6);
    cInfo[i][tuning8]=GetVehicleComponentInSlot(cInfo[i][id_x], 7);
    cInfo[i][tuning9]=GetVehicleComponentInSlot(cInfo[i][id_x], 8);
    cInfo[i][tuning10]=GetVehicleComponentInSlot(cInfo[i][id_x], 9);
    cInfo[i][tuning11]=GetVehicleComponentInSlot(cInfo[i][id_x], 10);
    cInfo[i][tuning12]=GetVehicleComponentInSlot(cInfo[i][id_x], 11);
    cInfo[i][tuning13]=GetVehicleComponentInSlot(cInfo[i][id_x], 12);
    cInfo[i][tuning14]=GetVehicleComponentInSlot(cInfo[i][id_x], 13);
    new query[256];
    format(query,sizeof(query),"UPDATE autos SET x='%f',y='%f',z='%f',r='%f',color1='%i',color2='%i',lock='%i' WHERE id='%i'",cInfo[i][c_x],cInfo[i][c_y],cInfo[i][c_z],cInfo[i][c_r],cInfo[i][vcolor1],cInfo[i][vcolor2],cInfo[i][lock],cInfo[i][db_id]);
    mysql_function_query(dbhandle,query,false,"","");
    format(query,sizeof(query),"UPDATE autos SET tuning1='%i',tuning2='%i',tuning3='%i',tuning4='%i',tuning5='%i',tuning6='%i',tuning7='%i' WHERE id='%i'",cInfo[i][tuning1],cInfo[i][tuning2],cInfo[i][tuning3],cInfo[i][tuning4],cInfo[i][tuning5],cInfo[i][tuning6],cInfo[i][tuning7],cInfo[i][db_id]);
    mysql_function_query(dbhandle,query,false,"","");
    format(query,sizeof(query),"UPDATE autos SET tuning8='%i',tuning9='%i',tuning10='%i',tuning11='%i',tuning12='%i',tuning13='%i',tuning14='%i' WHERE id='%i'",cInfo[i][tuning8],cInfo[i][tuning9],cInfo[i][tuning10],cInfo[i][tuning11],cInfo[i][tuning12],cInfo[i][tuning13],cInfo[i][tuning14],cInfo[i][db_id]);
    mysql_function_query(dbhandle,query,false,"","");
    DestroyVehicle(cInfo[i][id_x]);
    cInfo[i][id_x]=0;
    }



    _Advanced_:
    Danke für deine Hilfe. (ironisch gemeint)

    Hallo liebe Community,


    ich wolte den Command so machen das er abfragt ob der Spieler der Besitzer des Vehicles ist und es dann öffnet, aber es funktioniert nicht.



    Mein Code:
    if(strcmp(cmd, "/carlock", true) == 0)
    {
    new vehicleid;
    new engine, lights, alarm, doors, bonnet, boot, objective;
    if(IsPlayerInAnyVehicle(playerid))// Falls der Spieler in einem Fahrzeug sitzt
    {
    vehicleid = GetPlayerVehicleID(playerid);
    }
    else if(GetClosestVehicleToPlayer(playerid) != 0)// Falls ein Fahrzeug in der Nähe des Spielers ist
    {
    vehicleid = GetClosestVehicleToPlayer(playerid);
    }
    else return 1; // Ansonsten soll nichts passieren
    for(new i; i < MAX_VEHICLES; i++)
    {
    if(cInfo[vehicleid][besitzer]==sInfo[playerid][pid])
    {
    GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective); // Hier wird der Status der jeweiligen "Fahrzeug-Einstellungen" ausgelesen (Bsp: Ist das Fahrzeug offen oder zu?)
    if(cInfo[vehicleid][lock] == 1) // Falls die Türen zu sind...
    {
    SetVehicleParamsEx(vehicleid, engine, lights, alarm, VEHICLE_PARAMS_OFF, bonnet, boot, objective); // ... werden sie geöffnet (Der Parameter 'doors' wird auf 1 gesetzt
    GameTextForPlayer(playerid, "~w~Fahrzeug ~g~offen", 2000, 3);// Eine Meldung wird eingeblendet
    PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
    cInfo[vehicleid][lock] = 0;
    }
    else if(cInfo[vehicleid][lock] == 0) // Falls die Türen offen sind...
    {
    SetVehicleParamsEx(vehicleid, engine, lights, alarm, VEHICLE_PARAMS_ON, bonnet, boot, objective);// ... werden sie geschlossen
    GameTextForPlayer(playerid, "~w~Fahrzeug ~r~verschlossen", 2000, 3);// Eine Meldung wird eingeblendet
    PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
    cInfo[vehicleid][lock] = 1;
    }
    return 1;
    }
    else
    {
    SendClientMessage(playerid,Rot,"Dir gehört dieses Fahrzeug nicht!");
    }
    return 1;
    }
    return 1;
    }


    Im Script richtig eingerückt




    Mit freundlichen Grüßen,
    DexterA1

    Ja das tut er ich hab es jetzt so gemacht:


    if(cInfo[id][lock]==1)
    {
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(id, engine, lights, alarm, doors, bonnet, boot, objective);
    SetVehicleParamsEx(id, engine, lights, alarm, VEHICLE_PARAMS_ON, bonnet, boot, objective);
    SetVehicleParamsForPlayer(id,playerid,0,1);
    }

    Hallo liebe Community,


    ich habe wieder ein Problem, und zwar hab ich das so gemacht das wenn der Spieler disconnected, von seinem Auto gespeichert wird ob es verschlossen oder offen ist. Leider schließt er das Auto nicht wenn ich rein komme.



    Mein Code (zum Autos laden):
    public OnPlayerCarsLoad(playerid)
    {
    new num_fields,num_rows;
    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][vcolor1]=cache_get_field_content_int(i,"color1",dbhandle);
    cInfo[id][vcolor2]=cache_get_field_content_int(i,"color2",dbhandle);
    cInfo[id][tuning1]=cache_get_field_content_int(i,"tuning1",dbhandle);
    cInfo[id][tuning2]=cache_get_field_content_int(i,"tuning2",dbhandle);
    cInfo[id][tuning3]=cache_get_field_content_int(i,"tuning3",dbhandle);
    cInfo[id][tuning4]=cache_get_field_content_int(i,"tuning4",dbhandle);
    cInfo[id][tuning5]=cache_get_field_content_int(i,"tuning5",dbhandle);
    cInfo[id][tuning6]=cache_get_field_content_int(i,"tuning6",dbhandle);
    cInfo[id][tuning7]=cache_get_field_content_int(i,"tuning7",dbhandle);
    cInfo[id][tuning8]=cache_get_field_content_int(i,"tuning8",dbhandle);
    cInfo[id][tuning9]=cache_get_field_content_int(i,"tuning9",dbhandle);
    cInfo[id][tuning10]=cache_get_field_content_int(i,"tuning10",dbhandle);
    cInfo[id][tuning11]=cache_get_field_content_int(i,"tuning11",dbhandle);
    cInfo[id][tuning12]=cache_get_field_content_int(i,"tuning12",dbhandle);
    cInfo[id][tuning13]=cache_get_field_content_int(i,"tuning13",dbhandle);
    cInfo[id][tuning14]=cache_get_field_content_int(i,"tuning14",dbhandle);
    cInfo[id][lock]=cache_get_field_content_int(i,"lock",dbhandle);
    cInfo[id][db_id]=cache_get_field_content_int(i,"id",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],cInfo[id][vcolor1],cInfo[id][vcolor2],-1);
    AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning1]);
    AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning2]);
    AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning3]);
    AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning4]);
    AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning5]);
    AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning6]);
    AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning7]);
    AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning8]);
    AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning9]);
    AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning10]);
    AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning11]);
    AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning12]);
    AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning13]);
    AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning14]);
    if(cInfo[id][lock]==1)
    {
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(id, engine, lights, alarm, doors, bonnet, boot, objective);
    SetVehicleParamsEx(id, engine, lights, alarm, VEHICLE_PARAMS_ON, bonnet, boot, objective);
    }
    }
    return 1;
    }


    Im Script natürlich richtig eingrückt.




    Mit freundlichen Grüßen,
    DexterA1




    Sorry für die schlechte Formulierung

    Ich habe das in einem Enum:



    enum carEnum{
    id_x,
    model,
    besitzer,
    Float:c_x,
    Float:c_y,
    Float:c_z,
    Float:c_r,
    vcolor1,
    vcolor2,
    tuning1,
    tuning2,
    tuning3,
    tuning4,
    tuning5,
    tuning6,
    tuning7,
    tuning8,
    tuning9,
    tuning10,
    tuning11,
    tuning12,
    tuning13,
    tuning14,
    db_id
    }

    C:\Users\Hartmut\Documents\SAMP Server - MySQL\gamemodes\MCD2.pwn(3267) : error 017: undefined symbol "Dtc_PlayerHaveCar"
    C:\Users\Hartmut\Documents\SAMP Server - MySQL\gamemodes\MCD2.pwn(3267) : warning 215: expression has no effect
    C:\Users\Hartmut\Documents\SAMP Server - MySQL\gamemodes\MCD2.pwn(3267) : error 001: expected token: ";", but found "]"
    C:\Users\Hartmut\Documents\SAMP Server - MySQL\gamemodes\MCD2.pwn(3267) : error 029: invalid expression, assumed zero
    C:\Users\Hartmut\Documents\SAMP Server - MySQL\gamemodes\MCD2.pwn(3267) : fatal error 107: too many error messages on one line


    Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    4 Errors.