Beiträge von Fabi.StaR

    Und wie kann ich dich speichern??



    ihr mein Stock SavePlayer

    Spoiler anzeigen
    stock SavePlayer(playerid)
    {
    if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
    {
    if(GetPVarInt(playerid,"Eingeloggt") == 1)
    {
    GetPlayerName(playerid, PlayerInfo[playerid][pName], MAX_PLAYER_NAME);
    mysql_SetInt("accounts", "Geld", GetPlayerMoney(playerid), "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Skin", GetPlayerSkin(playerid), "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "WantedLevel",GetPlayerWantedLevel(playerid),"Name",PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Level", GetPlayerScore(playerid), "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "FightingStyle",GetPlayerFightingStyle(playerid), "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Kontostand",PlayerInfo[playerid][pKontoStand], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Alter", PlayerInfo[playerid][pAlter],"Name",PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Werbungsanzahl", PlayerInfo[playerid][pWerbung],"Name",PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Telefonbuch", PlayerInfo[playerid][pTelefonbuch], "Name",PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "HandyNummer", PlayerInfo[playerid][pHandyNummer],"Name",PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "GangJail",PlayerInfo[playerid][pGangJail],"Name",PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Nutzung",PlayerInfo[playerid][pNutzung],"Name",PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Job",PlayerInfo[playerid][pJob],"Name",PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "SaveMats",PlayerInfo[playerid][pSaveMats],"Name",PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Kills", PlayerInfo[playerid][pKills], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "MatsPakete",PlayerInfo[playerid][pPackete],"Name",PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "MatsHave",PlayerInfo[playerid][pMats],"Name",PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "FraktionsLeader", PlayerInfo[playerid][pFraktionsLeader], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "FraktionsMember", PlayerInfo[playerid][pFraktionsMember], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "FraktionsRange", PlayerInfo[playerid][pFraktionsRange], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "AdminLevel", PlayerInfo[playerid][pAdminLevel], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Autoschein", PlayerInfo[playerid][pAutoschein], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Motorradschein", PlayerInfo[playerid][pMotorradschein], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Flugzeugschein", PlayerInfo[playerid][pFlugschein], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "LKWschein", PlayerInfo[playerid][pLKWschein], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Bootschein", PlayerInfo[playerid][pBootschein], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Waffenschein", PlayerInfo[playerid][pWaffenschein], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Angelschein", PlayerInfo[playerid][pAngelschein], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Respektpunkte", PlayerInfo[playerid][pRespektPunkte], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "PayDayTime", PlayerInfo[playerid][pPayDayTime], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Bann",PlayerInfo[playerid][pBanned],"Name",PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "TimeBan",PlayerInfo[playerid][pTimeBanned],"Name",PlayerInfo[playerid][pName]);
    new str[128];
    format(str,sizeof(str),"Spieler %s erfolgreich gespeichert!",PlayerName(playerid));
    print(str);
    }
    }
    return 1;
    }

    Hir so sollte es gehen:


    Spoiler anzeigen
    //Gantz oben im Script
    enum NewCar
    {
    Carid,
    Float:CarX,
    Float:CarY,
    Float:CarZ,
    Float:CarA,
    vehid
    }
    #define Max_SellCars 9
    new NewsCars[Max_SellCars][NewCar] = {
    {582,-314.7514,1515.3643,75.4135,0.0, -1},
    {582,-317.8429,1515.3643,75.4135,0.0, -1},
    {582,-320.9344,1515.3643,75.4135,0.0, -1},
    {582,-324.0259,1515.3643,75.4135,0.0, -1},
    {582,-327.1174,1515.3643,75.4135,0.0, -1},
    {582,-330.2089,1515.3643,75.4135,0.0, -1},
    {582,-333.3004,1515.3643,75.4135,0.0, -1},
    {582,-336.3919,1515.3643,75.4135,0.0, -1},
    {582,-339.4834,1515.3643,75.4135,0.0, -1},
    {582,-342.5749,1515.3643,75.4135,0.0, -1},
    {582,-345.6664,1515.3643,75.4135,0.0, -1},
    {488,-309.9134,1569.4065,75.5367,275.5628, -1},
    {488,-302.1933,1561.5715,75.5366,277.8422, -1},
    {488,-294.7991,1552.8628,75.5390,272.5410, -1},
    };

    Spoiler anzeigen
    //bei OnGameModeInit:

    Spoiler anzeigen
    for(new i=0; i<sizeof(NewsCars); i++)
    {
    NewsCars[i][vehid]=AddStaticVehicleEx(NewsCars[i][Carid],NewsCars[i][CarX],NewsCars[i][CarY],NewsCars[i][CarZ],NewsCars[i][CarA],0,0,-1);
    }

    Spoiler anzeigen
    //und bei OnGameModeExit
    for(new i=0; i<sizeof(NewsCars); i++)
    {
    DestroyVehicle(NewsCars[i][vehid]);
    }

    Spoiler anzeigen
    //und der befehl:

    Spoiler anzeigen
    ocmd:news(playerid,params[])
    {
    if(PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4)
    {
    if(IsPlayerInAnyVehicle(playerid))
    {
    for(new i=0; i<sizeof(NewsCars); i++)
    {
    if(GetPlayerVehicleID(playerid) == NewsCars[i][vehid])
    {
    new text[128],nr[128];
    if(sscanf(params,"s",text)) return SendClientMessage(playerid,Grau,"[Benutze]: /news [Text]");
    format(nr,sizeof(nr),"NR %s: %s",GetName(playerid),text);
    SendClientMessageToAll(Orange,nr);
    return 1;
    }
    Fehler(playerid,"Du bist in keinem News Fahrzeug!");
    return 1;
    }
    }
    Fehler(playerid,"Du bist in keinem News Fahrzeug!");
    return 1;
    }
    Fehler(playerid,"Du bist kein News Reporter!");
    return 1;
    }

    Hir so sollte es gehen


    Spoiler anzeigen
    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    if(dialogid == CARCRE)
    {

    Spoiler anzeigen
    if(response)
    {

    Spoiler anzeigen
    new Float:x,Float:y,Float:z,Float: ZRot;
    GetPlayerPos(playerid,x,y,z);
    GetPlayerFacingAngle(playerid,ZRot);
    if (listitem == 0)
    {
    CreateVehicle(494,x,y,z,ZRot,1,1,-1);
    SendClientMessage(playerid,0x00ff00ff,"Auto erstellt");
    }
    else if(listitem == 1)
    {
    CreateVehicle(506,x,y,z,ZRot,1,1,-1);
    SendClientMessage(playerid,0x00ff00ff,"Auto erstellt");
    }
    }
    }
    return 1;
    }

    Jetzt auf einmal bekomme ich 4 Errors



    Errors:


    Spoiler anzeigen
    C:\Users\Fabian\Desktop\Mein Server\gamemodes\Selfmade.pwn(3826) : error 075: input line too long (after substitutions)
    C:\Users\Fabian\Desktop\Mein Server\gamemodes\Selfmade.pwn(3828) : warning 217: loose indentation
    C:\Users\Fabian\Desktop\Mein Server\gamemodes\Selfmade.pwn(3828) : error 017: undefined symbol "IE"
    C:\Users\Fabian\Desktop\Mein Server\gamemodes\Selfmade.pwn(3828 -- 3829) : warning 215: expression has no effect
    C:\Users\Fabian\Desktop\Mein Server\gamemodes\Selfmade.pwn(3829) : error 001: expected token: ";", but found "-identifier-"
    C:\Users\Fabian\Desktop\Mein Server\gamemodes\Selfmade.pwn(3829) : warning 217: loose indentation
    C:\Users\Fabian\Desktop\Mein Server\gamemodes\Selfmade.pwn(3830) : warning 213: tag mismatch
    C:\Users\Fabian\Desktop\Mein Server\gamemodes\Selfmade.pwn(3828) : warning 203: symbol is never used: "Zeile"
    C:\Users\Fabian\Desktop\Mein Server\gamemodes\Selfmade.pwn(3856) : error 006: must be assigned to an array
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase

    Spoiler anzeigen
    4 Errors.


    Zeilen:


    Spoiler anzeigen
    stock CreateCar(playerid)
    {
    for(new i=0; i<sizeof(SellCar); i++)
    {
    new query[700],id;//die zeile: 3826
    format(query, 700, "INSERT INTO `cars` (`id`, `Owner`, `POSX`, `POSY`, `POSZ`, `POSA`, `color1`, `color2`, `NummernSchild`, `ModelID`, `Preis`) VALUES (NULL, 'Niemand', '%f', '%f', '%f', '%f', '%d', '%d', '%d', '%d', '%d');",PrivatCar[playerid][ParkX],PrivatCar[playerid][ParkY],PrivatCar[playerid][ParkZ],PrivatCar[playerid][ParkA],PrivatCar[playerid][privatColor2],PrivatCar[playerid][privatColor2],PrivatCar[playerid][nummernschild],PrivatCar[playerid][privatmodelid],PrivatCar[playerid][CarPreis]);//DIE Zeile: 3825
    mysql_query(query);//die zeile: 3828
    id = mysql_GetIntWithInt("Cars", "id", "plate", nummernschild);//die 3829
    format(query, 300, "UPDATE `cars` SET `plate` = 'UNBOUGHT' WHERE `id` = '%d'", id);
    mysql_query(query);
    format(PrivatCar[playerid][PrivatNAme], 24, "%s", "Niemand");
    PrivatCar[playerid][ParkX] = 742.2209;
    PrivatCar[playerid][ParkY] = -1344.2977;
    PrivatCar[playerid][ParkZ] = 13.2459;
    PrivatCar[playerid][ParkA] = 268.1639;
    PrivatCar[playerid][privatColor1] = -1;
    PrivatCar[playerid][privatColor2] = -1;
    PrivatCar[playerid][CarPreis] = SellCar[i][CarPreis];
    format(PrivatCar[playerid][nummernschild], 20, "%s", "UNBOUGHT");
    PrivatCar[playerid][car] = AddStaticVehicleEx(PrivatCar[playerid][privatmodelid], PrivatCar[playerid][ParkX], PrivatCar[playerid][ParkY], PrivatCar[playerid][ParkZ], PrivatCar[playerid][ParkA], PrivatCar[playerid][privatColor1], PrivatCar[playerid][privatColor2], -1);
    }
    return 1;
    }
    stock LoadCars(playerid)
    {
    GetPlayerName(playerid, PrivatCar[playerid][PrivatNAme], MAX_PLAYER_NAME);
    PrivatCar[playerid][ParkX] = mysql_GetFloat("Cars", "POSX", "Owner", PrivatCar[playerid][PrivatNAme]);
    PrivatCar[playerid][ParkY] = mysql_GetFloat("Cars", "POSY", "Owner", PrivatCar[playerid][PrivatNAme]);
    PrivatCar[playerid][ParkZ] = mysql_GetFloat("Cars", "POSZ", "Owner", PrivatCar[playerid][PrivatNAme]);
    PrivatCar[playerid][ParkA] = mysql_GetFloat("Cars", "POSA", "Owner", PrivatCar[playerid][PrivatNAme]);
    PrivatCar[playerid][privatColor2] = mysql_GetInt("Cars", "color1", "Owner", PrivatCar[playerid][PrivatNAme]);
    PrivatCar[playerid][privatColor2] = mysql_GetInt("Cars", "color2", "Owner", PrivatCar[playerid][PrivatNAme]);
    PrivatCar[playerid][privatmodelid] = mysql_GetInt("Cars", "ModelID","Owner", PrivatCar[playerid][PrivatNAme]);
    PrivatCar[playerid][CarPreis] = mysql_GetString("Cars", "Preis","Owner", PrivatCar[playerid][PrivatNAme]);
    PrivatCar[playerid][car] = AddStaticVehicleEx(PrivatCar[playerid][privatmodelid],PrivatCar[playerid][ParkX],PrivatCar[playerid][ParkY],PrivatCar[playerid][ParkZ],PrivatCar[playerid][ParkA],PrivatCar[playerid][privatColor2],PrivatCar[playerid][privatColor2],-1);//3856
    SetVehicleNumberPlate(PrivatCar[playerid][car], PrivatCar[playerid][nummernschild]);
    return 1;
    }

    er wird an der stelle ihr benutzt:


    Spoiler anzeigen
    ocmd:buycar(playerid, params[])
    {
    for(new i=0; i<sizeof(SellCar); i++)
    {
    if(GetPlayerVehicleID(playerid)==SellCar[i][vehid])
    {
    new geld = SellCar[i][CarPreis];
    if(GetPlayerMoney(playerid) >= geld)
    {
    GivePlayerMoney(playerid,-geld);
    CreateVehicle(SellCar[i][Carid],742.2209,-1344.2977,13.2459,268.1639,-1,-1,60000);
    formatEx(playerid,Gruen,"Du hast dir erflogreich einen %s für $%i gekauft, Viel spass und denk an die StVo!",SellCar[i][CarName],geld);
    CreateCar(playerid);//hir
    TogglePlayerControllable(playerid,1);
    RemovePlayerFromVehicle(playerid);
    }
    else
    {
    SendClientMessage(playerid,Rot,"Du hast nicht genung Geld dabei!");
    TogglePlayerControllable(playerid,1);
    RemovePlayerFromVehicle(playerid);
    }
    }
    }
    return 1;
    }

    Hab ich jetzt ist der weg aber dafür 6warnings:



    Spoiler anzeigen
    C:\Users\Fabian\Desktop\Mein Server\gamemodes\Selfmade.pwn(3824) : error 075: input line too long (after substitutions)
    C:\Users\Fabian\Desktop\Mein Server\gamemodes\Selfmade.pwn(3825) : error 017: undefined symbol "CarPre"
    C:\Users\Fabian\Desktop\Mein Server\gamemodes\Selfmade.pwn(3826) : warning 217: loose indentation
    C:\Users\Fabian\Desktop\Mein Server\gamemodes\Selfmade.pwn(3826) : error 017: undefined symbol "is"
    C:\Users\Fabian\Desktop\Mein Server\gamemodes\Selfmade.pwn(3826) : error 029: invalid expression, assumed zero
    C:\Users\Fabian\Desktop\Mein Server\gamemodes\Selfmade.pwn(3826) : error 029: invalid expression, assumed zero
    C:\Users\Fabian\Desktop\Mein Server\gamemodes\Selfmade.pwn(3826) : fatal error 107: too many error messages on one line

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

    Spoiler anzeigen
    6 Errors.



    Hit der stock:


    Spoiler anzeigen
    stock CreateCar(playerid)
    {
    new query[600],id;//die zeile: 3824
    format(query, 600, "INSERT INTO `cars` (`id`, `Owner`, `POSX`, `POSY`, `POSZ`, `POSA`, `color1`, `color2`, `NummernSchild`, `ModelID`, `Preis`) VALUES (NULL, 'Niemand', '%f', '%f', '%f', '%f', '%d', '%d', '%d', '%d', '%d');", PrivatCar[playerid][ParkX], PrivatCar[playerid][ParkY], PrivatCar[playerid][ParkZ], PrivatCar[playerid][ParkA], PrivatCar[playerid][privatColor2], PrivatCar[playerid][privatColor2], PrivatCar[playerid][nummernschild], PrivatCar[playerid][privatmodelid], PrivatCar[playerid][CarPreis]);//DIE Zeile: 3825
    mysql_query(query);//die zeile: 3826
    id = mysql_GetIntWithInt("Cars", "id", "plate", nummernschild);
    format(query, 300, "UPDATE `cars` SET `plate` = 'UNBOUGHT' WHERE `id` = '%d';", id);
    mysql_query(query);
    format(PrivatCar[playerid][PrivatNAme], 24, "%s", "Niemand");
    PrivatCar[playerid][ParkX] = 742.2209;
    PrivatCar[playerid][ParkY] = -1344.2977;
    PrivatCar[playerid][ParkZ] = 13.2459;
    PrivatCar[playerid][ParkA] = 268.1639;
    PrivatCar[playerid][privatColor1] = -1;
    PrivatCar[playerid][privatColor2] = -1;
    PrivatCar[playerid][CarPreis] = SellCar[i][CarPreis];
    format(PrivatCar[playerid][nummernschild], 20, "%s", "UNBOUGHT");
    PrivatCar[playerid][car] = AddStaticVehicleEx(PrivatCar[playerid][privatmodelid], PrivatCar[playerid][ParkX], PrivatCar[playerid][ParkY], PrivatCar[playerid][ParkZ], PrivatCar[playerid][ParkA], PrivatCar[playerid][privatColor1], PrivatCar[playerid][privatColor2], -1);
    return 1;
    }