Beiträge von James.Spader

    Guten Tag ihr lieben... :D
    ich hab mal wieder nen Error im Server (vom Autohaus-System dies mal):

    Code
    [13:44:44] [chat] [***]: /car sell
    [13:45:43] [debug] Run time error 4: "Array index out of bounds"
    [13:45:43] [debug]  Accessing element at index 70 past array upper bound 69
    [13:45:43] [debug] AMX backtrace:
    [13:45:43] [debug] #0 00003428 in public OnPlayerCommandText (1, 522520) from Autohaus-System.amx


    dort steht: (zum Anfang):
    if(!strcmp(cmdtext,"/car",true,4))
    sollte ich es in:
    if(strcmp(cmdtext, "/car", true) == 0)
    umbenennen? oder liegt der Fehler woanders?



    MfG
    James.

    @Jeffry
    Ich verstehe jetzt nur noch Bahnhof. Ich glaub das Problem hat sich erledigt. Ich habe das nun von 500 auf 211 wieder runter gesetzt, und dann funktioniert wieder alles. Liegt es an der neuen Datei? oder woran?
    Wie gesagt, es hat sich anscheinend erledigt. Vielen Dank Jeffry :)

    @Jeffry
    Wenn ich das alles befolge, was du mir hier schreibst, dann bekomme ich nur den eig. normalen Pawno-Ausschnitt (beim Compiler):

    Code
    Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase
    
    
    Header size:           9760 bytes
    Code size:          3439084 bytes
    Data size:          8995896 bytes
    Stack/heap size:      16384 bytes; estimated max. usage=4800 cells (19200 bytes)
    Total requirements:12461124 bytes

    und in der Log steht nichts. Ich habe alles befolgt, wie du es mir beschrieben hast.

    Es scheint mir als hast du noch ein Array, das du mit [211] instanziiert hast. Schau mal, ob du da noch eines findest und erhöhe dessen Größe ebenfalls.

    Ich habe mal nachgeschaut, und ich finde leider nicht mehr mit [211] etc.
    Ich habe das Problem, seitdem ich die Feuerwache eingefügt habe. Und dann aufgrund der Position, des Kaufpointes des Hauses musste ich das Haus wieder einfügen (um die Koordinaten des Pointes festzustellen)
    damit Mitten auf dem Platz kein Point zum Haus-Kauf besteht. Seitdem habe ich das Problem. Also seitdem ich das Haus aus der Datei entfernt habe.

    Stelle es mal auf 500 oder 1000, ob das was ändert (möglicherweise Leere Zeilen am Ende der Datei? Oder nicht endende Schleife?).
    Ansonsten poste den Code durch den der Fehler verursacht wird.


    So, jetzt habe ich es mal auf 500 gesetzt, nun komm die Errors zwar nicht mehr, aber wenn ich aus das Interior gehen will, bin ich nicht auf dem Platz, sondern mitten im Meer... war vorher aber noch nicht so
    Ich habe mal nochmal genauer nachgeschaut: (Das steht in der Log, wo der Fehler noch war:)


    Edit:
    kann es sein, dass es hier dran liegt?
    for(new h = 0; h < sizeof(HouseInfo); h++)

    Huhu ihr lieben... ;)
    ich habe das Problem, ich habe ein Haus entfernt (aus der property.cfg), es waren 212 nun sind es logw. 211.
    Ich habe es auch im Script so eingetragen:
    new HouseInfo[211][hInfo];


    jedoch bekomme ich die Errors: (auch wenn ich die Zahl hör stelle, also auf 212.)


    Code
    [18:07:59] [debug] Run time error 4: "Array index out of bounds"
    [18:07:59] [debug] Accessing element at index 211 past array upper bound 210

    ich weiß nicht woran es liegt. :(
    Ich hoffe ihr könnt helfen.




    MfG
    James.Spader.

    Aber dein Account "[BR]Name" oder wie es heißt, existiert schon in der Datenbank, oder?

    Ja, der Account existiert in der Datenbank und wird auch gespeichert, aber ich falle halt nach dem Login dann aus der Welt, als wenn dann der Server einfach nicht mehr geladen wird, ich kann keine Befehle eingeben, einfach gar nichts.

    Okay und jetzt das "OnPlayerLogin" bitte


    public OnPlayerLogin(playerid,password[])
    {
    new tmp2[256];
    new string2[100];
    //new string[256];
    new playername2[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername2, sizeof(playername2));
    format(string2, sizeof(string2), "/Accounts/%s.ini", playername2);
    SpawnPlayer(playerid);
    if ( fexist(string2) )
    {
    new valtmp[256];
    valtmp = dini_Get(string2, "Key");
    strmid(PlayerInfo[playerid][pKey], valtmp, 0, strlen(valtmp), 255);
    //printf("key: %s | pw: %s", PlayerInfo[playerid][pKey],password);
    if(strcmp(PlayerInfo[playerid][pKey],password) == 0 )
    {
    PlayerInfo[playerid][pLevel] = dini_Int(string2, "Level");
    PlayerInfo[playerid][pAdmin] = dini_Int(string2, "AdminLevel");
    PlayerInfo[playerid][pDonateRank] = dini_Int(string2, "DonateRank");
    PlayerInfo[playerid][gPupgrade] = dini_Int(string2, "UpgradePoints");
    PlayerInfo[playerid][pConnectTime] = dini_Int(string2, "ConnectedTime");
    PlayerInfo[playerid][pReg] = dini_Int(string2, "Registered");
    PlayerInfo[playerid][pSex] = dini_Int(string2, "Sex");
    PlayerInfo[playerid][pAge] = dini_Int(string2, "Age");
    PlayerInfo[playerid][pOrigin] = dini_Int(string2, "Origin");
    PlayerInfo[playerid][pCK] = dini_Int(string2, "CK");
    PlayerInfo[playerid][pMuted] = dini_Int(string2, "Muted");
    PlayerInfo[playerid][pExp] = dini_Int(string2, "Respect");
    PlayerInfo[playerid][pCash] = dini_Int(string2, "Money");
    PlayerInfo[playerid][pAccount] = dini_Int(string2, "Bank");
    PlayerInfo[playerid][pCrimes] = dini_Int(string2, "Crimes");
    PlayerInfo[playerid][pKills] = dini_Int(string2, "Kills");
    PlayerInfo[playerid][pDeaths] = dini_Int(string2, "Deaths");
    PlayerInfo[playerid][pArrested] = dini_Int(string2, "Arrested");
    PlayerInfo[playerid][pWantedDeaths] = dini_Int(string2, "WantedDeaths");
    PlayerInfo[playerid][pPhoneBook] = dini_Int(string2, "Phonebook");
    PlayerInfo[playerid][pLottoNr] = dini_Int(string2, "LottoNr");
    PlayerInfo[playerid][pFishes] = dini_Int(string2, "Fishes");
    PlayerInfo[playerid][pBiggestFish] = dini_Int(string2, "BiggestFish");
    PlayerInfo[playerid][pJob] = dini_Int(string2, "Job");
    PlayerInfo[playerid][pPayCheck] = dini_Int(string2, "Paycheck");
    PlayerInfo[playerid][pHeadValue] = dini_Int(string2, "HeadValue");
    PlayerInfo[playerid][pJailed] = dini_Int(string2, "Jailed");
    PlayerInfo[playerid][pJailTime] = dini_Int(string2, "JailTime");
    PlayerInfo[playerid][pMats] = dini_Int(string2, "Materials");
    PlayerInfo[playerid][pDrugs] = dini_Int(string2, "Drugs");
    PlayerInfo[playerid][pLeader] = dini_Int(string2, "Leader");
    PlayerInfo[playerid][pMember] = dini_Int(string2, "Member");
    PlayerInfo[playerid][pFMember] = dini_Int(string2, "FMember");
    PlayerInfo[playerid][pRank] = dini_Int(string2, "Rank");
    PlayerInfo[playerid][pChar] = dini_Int(string2, "Char");
    PlayerInfo[playerid][pContractTime] = dini_Int(string2, "ContractTime");
    PlayerInfo[playerid][pDetSkill] = dini_Int(string2, "DetSkill");
    PlayerInfo[playerid][pSexSkill] = dini_Int(string2, "SexSkill");
    PlayerInfo[playerid][pBoxSkill] = dini_Int(string2, "BoxSkill");
    PlayerInfo[playerid][pLawSkill] = dini_Int(string2, "LawSkill");
    PlayerInfo[playerid][pMechSkill] = dini_Int(string2, "MechSkill");
    PlayerInfo[playerid][pJackSkill] = dini_Int(string2, "JackSkill");
    PlayerInfo[playerid][pCarSkill] = dini_Int(string2, "CarSkill");
    PlayerInfo[playerid][pNewsSkill] = dini_Int(string2, "NewsSkill");
    PlayerInfo[playerid][pDrugsSkill] = dini_Int(string2, "DrugsSkill");
    PlayerInfo[playerid][pCookSkill] = dini_Int(string2, "CookSkill");
    PlayerInfo[playerid][pFishSkill] = dini_Int(string2, "FishSkill");
    PlayerInfo[playerid][pSHealth] = dini_Int(string2, "pSHealth");
    PlayerInfo[playerid][pHealth] = dini_Int(string2, "pHealth");
    PlayerInfo[playerid][pInt] = dini_Int(string2, "Int");
    PlayerInfo[playerid][pLocal] = dini_Int(string2, "Local"); //
    PlayerInfo[playerid][pTeam] = dini_Int(string2, "Team");
    PlayerInfo[playerid][pModel] = dini_Int(string2, "Model");
    PlayerInfo[playerid][pPnumber] = dini_Int(string2, "PhoneNr");
    PlayerInfo[playerid][pPhousekey] = dini_Int(string2, "House");
    PlayerInfo[playerid][pPbiskey] = dini_Int(string2, "Bizz");
    PlayerInfo[playerid][pPos_x] = dini_Int(string2, "Pos_x");
    PlayerInfo[playerid][pPos_y] = dini_Int(string2, "Pos_y");
    PlayerInfo[playerid][pPos_z] = dini_Int(string2, "Pos_z");
    PlayerInfo[playerid][pCarLic] = dini_Int(string2, "CarLic");
    PlayerInfo[playerid][pTruckLic] = dini_Int(string2, "TruckLic");
    PlayerInfo[playerid][pBikeLic] = dini_Int(string2, "BikeLic");
    PlayerInfo[playerid][pFlyLic] = dini_Int(string2, "FlyLic");
    PlayerInfo[playerid][pBoatLic] = dini_Int(string2, "BoatLic");
    PlayerInfo[playerid][pFishLic] = dini_Int(string2, "FishLic");
    PlayerInfo[playerid][pGunLic] = dini_Int(string2, "GunLic");
    PlayerInfo[playerid][pGun1] = dini_Int(string2, "Gun1");
    PlayerInfo[playerid][pGun2] = dini_Int(string2, "Gun2");
    PlayerInfo[playerid][pGun3] = dini_Int(string2, "Gun3");
    PlayerInfo[playerid][pGun4] = dini_Int(string2, "Gun4");
    PlayerInfo[playerid][pAmmo1] = dini_Int(string2, "Ammo1");
    PlayerInfo[playerid][pAmmo2] = dini_Int(string2, "Ammo2");
    PlayerInfo[playerid][pAmmo3] = dini_Int(string2, "Ammo3");
    PlayerInfo[playerid][pAmmo4] = dini_Int(string2, "Ammo4");
    PlayerInfo[playerid][pCarTime] = dini_Int(string2, "CarTime");
    PlayerInfo[playerid][pPayDay] = dini_Int(string2, "PayDay");
    PlayerInfo[playerid][pPayDayZeit] = dini_Int(string2, "PayDayZeit");
    PlayerInfo[playerid][pPayDayHad] = dini_Int(string2, "PayDayHad");
    PlayerInfo[playerid][pCDPlayer] = dini_Int(string2, "CDPlayer");
    PlayerInfo[playerid][pWins] = dini_Int(string2, "Wins");
    PlayerInfo[playerid][pLoses] = dini_Int(string2, "Loses");
    PlayerInfo[playerid][pAlcoholPerk] = dini_Int(string2, "AlcoholPerk");
    PlayerInfo[playerid][pDrugPerk] = dini_Int(string2, "DrugPerk");
    PlayerInfo[playerid][pMiserPerk] = dini_Int(string2, "MiserPerk");
    PlayerInfo[playerid][pPainPerk] = dini_Int(string2, "PainPerk");
    PlayerInfo[playerid][pTraderPerk] = dini_Int(string2, "TraderPerk");
    PlayerInfo[playerid][pTut] = dini_Int(string2, "Tutorial");
    PlayerInfo[playerid][pMissionNr] = dini_Int(string2, "Mission");
    PlayerInfo[playerid][pWarns] = dini_Int(string2, "Warnings");
    PlayerInfo[playerid][pAdjustable] = dini_Int(string2, "Adjustable");
    PlayerInfo[playerid][pOwnPerso] = dini_Int(string2, "Perso");
    PlayerInfo[playerid][pGangJailed] = dini_Int(string2, "GangJailed");
    PlayerInfo[playerid][pFuel] = dini_Int(string2, "Fuel");
    PlayerInfo[playerid][pMarried] = dini_Int(string2, "Married");
    PlayerInfo[playerid][pMarriedTo] = dini_Int(string2, "MarriedTo");
    PlayerInfo[playerid][pMuteTime] = dini_Int(string2, "MuteTime");
    PlayerInfo[playerid][pPunkte] = dini_Int(string2, "Punkte");
    PlayerInfo[playerid][pMauled] = dini_Int(string2, "Mauled");
    PlayerInfo[playerid][pGehalt] = dini_Int(string2, "Gehalt");
    PlayerInfo[playerid][pFrakSperre] = dini_Int(string2, "FrakSperre");
    Knast[playerid] = dini_Int(string2, "Knast");
    KnastTime[playerid] = dini_Int(string2, "KnastTime");
    SpawnChange[playerid] = dini_Int(string2, "SpawnChange");
    WantedLevel[playerid] = SetPlayerWantedLevel(playerid, WantedLevel[playerid]);
    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"{FFFFFF}ServerName","{FFFFFF}\n{FF0000}Falsches Passwort! (verleibene Versuche: {FFFFFF}1{FF0000}){FFFFFF}\nDas Passwort ist nicht korrekt! Bitte gib nun dein richtiges Passwort ein:","Login","Abbrechen");
    gPlayerLogTries[playerid] += 1;
    if(gPlayerLogTries[playerid] == 4)
    {
    new string[128];
    new sendername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    pIstTot[playerid] = 0;
    PlayerInfo[playerid][pTod] = 0;
    format(string,sizeof(string),"%s wurde vom Server gekickt, Begründung: falsches Passwort (Login)",sendername);
    SendClientMessageToAll(COLOR_IRED,string);
    SendClientMessage(playerid,COLOR_IRED,"** Du hast zu oft das falsche Passwort angegeben, deshalb wurdest du gekickt! **");
    Kick(playerid);
    }
    return 1;
    }
    pIstTot[playerid] = 0;
    PlayerInfo[playerid][pTod] = 0;
    PlayerInfo[playerid][pAdjustable] = 0;
    ResetPlayerMoney(playerid);
    ConsumingMoney[playerid] = 1;
    GivePlayerMoney(playerid,PlayerInfo[playerid][pCash]);
    CurrentMoney[playerid] = PlayerInfo[playerid][pCash];
    if(PlayerInfo[playerid][pReg] == 0)
    {
    PlayerInfo[playerid][pLevel] = 1;
    PlayerInfo[playerid][pSHealth] = 100.0;
    PlayerInfo[playerid][pHealth] = 100.0;
    PlayerInfo[playerid][pPos_x] = 1478.6859;
    PlayerInfo[playerid][pPos_y] = -1674.6659;
    PlayerInfo[playerid][pPos_z] = 14.0469;
    PlayerInfo[playerid][pInt] = 0;
    PlayerInfo[playerid][pLocal] = 255;
    PlayerInfo[playerid][pTeam] = 3;
    PlayerInfo[playerid][pModel] = 137;
    new randphone = 1000 + random(8999);//minimum 1000 max 9999 //giving one at the start
    PlayerInfo[playerid][pPnumber] = randphone;
    PlayerInfo[playerid][pPhousekey] = 255;
    PlayerInfo[playerid][pPbiskey] = 255;
    PlayerInfo[playerid][pAccount] = 0;
    PlayerInfo[playerid][pReg] = 1;
    GivePlayerMoney(playerid, 2000);
    }
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,sizeof(pName));
    format(tbDir,sizeof(tbDir),foxBanFile,pName);
    if(dini_Exists(tbDir))
    {
    if(dini_Int(tbDir,"fbTime")+dini_Int(tbDir,"fbDuration") > Time())
    {
    new sekki=(dini_Int(tbDir,"fbTime")+dini_Int(tbDir,"fbDuration"))-Time(),minni=sekki/60;
    sekki=sekki-minni*60;
    format(ALLSTRING,sizeof(ALLSTRING),"** Du wurdest für eine Weile vom Server gebannt. Restliche Zeit: %d Minuten %d Sekunden.",minni,sekki);
    SendClientMessage(playerid,COLOR_IRED,ALLSTRING);
    format(ALLSTRING,sizeof(ALLSTRING),"%s wurde vom Server gekickt, Begründung: Timeban", pName);
    SendClientMessageToAll(COLOR_IRED,ALLSTRING);
    Kick(playerid);
    } else { dini_Remove(tbDir); }
    }
    if(PlayerInfo[playerid][pLevel] == -999) //autoban
    {
    Ban(playerid);
    }
    else if(PlayerInfo[playerid][pCK] > 0)
    {
    Kick(playerid);
    }
    format(string2, sizeof(string2), "{FFFFFF}» Herzlich Willkommen zurück, %s",playername2);
    SendClientMessage(playerid, COLOR_WHITE,string2);
    printf("%s has logged in.",playername2);
    if (PlayerInfo[playerid][pDonateRank] >= 1)
    {
    SendClientMessage(playerid, COLOR_WHITE,"{FFFFFF}» Du hast dich mit deinem Pre-Account {00FF00}erfolgreich{FFFFFF} eingeloggt.");
    }
    if (PlayerInfo[playerid][pAdmin] >= 1)
    {
    format(string2, sizeof(string2), "{FFFFFF}» Du bist dem Admin-Rang {FF0000}%d{FFFFFF} eingeloggt!",PlayerInfo[playerid][pAdmin]);
    SendClientMessage(playerid, COLOR_WHITE,string2);
    }
    SetSpawnInfo(playerid, PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pModel], PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z], 1.0, -1, -1, -1, -1, -1, -1);
    if(gTeam[playerid] == 0)
    {
    gTeam[playerid] = 3;
    }
    else
    {
    gTeam[playerid] = PlayerInfo[playerid][pTeam];
    }
    gPlayerLogged[playerid] = 1;
    pIstTot[playerid] = 0;
    PlayerInfo[playerid][pTod] = 0;
    SetPlayerHealth(playerid,100);
    SpawnPlayer(playerid);
    format(tmp2, sizeof(tmp2), "~w~Willkommen ~n~~y~ %s", playername2);
    DateProp(playerid);
    GameTextForPlayer(playerid, tmp2, 5000, 1);
    SendClientMessage(playerid, COLOR_YELLOW, motd);
    if(PlayerInfo[playerid][pFMember] < 255)
    {
    format(tmp2, sizeof(tmp2), "Familie MOTD: %s.", FamilyInfo[PlayerInfo[playerid][pFMember]][FamilyMOTD]);
    SendClientMessage(playerid, COLOR_YELLOW, tmp2);
    }
    }
    return 1;
    }

    Der Code vom Register:


    Das Problem ist, wenn ich mich mit dem Namen mit der Klammer registrieren will und dann auf 'weiter' klicken will, geht er nicht weiter, sondern, ich falle aus der Welt. Ohne den Klammern, geht es ganz normal weiter.

    Huhu ihr lieben,
    ich habe das Problem,
    wenn ich z.b. [BR]Name eingebe, als Spielernamen, dann wird dieser nicht erkannt (also ich kann nicht auf den Server, ich werde von der Welt geworfen), wenn ich die eckigen Klammern weg lasse, funktioniert alles, nur mit Klammern halt nicht...
    habt ihr eine Idee, woran das liegt?

    Jeffry


    Vielen Vielen Vielen Dank :):love:


    Ich hätte jetzt nur noch 2 bzw. 1 Bitte,


    > wie macht man es dann man auf z.b. Slot1 nur 1 Fahrzeug haben kann.
    > Warum wird das Fahrzeug hier nicht angezeigt:



    if(strcmp(cmd, "/carkey", true) == 0)
    {
    if(MaxVeh[playerid] > 1)
    {
    CarKey[playerid] += 1;
    if(CarKey[playerid] == MaxVeh[playerid])
    {
    CarKey[playerid] = 0;
    }
    if(Carlist[playerid][CarKey[playerid]][Typ] != -1)
    {
    new index = -1;
    for(new i=0; i<sizeof(Kaufliste); i++)
    {
    if(Kaufliste[i][Modelid] == Carlist[playerid][CarKey[playerid]][Typ])
    {
    index = i;
    break;
    }
    }
    if(index == -1) format(string, sizeof(string), "* Du hast den %dten Auto-Schlüssel ausgewählt.", CarKey[playerid]+1);
    else format(string, sizeof(string), "* Du hast den %dten Auto-Schlüssel ausgewählt. (%s)", CarKey[playerid]+1,Kaufliste[index][Name]); //<--- Hier bei (%s)
    }
    else
    {
    format(string, sizeof(string), "* Du hast den %dten Auto-Schlüssel ausgewählt.",CarKey[playerid]+1);
    }
    SendClientMessage(playerid,COLOR_YELLOW,string);
    }
    return 1;
    }

    Jeffry



    public CreateTunedCar(playerid)
    {
    for(new s=0; s<MAX_CARS_PER_PLAYER; s++)
    {
    if(IsPlayerConnected(playerid) && Carlist[playerid][s][Typ]!=-1)
    {
    new carid=CreateVehicle(Kaufliste[Carlist[playerid][s][Typ]][Modelid],Carlist[playerid][s][X],Carlist[playerid][s][Y],Carlist[playerid][s][Z],Carlist[playerid][s][Rotation],-1,-1,-1);
    if(Carlist[playerid][s][Lock]==1)
    {
    SetVehicleParamsForAll(carid,0,1);
    SetVehicleParamsForPlayer(carid,playerid,0,0);
    }
    if(Carlist[playerid][s][mod1]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod1]); }
    if(Carlist[playerid][s][mod2]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod2]); }
    if(Carlist[playerid][s][mod3]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod3]); }
    if(Carlist[playerid][s][mod4]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod4]); }
    if(Carlist[playerid][s][mod5]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod5]); }
    if(Carlist[playerid][s][mod6]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod6]); }
    if(Carlist[playerid][s][mod7]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod7]); }
    if(Carlist[playerid][s][mod8]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod8]); }
    if(Carlist[playerid][s][mod9]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod9]); }
    if(Carlist[playerid][s][mod10]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod10]); }
    if(Carlist[playerid][s][mod11]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod11]); }
    if(Carlist[playerid][s][mod12]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod12]); }
    if(Carlist[playerid][s][mod13]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod13]); }
    if(Carlist[playerid][s][mod14]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod14]); }
    if(Carlist[playerid][s][mod15]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod15]); }
    if(Carlist[playerid][s][mod16]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod16]); }
    if(Carlist[playerid][s][mod17]!=-1) { AddVehicleComponent(carid,Carlist[playerid][s][mod17]); }
    if(Carlist[playerid][s][Paintjob]!=-1) { ChangeVehiclePaintjob(carid,Carlist[playerid][s][Paintjob]); }
    if(Carlist[playerid][s][Farbe1]!=-1) { ChangeVehicleColor(carid,Carlist[playerid][s][Farbe1],Carlist[playerid][s][Farbe2]); }
    return carid;
    }
    }
    return 1;
    }

    Jeffry


    Es wird bei mir über OnPlayerConnect geladen... :/


    public OnPlayerConnect(playerid)
    {
    new dateiname[MAX_PLAYER_NAME+25];
    new playername[MAX_PLAYER_NAME+25];
    for(new s=0; s<MAX_CARS_PER_PLAYER; s++)
    {
    Carlist[playerid][s][Typ]=-1; Carlist[playerid][s][X]=0.0; Carlist[playerid][s][Y]=0.0; Carlist[playerid][s][Z]=0.0;
    Carlist[playerid][s][Rotation]=0.0; Carlist[playerid][s][Status]=0; Carlist[playerid][s][Lock]=0; Carlist[playerid][s][Carid]=-1;
    Carlist[playerid][s][Farbe1]=-1; Carlist[playerid][s][Farbe2]=-1; Carlist[playerid][s][mod1]=-1; Carlist[playerid][s][mod2]=-1;
    Carlist[playerid][s][mod3]=-1; Carlist[playerid][s][mod4]=-1; Carlist[playerid][s][mod5]=-1; Carlist[playerid][s][mod6]=-1;
    Carlist[playerid][s][mod7]=-1; Carlist[playerid][s][mod8]=-1; Carlist[playerid][s][mod9]=-1; Carlist[playerid][s][mod10]=-1;
    Carlist[playerid][s][mod11]=-1; Carlist[playerid][s][mod12]=-1; Carlist[playerid][s][mod13]=-1; Carlist[playerid][s][mod14]=-1;
    Carlist[playerid][s][mod15]=-1; Carlist[playerid][s][mod16]=-1; Carlist[playerid][s][mod17]=-1; Carlist[playerid][s][Paintjob]=-1;
    }
    Spectating[playerid][0]=-1;
    #if defined CARSELL
    bietetAn[playerid]={-1,0};
    #endif
    GetPlayerName(playerid, playername, sizeof(playername));
    for(new s=0; s<MAX_CARS_PER_PLAYER; s++)
    {
    format(dateiname, sizeof(dateiname), "/GekaufteFahrzeuge/%s%d.car", playername,s);
    if (fexist(dateiname))
    {
    new File: CarFile = fopen(dateiname, io_read);
    if ( CarFile )
    {
    new key[ 256 ];
    new Data[ 256 ];
    while ( fread( CarFile , Data , sizeof( Data ) ) )
    {
    key = ini_GetKey(Data);
    if(strcmp(key,"AH_Typ",true)==0) { Carlist[playerid][s][Typ]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_X",true)==0) { Carlist[playerid][s][X]=floatstr(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Y",true)==0) { Carlist[playerid][s][Y]=floatstr(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Z",true)==0) { Carlist[playerid][s][Z]=floatstr(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Rot",true)==0) { Carlist[playerid][s][Rotation]=floatstr(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Status",true)==0) { Carlist[playerid][s][Status]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Lock",true)==0) { Carlist[playerid][s][Lock]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Paintjob",true)==0) { Carlist[playerid][s][Paintjob]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Farbe1",true)==0) { Carlist[playerid][s][Farbe1]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Farbe2",true)==0) { Carlist[playerid][s][Farbe2]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod1",true)==0) { Carlist[playerid][s][mod1]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod2",true)==0) { Carlist[playerid][s][mod2]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod3",true)==0) { Carlist[playerid][s][mod3]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod4",true)==0) { Carlist[playerid][s][mod4]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod5",true)==0) { Carlist[playerid][s][mod5]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod6",true)==0) { Carlist[playerid][s][mod6]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod7",true)==0) { Carlist[playerid][s][mod7]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod8",true)==0) { Carlist[playerid][s][mod8]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod9",true)==0) { Carlist[playerid][s][mod9]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod10",true)==0) { Carlist[playerid][s][mod10]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod11",true)==0) { Carlist[playerid][s][mod11]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod12",true)==0) { Carlist[playerid][s][mod12]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod13",true)==0) { Carlist[playerid][s][mod13]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod14",true)==0) { Carlist[playerid][s][mod14]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod15",true)==0) { Carlist[playerid][s][mod15]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod16",true)==0) { Carlist[playerid][s][mod16]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod17",true)==0) { Carlist[playerid][s][mod17]=strval(ini_GetValue(Data)); }
    }
    }
    fclose(CarFile);
    if(Carlist[playerid][s][Typ]!=-1 && Carlist[playerid][s][Status]==1)
    {
    Carlist[playerid][s][Carid]=CreateTunedCar(playerid);
    }
    }
    }
    SetTimerEx("DelaySetVehicleParams",10000,0,"i",playerid);
    return 1;
    }

    Jeffry



    public OnPlayerDisconnect(playerid)
    {
    new dateiname[MAX_PLAYER_NAME+25];
    new playername[MAX_PLAYER_NAME+25];
    new var[256];
    GetPlayerName(playerid, playername, sizeof(playername));
    for(new s=0; s<MAX_CARS_PER_PLAYER; s++)
    {
    format(dateiname, sizeof(dateiname), "/GekaufteFahrzeuge/%s%d.car", playername,s);
    new File: CarFile = fopen(dateiname, io_write);
    format(var, 256, "AH_Typ=%i\n", Carlist[playerid][s][Typ]); fwrite(CarFile, var);
    format(var, 256, "AH_X=%f\n", Carlist[playerid][s][X]); fwrite(CarFile, var);
    format(var, 256, "AH_Y=%f\n", Carlist[playerid][s][Y]); fwrite(CarFile, var);
    format(var, 256, "AH_Z=%f\n", Carlist[playerid][s][Z]); fwrite(CarFile, var);
    format(var, 256, "AH_Rot=%f\n", Carlist[playerid][s][Rotation]); fwrite(CarFile, var);
    format(var, 256, "AH_Status=%i\n", Carlist[playerid][s][Status]); fwrite(CarFile, var);
    format(var, 256, "AH_Lock=%i\n", Carlist[playerid][s][Lock]); fwrite(CarFile, var);
    format(var, 256, "AH_Paintjob=%i\n", Carlist[playerid][s][Paintjob]); fwrite(CarFile, var);
    format(var, 256, "AH_Farbe1=%i\n", Carlist[playerid][s][Farbe1]); fwrite(CarFile, var);
    format(var, 256, "AH_Farbe2=%i\n", Carlist[playerid][s][Farbe2]); fwrite(CarFile, var);
    format(var, 256, "AH_mod1=%i\n", Carlist[playerid][s][mod1]); fwrite(CarFile, var);
    format(var, 256, "AH_mod2=%i\n", Carlist[playerid][s][mod2]); fwrite(CarFile, var);
    format(var, 256, "AH_mod3=%i\n", Carlist[playerid][s][mod3]); fwrite(CarFile, var);
    format(var, 256, "AH_mod4=%i\n", Carlist[playerid][s][mod4]); fwrite(CarFile, var);
    format(var, 256, "AH_mod5=%i\n", Carlist[playerid][s][mod5]); fwrite(CarFile, var);
    format(var, 256, "AH_mod6=%i\n", Carlist[playerid][s][mod6]); fwrite(CarFile, var);
    format(var, 256, "AH_mod7=%i\n", Carlist[playerid][s][mod7]); fwrite(CarFile, var);
    format(var, 256, "AH_mod8=%i\n", Carlist[playerid][s][mod8]); fwrite(CarFile, var);
    format(var, 256, "AH_mod9=%i\n", Carlist[playerid][s][mod9]); fwrite(CarFile, var);
    format(var, 256, "AH_mod10=%i\n", Carlist[playerid][s][mod10]); fwrite(CarFile, var);
    format(var, 256, "AH_mod11=%i\n", Carlist[playerid][s][mod11]); fwrite(CarFile, var);
    format(var, 256, "AH_mod12=%i\n", Carlist[playerid][s][mod12]); fwrite(CarFile, var);
    format(var, 256, "AH_mod13=%i\n", Carlist[playerid][s][mod13]); fwrite(CarFile, var);
    format(var, 256, "AH_mod14=%i\n", Carlist[playerid][s][mod14]); fwrite(CarFile, var);
    format(var, 256, "AH_mod15=%i\n", Carlist[playerid][s][mod15]); fwrite(CarFile, var);
    format(var, 256, "AH_mod16=%i\n", Carlist[playerid][s][mod16]); fwrite(CarFile, var);
    format(var, 256, "AH_mod17=%i\n", Carlist[playerid][s][mod17]); fwrite(CarFile, var);
    fclose(CarFile);
    if(Carlist[playerid][s][Carid]!=-1)
    {
    SetVehicleParamsForAll(Carlist[playerid][s][Carid],0,0);
    DestroyVehicle(Carlist[playerid][s][Carid]);
    Carlist[playerid][s][Carid]=-1;
    }
    if (Spectating[playerid][0]!=-1)
    {
    SetVehicleParamsForAll(Kaufliste[Spectating[playerid][0]][Carid],0,0);
    Spectating[playerid][0]=-1;
    }
    }
    return 1;
    }

    Jeffry


    So, ich habe vergessen, den Schlüssel zu wechseln.
    Ich habe jetzt, jedoch das Problem wenn /parken mache dann werden auch die Fahrzeuge geparkt, jedoch, wenn ich wieder ingame gehe steht das Fahrzeug im Slot2 auf der Position von Slot1. Das Fahrzeug ist zudem das selbe wie in Slot1.
    Log:



    [16:29:41] s: 0
    [16:29:41] carid: 933 | inVeh: 933
    [16:30:27] s: 1
    [16:30:27] carid: 934 | inVeh: 934

    Jeffry


    so wird das geladen.



    public OnPlayerConnect(playerid)
    {
    new dateiname[MAX_PLAYER_NAME+25];
    new playername[MAX_PLAYER_NAME+25];
    for(new s=0; s<MAX_CARS_PER_PLAYER; s++)
    {
    Carlist[playerid][s][Typ]=-1; Carlist[playerid][s][X]=0.0; Carlist[playerid][s][Y]=0.0; Carlist[playerid][s][Z]=0.0;
    Carlist[playerid][s][Rotation]=0.0; Carlist[playerid][s][Status]=0; Carlist[playerid][s][Lock]=0; Carlist[playerid][s][Carid]=-1;
    Carlist[playerid][s][Farbe1]=-1; Carlist[playerid][s][Farbe2]=-1; Carlist[playerid][s][mod1]=-1; Carlist[playerid][s][mod2]=-1;
    Carlist[playerid][s][mod3]=-1; Carlist[playerid][s][mod4]=-1; Carlist[playerid][s][mod5]=-1; Carlist[playerid][s][mod6]=-1;
    Carlist[playerid][s][mod7]=-1; Carlist[playerid][s][mod8]=-1; Carlist[playerid][s][mod9]=-1; Carlist[playerid][s][mod10]=-1;
    Carlist[playerid][s][mod11]=-1; Carlist[playerid][s][mod12]=-1; Carlist[playerid][s][mod13]=-1; Carlist[playerid][s][mod14]=-1;
    Carlist[playerid][s][mod15]=-1; Carlist[playerid][s][mod16]=-1; Carlist[playerid][s][mod17]=-1; Carlist[playerid][s][Paintjob]=-1;
    }
    Spectating[playerid][0]=-1;
    #if defined CARSELL
    bietetAn[playerid]={-1,0};
    #endif
    GetPlayerName(playerid, playername, sizeof(playername));
    for(new s=0; s<MAX_CARS_PER_PLAYER; s++)
    {
    format(dateiname, sizeof(dateiname), "/GekaufteFahrzeuge/%s%d.car", playername,s);
    if (fexist(dateiname))
    {
    new File: CarFile = fopen(dateiname, io_read);
    if ( CarFile )
    {
    new key[ 256 ];
    new Data[ 256 ];
    while ( fread( CarFile , Data , sizeof( Data ) ) )
    {
    key = ini_GetKey(Data);
    if(strcmp(key,"AH_Typ",true)==0) { Carlist[playerid][s][Typ]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_X",true)==0) { Carlist[playerid][s][X]=floatstr(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Y",true)==0) { Carlist[playerid][s][Y]=floatstr(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Z",true)==0) { Carlist[playerid][s][Z]=floatstr(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Rot",true)==0) { Carlist[playerid][s][Rotation]=floatstr(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Status",true)==0) { Carlist[playerid][s][Status]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Lock",true)==0) { Carlist[playerid][s][Lock]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Paintjob",true)==0) { Carlist[playerid][s][Paintjob]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Farbe1",true)==0) { Carlist[playerid][s][Farbe1]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Farbe2",true)==0) { Carlist[playerid][s][Farbe2]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod1",true)==0) { Carlist[playerid][s][mod1]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod2",true)==0) { Carlist[playerid][s][mod2]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod3",true)==0) { Carlist[playerid][s][mod3]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod4",true)==0) { Carlist[playerid][s][mod4]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod5",true)==0) { Carlist[playerid][s][mod5]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod6",true)==0) { Carlist[playerid][s][mod6]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod7",true)==0) { Carlist[playerid][s][mod7]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod8",true)==0) { Carlist[playerid][s][mod8]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod9",true)==0) { Carlist[playerid][s][mod9]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod10",true)==0) { Carlist[playerid][s][mod10]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod11",true)==0) { Carlist[playerid][s][mod11]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod12",true)==0) { Carlist[playerid][s][mod12]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod13",true)==0) { Carlist[playerid][s][mod13]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod14",true)==0) { Carlist[playerid][s][mod14]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod15",true)==0) { Carlist[playerid][s][mod15]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod16",true)==0) { Carlist[playerid][s][mod16]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod17",true)==0) { Carlist[playerid][s][mod17]=strval(ini_GetValue(Data)); }
    }
    }
    fclose(CarFile);
    if(Carlist[playerid][s][Typ]!=-1 && Carlist[playerid][s][Status]==1)
    {
    Carlist[playerid][s][Carid]=CreateTunedCar(playerid);
    }
    }
    }
    SetTimerEx("DelaySetVehicleParams",10000,0,"i",playerid);
    return 1;
    }

    Jeffry


    Wenn ich bei dem 2. Fahrzeug /parken machen will kommt eine Fehlermeldung. (Du sitzt nicht in deinem eigenen Fahrzeug!)



    if(strcmp(cmd, "/parken", true) == 0)
    {
    new s = CarKey[playerid];
    if (IsPlayerInVehicle(playerid,Carlist[playerid][s][Carid]))
    {
    GetVehiclePos(Carlist[playerid][s][Carid],Carlist[playerid][s][X],Carlist[playerid][s][Y],Carlist[playerid][s][Z]);
    GetVehicleZAngle(Carlist[playerid][s][Carid],Carlist[playerid][s][Rotation]);
    SendClientMessage(playerid, COLOR_WHITE, "{FFFFFF}» Dein Fahrzeug wurde nun an dieser Position {006600}erfolgreich{FFFFFF} geparkt.");
    }
    else { SendClientMessage(playerid, COLOR_GRAD1, "Du sitzt nicht in deinem eigenen Fahrzeug!"); }
    return 1;
    }