| Personalausweis - Problem |

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Liebe Community,
    Ich habe das Problem das wenn ich mir einen Perso (Personalausweis) kaufe er solange im Spiel ist bis ich es beende, also er wird nicht gespeichert. Warum?, ich habe eigentlich alle eingefügt.


    Die Zeilen:


    (Der /persokaufen befehl)

    if (strcmp("/persokaufen", cmd, true) == 0)
    {
    if(PlayerInfo[playerid][pPersoStop] == 1)
    {
    SendClientMessage(playerid, COLOR_WHITE,"» Dein Antrag auf einen Personalausweis ist nocht nicht fertig. Bitte komm später wieder!");
    return 1;
    }
    if(PlayerInfo[playerid][pOwnPerso] == 1)
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Du hast bereits einen Personalsausweis!");
    return 1;
    }
    if(PlayerToPoint(4.0,playerid,362.6561,173.7679,1008.3828))
    {
    if(AllowPerso[playerid] == 1)
    {
    SendClientMessage(playerid, COLOR_WHITE, " ");
    SendClientMessage(playerid, COLOR_WHITE, "{00FF00}|{006600}=============== {FFFF00}Personalausweis Information{006600} ==============={00FF00}|{006600}");
    SendClientMessage(playerid, COLOR_YELLOW, "{FFFFFF}* Dein Personalausweis wurde erstellt.");
    SendClientMessage(playerid, COLOR_WHITE, "{FFFFFF}* Tipp /show um ihn vorzuzeigen!");
    SendClientMessage(playerid, COLOR_WHITE, "{FFFFFF}* Bearbeitungskosten: {FF0000}$500{FFFFFF}");
    SendClientMessage(playerid, COLOR_WHITE, " ");
    GivePlayerMoney(playerid,-500);
    PlayerInfo[playerid][pOwnPerso] = 1;
    TogglePlayerControllable(playerid, 1);
    return 1;
    }
    else if(AllowPerso[playerid] == 0)
    {
    SendClientMessage(playerid, COLOR_WHITE,"{FFFFFF}* Dein Antrag für einen Personalausweis wurde {006600}erfolgreich{FFFFFF} gestellt. In {FF0000}15{FFFFFF} Minuten kannst du ihn abholen! *");
    SetTimerEx("PersoAntrag", 900000, 0, "d", playerid);
    PlayerInfo[playerid][pPersoStop] = 1;
    TogglePlayerControllable(playerid, 1);
    //SetPlayerPos(playerid, 366.7451,173.8046,1008.3828);
    return 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Du bist nicht in der Stadthalle!");
    return 1;
    }
    }
    return 1;
    }


    (Die Rathaus-Information)

    public PersoAntrag(playerid)
    {
    SendClientMessage(playerid, COLOR_GREEN," ");
    SendClientMessage(playerid, COLOR_GREEN,"{00FF00}|{006600}=============== {FFFF00}Personalausweis Information{006600} ==============={00FF00}|{006600}");
    SendClientMessage(playerid, COLOR_RED,"{FFFFFF}» Dein Personalausweis ist nun fertiggestellt.");
    SendClientMessage(playerid, COLOR_RED, "{FFFFFF}» Sie können ihn nun in der Stadthalle abholen. ({FF0000}/navi{FFFFFF})");
    SendClientMessage(playerid, COLOR_GREEN," ");
    AllowPerso[playerid] = 1;
    PlayerInfo[playerid][pPersoStop] = 0;
    return 1;
    }


    (Bei OnPlayerConnect)

    PlayerInfo[playerid][pPersoStop] = 0;
    PlayerInfo[playerid][pOwnPerso] = 0;


    (Bei ShowStats)



    public ShowStats(playerid,targetid)
    {
    //new string[128];
    //new giveplayerid;
    if(PlayerInfo[playerid][pOwnPerso] == 0)
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Du besitzt keinen Personalausweis.");
    return 1;
    }
    if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
    {
    new cash = GetPlayerMoney(targetid);
    new atext[20];
    if(PlayerInfo[targetid][pSex] == 1) { atext = "männlich"; }
    else if(PlayerInfo[targetid][pSex] == 2) { atext = "weiblich"; }
    new otext[20];
    if(PlayerInfo[targetid][pOrigin] == 1) { otext = "USA"; }
    else if(PlayerInfo[targetid][pOrigin] == 2) { otext = "Europa"; }
    else if(PlayerInfo[targetid][pOrigin] == 3) { otext = "Asien"; }
    new ttext[20];
    if(PlayerInfo[targetid][pMember] == 4 || PlayerInfo[targetid][pLeader] == 4) { ttext = "Paramedic"; }
    else if(gTeam[targetid] == 3 || gTeam[targetid] == 4) { ttext = "Zivilist"; }
    else if(PlayerInfo[targetid][pMember] == 1 || PlayerInfo[targetid][pLeader] == 1) { ttext = "Officer"; }
    else if(PlayerInfo[targetid][pMember] == 2 || PlayerInfo[targetid][pLeader] == 2) { ttext = "Agent"; }
    else if(PlayerInfo[targetid][pMember] == 3 || PlayerInfo[targetid][pLeader] == 3) { ttext = "Soldat"; }
    else if(PlayerInfo[targetid][pMember] == 4 || PlayerInfo[targetid][pLeader] == 4) { ttext = "Paramedic"; }
    else if(PlayerInfo[targetid][pMember] == 5 || PlayerInfo[targetid][pLeader] == 5) { ttext = "Mafioso"; }
    else if(PlayerInfo[targetid][pMember] == 6 || PlayerInfo[targetid][pLeader] == 6) { ttext = "Triade"; }
    else if(PlayerInfo[targetid][pMember] == 8 || PlayerInfo[targetid][pLeader] == 8) { ttext = "Hitmen"; }
    else if(PlayerInfo[targetid][pMember] == 9 || PlayerInfo[targetid][pLeader] == 9) { ttext = "News Reporter"; }
    else if(PlayerInfo[targetid][pMember] == 10 || PlayerInfo[targetid][pLeader] == 10) { ttext = "Taxifahrer"; }
    else if(PlayerInfo[targetid][pMember] == 11 || PlayerInfo[targetid][pLeader] == 11) { ttext = "Fahrlehrer"; }
    else if(PlayerInfo[targetid][pMember] == 12 || PlayerInfo[targetid][pLeader] == 12) { ttext = "DaNang Boy"; }
    else if(PlayerInfo[targetid][pMember] == 13 || PlayerInfo[targetid][pLeader] == 13) { ttext = "Rifa Mitglied"; }
    else if(PlayerInfo[targetid][pMember] == 14 || PlayerInfo[targetid][pLeader] == 14) { ttext = "Ordnungshüter"; }
    new dtext[20];
    if(STDPlayer[targetid] == 1) { dtext = "Chlamydien"; }
    else if(STDPlayer[targetid] == 2) { dtext = "Gonorrhoe"; }
    else if(STDPlayer[targetid] == 3) { dtext = "Syphilis"; }
    else { dtext = "Keine"; }
    new ftext[20];
    if(PlayerInfo[targetid][pMember] == 4 || PlayerInfo[targetid][pLeader] == 4)
    { ftext = "Feuerwehr/Rettung"; }
    else if(PlayerInfo[targetid][pMember] == 5 || PlayerInfo[targetid][pLeader] == 5)
    { ftext = "Russische Mafia"; }
    else if(PlayerInfo[targetid][pMember] == 6 || PlayerInfo[targetid][pLeader] == 6)
    { ftext = "Triaden"; }
    else if(PlayerInfo[targetid][pMember] == 11 || PlayerInfo[targetid][pLeader] == 11)
    { ftext = "Lizensenvergeber"; }
    else
    { ftext = "None"; }
    new f2text[20];
    if(PlayerInfo[targetid][pFMember] < 255) { f2text = FamilyInfo[PlayerInfo[targetid][pFMember]][FamilyName]; }
    else { f2text = "Keine"; }
    new rtext[64];
    if(gTeam[targetid] == 5 || PlayerInfo[targetid][pFMember] < 255)//The 2 Organisations
    {
    if(PlayerInfo[targetid][pRank] == 1) { rtext = "Außenseiter"; }
    else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Associate"; }
    else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Soldat"; }
    else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Capo"; }
    else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Unterboss"; }
    else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Boss"; }
    else { rtext = "Outsider"; }
    }
    else if(PlayerInfo[targetid][pMember] == 1 || PlayerInfo[targetid][pLeader] == 1)//PD Ranks
    {
    if(PlayerInfo[targetid][pRank] == 1) { rtext = "Kadet"; }
    else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Officer"; }
    else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Sergeant"; }
    else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Leutnant"; }
    else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Captain"; }
    else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Chef"; }
    else { rtext = "Cadet"; }
    }
    else if(PlayerInfo[targetid][pMember] == 2 || PlayerInfo[targetid][pLeader] == 2)//FBI Ranks
    {
    if(PlayerInfo[targetid][pRank] == 1) { rtext = "Professional Staff"; }
    else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Spezialagent"; }
    else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Spezialagent 2"; }
    else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Spezialagent 3"; }
    else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Direktorassistent"; }
    else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Direktor"; }
    else { rtext = "Intern"; }
    }
    else if(PlayerInfo[targetid][pMember] == 3 || PlayerInfo[targetid][pLeader] == 3)//NG Ranks
    {
    if(PlayerInfo[targetid][pRank] == 1) { rtext = "Privat"; }
    else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Sergeant"; }
    else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Major"; }
    else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Captain"; }
    else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Leutnant"; }
    else if(PlayerInfo[targetid][pRank] == 6) { rtext = "General"; }
    else { rtext = "Privat"; }
    }
    else if(PlayerInfo[targetid][pMember] == 8 || PlayerInfo[targetid][pLeader] == 8)//Hitman Ranks
    {
    if(PlayerInfo[targetid][pRank] == 1) { rtext = "Freelancer"; }
    else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Marksman"; }
    else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Agent"; }
    else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Spezialagent"; }
    else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Fize-Direktor"; }
    else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Direktor"; }
    else { rtext = "Freelancer"; }
    }
    else if(PlayerInfo[targetid][pMember] == 9 || PlayerInfo[targetid][pLeader] == 9)//NR Ranks
    {
    if(PlayerInfo[targetid][pRank] == 1) { rtext = "Intern"; }
    else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Lokaler Reporter"; }
    else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Lokaler Editor"; }
    else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Netzwerk Anker"; }
    else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Netzwerk Editor"; }
    else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Netwerk Produzent"; }
    else { rtext = "Intern"; }
    }
    else if(PlayerInfo[targetid][pMember] == 10 || PlayerInfo[targetid][pLeader] == 10)//Taxi Company Ranks
    {
    if(PlayerInfo[targetid][pRank] == 1) { rtext = "Taxifahrlehrling"; }
    else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Taxifahrer"; }
    else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Cabbie"; }
    else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Dispatcher"; }
    else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Shift Supervisor"; }
    else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Taxi Firmeninhaber"; }
    else { rtext = "Trainee"; }
    }
    else if(PlayerInfo[targetid][pMember] == 12 || PlayerInfo[targetid][pLeader] == 12)//DaNang Boys
    {
    if(PlayerInfo[targetid][pRank] == 1) { rtext = "Nigga"; }
    else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Gangsta"; }
    else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Homie"; }
    else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Homie"; }
    else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Special Homie"; }
    else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Boss"; }
    else { rtext = "Trainee"; }
    }
    else if(PlayerInfo[targetid][pMember] == 12 || PlayerInfo[targetid][pLeader] == 12)//Rifa
    {
    if(PlayerInfo[targetid][pRank] == 1) { rtext = "Nigga"; }
    else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Gangsta"; }
    else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Homie"; }
    else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Homie"; }
    else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Special Homie"; }
    else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Boss"; }
    else { rtext = "Trainee"; }
    }
    else if(IsAnInstructor(targetid))//Driving/Flying School Ranks
    {
    if(PlayerInfo[targetid][pRank] == 1) { rtext = "Beamter"; }
    else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Beamter"; }
    else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Beamter"; }
    else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Beamter"; }
    else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Beamter"; }
    else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Beamter"; }
    else { rtext = "Trainee"; }
    }
    else if(PlayerInfo[targetid][pMember] == 14 || PlayerInfo[targetid][pLeader] == 14)//Fahrschule
    {
    if(PlayerInfo[targetid][pRank] == 1) { rtext = "Fahrlehrer"; }
    else if(PlayerInfo[targetid][pRank] == 2) { rtext = "Fahrlehrer 2"; }
    else if(PlayerInfo[targetid][pRank] == 3) { rtext = "Fahrlehrer 3"; }
    else if(PlayerInfo[targetid][pRank] == 4) { rtext = "Manager"; }
    else if(PlayerInfo[targetid][pRank] == 5) { rtext = "Unterboss"; }
    else if(PlayerInfo[targetid][pRank] == 6) { rtext = "Boss"; }
    else { rtext = "Trainee"; }
    }
    else
    {
    rtext = "Keiner";
    }
    new jtext[20];
    if(PlayerInfo[targetid][pJob] == 1) { jtext = "Detektiv"; }
    else if(PlayerInfo[targetid][pJob] == 2) { jtext = "Anwalt"; }
    else if(PlayerInfo[targetid][pJob] == 3) { jtext = "Hure"; }
    else if(PlayerInfo[targetid][pJob] == 4) { jtext = "Drogendealer"; }
    else if(PlayerInfo[targetid][pJob] == 5) { jtext = "Autodieb"; }
    else if(PlayerInfo[targetid][pJob] == 6) { jtext = "News Reporter"; }
    else if(PlayerInfo[targetid][pJob] == 7) { jtext = "Mechaniker"; }
    else if(PlayerInfo[targetid][pJob] == 8) { jtext = "Bodyguard"; }
    else if(PlayerInfo[targetid][pJob] == 9) { jtext = "Waffehändler"; }
    else if(PlayerInfo[targetid][pJob] == 10) { jtext = "Autohändler"; }
    else if(PlayerInfo[targetid][pJob] == 12) { jtext = "Boxer"; }
    else if(PlayerInfo[targetid][pJob] == 14) { jtext = "Busfahrer"; }
    else if(PlayerInfo[targetid][pJob] == 15) { jtext = "Zeitungsjunge"; }
    else if(PlayerInfo[targetid][pJob] == 16) { jtext = "Trucker"; }
    else { jtext = "Keiner"; }
    new drank[20];
    if(PlayerInfo[targetid][pDonateRank] == 1) { drank = "Power User"; }
    else if(PlayerInfo[targetid][pDonateRank] >= 2) { drank = "Donater"; }
    else { drank = "Keiner"; }
    new married[20];
    strmid(married, PlayerInfo[targetid][pMarriedTo], 0, strlen(PlayerInfo[targetid][pMarriedTo]), 255);
    new age = PlayerInfo[targetid][pAge];
    new ptime = PlayerInfo[targetid][pConnectTime];
    new lotto = PlayerInfo[targetid][pLottoNr];
    new deaths = PlayerInfo[targetid][pDeaths];
    new fishes = PlayerInfo[targetid][pFishes];
    new bigfish = PlayerInfo[targetid][pBiggestFish];
    new crimes = PlayerInfo[targetid][pCrimes];
    new arrests = PlayerInfo[targetid][pArrested];
    new warrests = PlayerInfo[targetid][pWantedDeaths];
    new drugs = PlayerInfo[targetid][pDrugs];
    new mats = PlayerInfo[targetid][pMats];
    new wanted = WantedLevel[targetid];
    new level = PlayerInfo[targetid][pLevel];
    new exp = PlayerInfo[targetid][pExp];
    new kills = PlayerInfo[targetid][pKills];
    new pnumber = PlayerInfo[targetid][pPnumber];
    new account = PlayerInfo[targetid][pAccount];
    new nxtlevel = PlayerInfo[targetid][pLevel]+1;
    new expamount = nxtlevel*levelexp;
    new costlevel = nxtlevel*levelcost;//10k for testing purposes
    new housekey = PlayerInfo[targetid][pPhousekey];
    new bizkey = PlayerInfo[targetid][pPbiskey];
    new intir = PlayerInfo[targetid][pInt];
    new local = PlayerInfo[targetid][pLocal];
    new Float:shealth = PlayerInfo[targetid][pSHealth];
    new Float:health;
    new name[MAX_PLAYER_NAME];
    GetPlayerName(targetid, name, sizeof(name));
    GetPlayerHealth(targetid,health);
    new Float:px,Float:py,Float:pz;
    GetPlayerPos(targetid, px, py, pz);
    new coordsstring[256];
    SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
    format(coordsstring, sizeof(coordsstring),"*** %s ***",name);
    SendClientMessage(playerid, COLOR_WHITE,coordsstring);
    format(coordsstring, sizeof(coordsstring), "Level:[%d] Geschlecht:[%s] Alter:[%d] Herkunft:[%s] Spawngesundheit:[%.1f] Geld:[%d$] Bank:[%d$] Ph:[%d]", level,atext,age,otext,shealth+50, cash, account, pnumber);
    SendClientMessage(playerid, COLOR_GRAD1,coordsstring);
    format(coordsstring, sizeof(coordsstring), "DonateRank:[%s] Verheiratet:[%s] Spielzeit:[%d] LottoNr:[%d] Job:[%s]", drank,married,ptime,lotto,jtext);
    SendClientMessage(playerid, COLOR_GRAD3,coordsstring);
    format(coordsstring, sizeof(coordsstring), "GefangeneFische:[%d] GrößterFisch:[%d] Verbrechen:[%d] Gefängniszeit:[%d] Wantedtode:[%d]", fishes,bigfish,crimes,arrests,warrests );
    SendClientMessage(playerid, COLOR_GRAD4,coordsstring);
    format(coordsstring, sizeof(coordsstring), "Kills:[%d] Deaths:[%d] NextLevel:[$%d] Respekt:[%d/%d] WantedLevel:[%d] Familie:[%s]",kills,deaths,costlevel,exp,expamount,wanted,f2text);
    SendClientMessage(playerid, COLOR_GRAD5,coordsstring);
    format(coordsstring, sizeof(coordsstring), "Drogen:[%d] Materialien:[%d] Team:[%s] Krankheit:[%s] Organisation:[%s] Rank:[%s]",drugs,mats,ttext,dtext,ftext,rtext);
    SendClientMessage(playerid, COLOR_GRAD5,coordsstring);
    if (PlayerInfo[playerid][pAdmin] >= 1)
    {
    format(coordsstring, sizeof(coordsstring), "Hausschlüssel [%d] Firemnschlüssel [%d] GeliehenerSchlüssel [%d] int:[%d] Ort [%d]", housekey,bizkey,HireCar[targetid],intir,local);
    SendClientMessage(playerid, COLOR_GRAD6,coordsstring);
    }
    SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
    }
    return 1;
    }


    (Bei OnPlayerRegister)

    format(var, 32, "Perso=%d\n",PlayerInfo[playerid][pOwnPerso]);fwrite(hFile, var);


    (Bei OnPlayerUpdate)

    format(var, 32, "Perso=%d\n",PlayerInfo[playerid][pOwnPerso]);fwrite(hFile, var);


    (Bei OnPlayerLogin)

    if( strcmp( key , "Perso" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pOwnPerso] = strval( val ); }}




    Vielleicht nützliche Info: Ich bekomme keine Errors.



    Ich hoffe ihr könnt helfen.




    MfG
    James.