Beiträge von timm462f

    Hey kann mir jemand sagen wo ich einen Fehler habe?




    public OnPlayerCarsLoad(playerid)
    {
    new num_rows;
    if(!num_rows)return 1;
    for(new i=0; i<num_rows; i++)
    {
    new id=getFreeCarID();
    cInfo[id][carmodel] = mysql_GetIntByInt("Autos","model","besitzer",PlayerInfo[playerid][pMySQLID]);
    cInfo[id][besitzer] = mysql_GetIntByInt("Autos","besitzer","besitzer",PlayerInfo[playerid][pMySQLID]);
    cInfo[id][c_x] = mysql_GetFloatByInt("Autos","x","besitzer",PlayerInfo[playerid][pMySQLID]);
    cInfo[id][c_y] = mysql_GetFloatByInt("Autos","y","besitzer",PlayerInfo[playerid][pMySQLID]);
    cInfo[id][c_z] = mysql_GetFloatByInt("Autos","z","besitzer",PlayerInfo[playerid][pMySQLID]);
    cInfo[id][c_r] = mysql_GetFloatByInt("Autos","r","besitzer",PlayerInfo[playerid][pMySQLID]);
    cInfo[id][db_id] = mysql_GetIntByInt("Autos","id","besitzer",PlayerInfo[playerid][pMySQLID]);
    cInfo[id][id_x]=CreateVehicle(cInfo[id][carmodel],cInfo[id][c_x],cInfo[id][c_y],cInfo[id][c_z],cInfo[id][c_r],-1,-1,-1);
    }
    return 1;
    }



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


    Sie werden gespeichert aber nicht aus der DB geladen

    Hey


    Kann mir jemand sagen wie ich die nummernschilder in der Datenbank speichern kann?




    enum carEnum{
    id_x,
    carmodel,
    besitzer,
    Float:c_x,
    Float:c_y,
    Float:c_z,
    Float:c_r,
    db_id,
    kennzeichen
    };



    saveCarToDB(playerid,carid)
    {
    new query[128];
    format(query,sizeof(query),"INSERT INTO autos (besitzer,model,x,y,z,r) VALUES ('%i','%i','%f','%f','%f','%f','%s')",PlayerInfo[playerid][pMySQLID],cInfo[carid][carmodel],cInfo[carid][c_x],cInfo[carid][c_y],cInfo[carid][c_z],cInfo[carid][c_r]);
    mysql_query(query);
    return 1;
    }



    createPlayerCar(playerid,modelid,Float:x,Float:y,Float:z,Float:r)
    {
    for(new i=0; i<sizeof(cInfo); i++)
    {
    if(cInfo[i][id_x]!=0)continue;
    cInfo[i][besitzer]=PlayerInfo[playerid][pMySQLID];
    cInfo[i][c_x]=x;
    cInfo[i][c_y]=y;
    cInfo[i][c_z]=z;
    cInfo[i][c_r]=r;
    cInfo[i][carmodel]=modelid;
    cInfo[i][id_x] = CreateVehicle(modelid,x,y,z,r,-1,-1,-1);
    new string[128];
    format(string,sizeof(string),"Das Auto cInfo[%i] wurde erstellt.",i);
    SetVehicleNumberPlate(cInfo[i][id_x],"LS-000");
    SendClientMessageToAll(COLOR_RED,string);
    saveCarToDB(playerid,i);
    return 1;
    }
    return 1;
    }



    public OnPlayerCarsLoad(playerid)
    {
    new num_rows;
    if(!num_rows)return 1;
    for(new i=0; i<num_rows; i++)
    {
    new id=getFreeCarID();
    new queryy[256];
    format(queryy, sizeof(queryy),"SELECT * FROM `Autos` WHERE `besitzer` = %i",PlayerInfo[playerid][pMySQLID]);
    mysql_query(queryy);
    cInfo[id][carmodel] = mysql_GetIntByInt("Autos","model","besitzer",PlayerInfo[playerid][pMySQLID]);
    cInfo[id][besitzer] = mysql_GetIntByInt("Autos","besitzer","besitzer",PlayerInfo[playerid][pMySQLID]);
    cInfo[id][c_x] = mysql_GetFloatByInt("Autos","x","besitzer",PlayerInfo[playerid][pMySQLID]);
    cInfo[id][c_y] = mysql_GetFloatByInt("Autos","y","besitzer",PlayerInfo[playerid][pMySQLID]);
    cInfo[id][c_z] = mysql_GetFloatByInt("Autos","z","besitzer",PlayerInfo[playerid][pMySQLID]);
    cInfo[id][c_r] = mysql_GetFloatByInt("Autos","r","besitzer",PlayerInfo[playerid][pMySQLID]);
    cInfo[id][db_id] = mysql_GetIntByInt("Autos","Eintrag","besitzer",PlayerInfo[playerid][pMySQLID]);
    cInfo[id][kennzeichen] = mysql_GetIntByInt("Autos","kennzeichen","besitzer",PlayerInfo[playerid][pMySQLID]);
    cInfo[id][id_x]=CreateVehicle(cInfo[id][carmodel],cInfo[id][c_x],cInfo[id][c_y],cInfo[id][c_z],cInfo[id][c_r],-1,-1,-1);
    SetVehicleNumberPlate(cInfo[id][carmodel],cInfo[id][kennzeichen]);
    }
    return 1;
    }





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

    Also das ist aktuell mein Befehl aber ich möchte dann das diese Zwei Personen via Chat direkt schreiben können




    ocmd:annehmen(playerid,params[])
    {
    new id,str[155],sendername[MAX_PLAYER_NAME],vonname[MAX_PLAYER_NAME];
    if(!IsLeitstelle(playerid))return SendClientMessage(playerid,COLOR_RED,"Du bist kein Mitglied der San Andreas Leitstelle");
    if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED,"In einem Fahrzeug kannst du keine Notrufe entgegen nehmen.");
    if(!IsPlayerInRangeOfPoint(playerid,2.5,1788.3607,-1139.0278,24.0859)) return SendClientMessage(playerid,COLOR_RED,"Du bist nicht an einem Computer in der Leitstelle");
    if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_GREY,"Benutze: /annehmen [playerid]");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_GREY,"Spieler ist nicht online.");
    GetPlayerName(id,sendername,sizeof(sendername));
    GetPlayerName(playerid,vonname,sizeof(vonname));
    format(str,155,"Leistelle: Du hast den Notruf von %s entgegengenommen.",sendername);
    SendClientMessage(playerid,TEAM_AZTECAS_COLOR,str);
    format(str,155,"Dein Notruf wurde von dem Leitstelle entgegen genommen, du redest nun mit dem Mitarbeiter %s.",vonname);
    SendClientMessage(id,TEAM_AZTECAS_COLOR,str);
    return 1;
    }

    Ich melde mich nochmal,



    if(strcmp(cmdtext,"/ramfa",true)==0)
    {
    if(GetPlayerLeader(playerid) /*&& (IsPlayerInAGang(playerid) || GetPlayerFaction(playerid) == 8 || IsPlayerACop(playerid))*/)
    {
    if(FraktionsKasse[GetPlayerFaction(playerid)-1]<10000000)
    return SendClientMessage(playerid,FACTION_COL_GREY,"Du hast nicht genügend Geld in der Fraktionskasse ($10.000.000).");
    if(IsPlayerInAGang(playerid))
    {
    LastRespawned[GetPlayerFaction(playerid)-1] = gettime()+(60*60);
    for(new fc;fc<sizeof(FactionCars);fc++)
    {
    if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611)
    {
    if(FactionCars[fc][fFaction][0] == GetPlayerFaction(playerid) && IsVehicleEmpty(FactionCars[fc][sfCarid]))
    {
    DestroyAndCreateFactionCar(fc); //Oder FactionCars[fc][fCarid] ?
    }
    }
    }
    }
    else if(IsPlayerACop(playerid))
    {
    for(new fc;fc<sizeof(StateFactionCars);fc++)
    {
    if(StateFactionCars[fc][sfVehid] >= 400 && StateFactionCars[fc][sfVehid] <= 611)
    {
    if(StateFactionCars[fc][sfFaction][0] == GetPlayerFaction(playerid)&& IsVehicleEmpty(FactionCars[fc][fCarid]))
    {
    DestroyAndCreateStateFactionCar(fc);
    }
    }
    }
    if(PlayerInfo[playerid][pLeader] == 2)
    {
    SetVehicleToRespawn(PolizeiVehs[0]);
    SetVehicleToRespawn(PolizeiVehs[1]);
    }
    }
    else if(PlayerInfo[playerid][pLeader] == 10)
    {
    for(new ve=0; ve<sizeof(ArmyVehs); ve++)
    {
    SetVehicleToRespawn(ArmyVehs[ve]);
    }
    //SendClientMessage(playerid,COLOR_GREEN,"Du hast alle Army Fahrzeuge respawnt!");
    }
    else if(PlayerInfo[playerid][pLeader] == 11)
    {
    for(new ve=0; ve<sizeof(FahrschulVehs); ve++)
    {
    SetVehicleToRespawn(FahrschulVehs[ve]);
    }
    //SendClientMessage(playerid,COLOR_GREEN,"Du hast alle Fahrschul Fahrzeuge respawnt!");
    }
    else if(PlayerInfo[playerid][pLeader] == 24)
    {
    for(new ve=0; ve<sizeof(oAmtVehs); ve++)
    {
    SetVehicleToRespawn(oAmtVehs[ve]);
    }
    }
    else if(PlayerInfo[playerid][pLeader] == 4)
    {
    for(new ve=0; ve<sizeof(MedicVehs); ve++)
    {
    SetVehicleToRespawn(MedicVehs[ve]);
    }
    }
    else if(PlayerInfo[playerid][pLeader] == 22)
    {
    for(new ve=0; ve<sizeof(FireTrucks); ve++)
    {
    if(IsVehicleEmpty(FireTrucks[ve])) return SetVehicleToRespawn(FireTrucks[ve]);
    }
    }
    else if(PlayerInfo[playerid][pLeader] == 9)
    {
    for(new ve=0; ve<sizeof(NewsVehs); ve++)
    {
    SetVehicleToRespawn(NewsVehs[ve]);
    }
    }
    FraktionsKasse[GetPlayerFaction(playerid)-1]-=10000000;
    SendClientMessage(playerid,FACTION_COL_YELLOW,"Du hast deine Fraktionsfahrzeuge erfolgreich respawnt.");
    }
    else SendClientMessage(playerid,FACTION_COL_GREY,"Du bist nicht berechtigt diesen Befehl anzuwenden.");
    return true;
    }


    der erste teil geht aber wie mache ich das dann bei den anderen?

    Hey,



    Das bei den ocmd Befehlen:

    ocmd:help(playerid,params[])
    {
    ShowPlayerDialog(playerid,DIALOG_HILFE,DIALOG_STYLE_LIST,"Hilfefunktion","Allgemeine Serverbefehle","Ansehen","Abbruch");
    return 1;
    }



    Und das kommt unter OnDialogResponse



    if(dialogid == DIALOG_HILFE)
    {
    if(response)
    {
    switch(listitem)
    {
    case 0:
    {
    SendClientMessage(playerid, COLOR_GREY, "*** ACCOUNT *** /animlist /stats /messages /hitsound /skilltree /tog /handsup /pay /time /buy /scheine");
    SendClientMessage(playerid, COLOR_GREY, "*** GENERAL *** /heiraten /muteinfo /gutschein /spawnchange /gps /dropweapons /letter /carradio /uninvite");
    SendClientMessage(playerid, COLOR_GREY, "*** GENERAL *** /support /accept /eject /usedrugs /contract /fill /service /taxis /music /races /leaders"); SendClientMessage(playerid, COLOR_GREY, "*** GENERAL *** /selldrungs, /seed, /materials, /sellgun, /sellmats");
    SendClientMessage(playerid, COLOR_WHITE, "*** Andere *** /cellphonehelp /househelp /renthelp /bizhelp /leaderhelp /fishhelp /cookhelp /orghelp");
    SendClientMessage(playerid, COLOR_GRAD1, "*** Hilfe *** Du kannst mit /help [Suchbegriff] die Datenbank durchsuchen");
    SendClientMessage(playerid, COLOR_WHITE,"{0174DF}*~~ Services / Support Hilfe ~~* |{FFFFFF} /service /cancel /a /sup /contract");
    return 1;
    }
    }
    }
    }



    Wenn du sowas meintest