Ban System geht nicht

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
  • Jeffry:
    Mir war nicht bewusst das es so groß wäre, dachte das geht schnell.
    Egal dann machen wir das halt so :>


    Hallo, irgendwie geht mein Ban befehl nicht.



    Das ist der Befehl:

    Spoiler anzeigen


    if(strcmp(cmd, "/ban", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "FEHLER: /ban [playerid] [grund]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    if (PlayerInfo[playerid][pAdmin] >= 1)
    {
    if(IsPlayerConnected(giveplayerid))
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    new length = strlen(cmdtext);
    while ((idx < length) && (cmdtext[idx] <= ' '))
    {
    idx++;
    }
    new offset = idx;
    new result[64];
    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
    {
    result[idx - offset] = cmdtext[idx];
    idx++;
    }
    result[idx - offset] = EOS;
    if(!strlen(result))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "FEHLER: /ban [playerid] [grund]");
    return 1;
    }
    if(PlayerInfo[giveplayerid][pAdmin] > PlayerInfo[playerid][pAdmin] > PlayerInfo[playerid][pSupporter])
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Du kannst diesen Spieler nicht bannen, da er ein höheres Adminlevel hat als du!");
    return 1;
    }
    new year, month,day;
    getdate(year, month, day);
    KickTimer(giveplayerid);
    format(string, sizeof(string), "AdmCmd: %s wurde von %s gebannt, Grund: %s (%d-%d-%d)", giveplayerid, sendername, (result),month,day,year);
    BanLog(string);
    format(string, sizeof(string), "AdmCmd: %s wurde von %s gebannt, Grund: %s", giveplayerid, sendername, (result));
    SendClientMessageToAll(COLOR_LIGHTRED, string);
    format(string, sizeof(string), "AdmCmd: Du wurdest von %s gebannt, Grund: %s", sendername, (result));
    SendClientMessage(giveplayerid,COLOR_LIGHTRED, string);
    PlayerInfo[giveplayerid][pGesperrt] = 1;
    return 1;
    }
    }//not connected
    }
    else
    {
    format(string, sizeof(string), " %d ist kein aktiver Spieler.", giveplayerid);
    SendClientMessage(playerid, COLOR_GRAD1, string);
    }
    }
    return 1;
    }


    Wenn er sich einloggt soll er gekickt werden :


    Bei OnPlayerLogin:

    if(PlayerInfo[playerid][pGesperrt] == 1)
    {
    format(string2,sizeof(string2)," %s versucht mit seinem gebannten Account online zu kommen und wurde gekickt!",playername2);
    ABroadCast(COLOR_LIGHTRED,string2,1);
    SendClientMessage(playerid,COLOR_ROT," Du bist hier gebannt. Schau im Forum für mehr Informationen");
    Kick(playerid);
    return 1;
    }


    So lese ich das aus bei OnPlayerLogin:
    PlayerInfo[playerid][pGesperrt] = dini_Int(string2, "Gesperrt");


    Aber ich kann mich trotzdem wieder einloggen.
    Warum das ? :/

  • MoD



    forward KickTimer(playerid);
    new oKick = 0;


    public KickTimer(playerid)
    {
    if(oKick == 0)
    {
    SetTimerEx("KickTimer",200,false,"i",playerid);
    oKick = 1;
    }
    else if(oKick == 1)
    {
    Kick(playerid);
    oKick = 0;
    }
    return 1;
    }


    Das ist der



    #edit ich glaub ich habs gefunden :>
    Wenn ich mich banne, steht in der .ini nicht Gesperrt = 1
    Hab unter OnPlayerUpdate das gefunden.


    format(var, 32, "Gesperrt=%d\n",PlayerInfo[playerid][pGesperrt]);fwrite(hFile, var);
    Jeffry: hat mir das mal gesagt.

    Einmal editiert, zuletzt von Saphire ()

  • Beitrag von MoD ()

    Dieser Beitrag wurde gelöscht, Informationen über den Löschvorgang sind nicht verfügbar.
  • Jeffry:


    Hab das so im Ban befehl



    SendClientMessageToAll(COLOR_LIGHTRED, string);
    format(string, sizeof(string), "AdmCmd: Du wurdest von %s gebannt, Grund: %s", sendername, (result));
    SendClientMessage(giveplayerid,COLOR_LIGHTRED, string);
    PlayerInfo[giveplayerid][pGesperrt] = 1;
    OnPlayerUpdate(playerid);
    return 1;


    Hat aber nichts gebracht.


    mfg

  • Jeffry:


    Spoiler anzeigen


    new string2[128];
    new playername2[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername2, sizeof(playername2));
    format(string2, sizeof(string2), "/Accounts/%s.ini", playername2);
    new File: UserFile = fopen(string2, io_read);
    if ( UserFile )
    {
    new valtmp[256];
    valtmp = dini_Get(string2, "Key");
    strmid(PlayerInfo[playerid][pKey], valtmp, 0, strlen(valtmp), 255);
    if(strcmp(PlayerInfo[playerid][pKey],password, true ) == 0 )
    {
    PlayerInfo[playerid][pLevel] = dini_Int(string2, "Level");
    PlayerInfo[playerid][pAdmin] = dini_Int(string2, "AdminLevel");
    PlayerInfo[playerid][pSupporter] = dini_Int(string2, "Supporter");
    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][pPlayerKredit] = dini_Int(string2, "Kredit");
    PlayerInfo[playerid][pPlayerKreditDauer] = dini_Int(string2, "KreditDauer");
    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][pGangJailed] = dini_Int(string2, "GangJailed");
    PlayerInfo[playerid][pMauled] = dini_Int(string2, "Mauled");
    PlayerInfo[playerid][pJailTime] = dini_Int(string2, "JailTime");
    PlayerInfo[playerid][pMats] = dini_Int(string2, "Materials");
    PlayerInfo[playerid][pDrugs] = dini_Int(string2, "Drugs");
    PlayerInfo[playerid][pBoxMats] = dini_Int(string2, "BoxMaterials");
    PlayerInfo[playerid][pBoxDrugs] = dini_Int(string2, "BoxDrugs");
    SetPlayerFightingStyle(playerid, dini_Int(string2, "FightingStyle"));
    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, "pFishSkill");
    PlayerInfo[playerid][pSHealth] = dini_Float(string2, "pSHealth");
    PlayerInfo[playerid][pHealth] = dini_Float(string2, "pHealth");
    PlayerInfo[playerid][pInt] = dini_Int(string2, "pInt");
    PlayerInfo[playerid][pLocal] = dini_Int(string2, "pLocal");
    PlayerInfo[playerid][pTeam] = dini_Int(string2, "pTeam");
    PlayerInfo[playerid][pModel] = dini_Int(string2, "pModel");
    PlayerInfo[playerid][pPnumber] = dini_Int(string2, "PhoneNr");
    PlayerInfo[playerid][pPhousekey] = dini_Int(string2, "House");
    PlayerInfo[playerid][pPbiskey] = dini_Int(string2, "Bizz");
    PlayerInfo[playerid][pHandyGeld] = dini_Int(string2, "HandyGeld");
    PlayerInfo[playerid][pHandyVer] = dini_Int(string2, "HandyVer");
    PlayerInfo[playerid][pPos_x] = dini_Float(string2, "Pos_x");
    PlayerInfo[playerid][pPos_y] = dini_Float(string2, "Pos_y");
    PlayerInfo[playerid][pPos_z] = dini_Float(string2, "Pos_z");
    PlayerInfo[playerid][pCarLic] = dini_Int(string2, "CarLic");
    PlayerInfo[playerid][pNewLic] = dini_Int(string2, "NewLic");
    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][pLKWLic] = dini_Int(string2, "LKWLic");
    PlayerInfo[playerid][pRollerLic] = dini_Int(string2, "RollerLic");
    PlayerInfo[playerid][pMotoLic] = dini_Int(string2, "MotoLic");
    PlayerInfo[playerid][pZig] = dini_Int(string2, "Zig");
    PlayerInfo[playerid][pKekse] = dini_Int(string2, "Kekse");
    PlayerInfo[playerid][pZigSucht] = dini_Int(string2, "ZigSucht");
    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][pMulltime] = dini_Int(string2, "Mulltime");
    PlayerInfo[playerid][pPayDay] = dini_Int(string2, "PayDay");
    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][pWarns] = dini_Int(string2, "Warnings");
    PlayerInfo[playerid][pAdjustable] = dini_Int(string2, "Adjustable");
    PlayerInfo[playerid][pFuel] = dini_Int(string2, "Fuel");
    PlayerInfo[playerid][pMarried] = dini_Int(string2, "Married");
    PlayerInfo[playerid][pMarriedTo] = dini_Int(string2, "MarriedTo");
    SpawnChange[playerid] = dini_Int(string2, "SpawnChange");
    WantedLevel[playerid] = dini_Int(string2, "WantedLevel");
    WantedLevel[playerid] = dini_Int(string2, "WantedPoints");
    PlayerInfo[playerid][pPlayMinutes] = dini_Int(string2, "PlayMinutes");
    PlayerInfo[playerid][pGesamtMinutes] = dini_Int(string2, "GesamtMinutes");
    PlayerInfo[playerid][pMinutesSinceAn] = dini_Int(string2, "MinutesSinceAn");
    OfflineFlucht[playerid] = dini_Int(string2, "Offflucht");
    Knast[playerid] = dini_Int(string2, "Knast");
    PlayerInfo[playerid][pHandyID] = dini_Int(string2, "Handy");
    PlayerInfo[playerid][pUhrID] = dini_Int(string2, "Uhr");
    KnastTime[playerid] = dini_Int(string2, "KnastTime");
    PlayerInfo[playerid][pOwnPerso] = dini_Int(string2, "Perso");
    PlayerInfo[playerid][pFrakSperre] = dini_Int(string2, "FrakSperre");
    PlayerInfo[playerid][pGehalt] = dini_Int(string2, "Gehalt");
    PlayerInfo[playerid][pInvWeapon] = dini_Int(string2, "InvWeapon");
    PlayerInfo[playerid][pInvAmmo] = dini_Int(string2, "InvAmmo");
    PlayerInfo[playerid][pInvWeapon2] = dini_Int(string2, "InvWeapon2");
    PlayerInfo[playerid][pInvAmmo2] = dini_Int(string2, "InvAmmo2");
    PlayerInfo[playerid][pInvMats] = dini_Int(string2, "InvMats");
    PlayerInfo[playerid][pInvDrugs] = dini_Int(string2, "InvDrugs");
    PlayerInfo[playerid][pFlugTime] = dini_Int(string2, "FlugTime");
    PlayerInfo[playerid][pFarmTime] = dini_Int(string2, "FarmTime");
    PlayerInfo[playerid][pGDeaths] = dini_Int(string2, "GDeaths");
    PlayerInfo[playerid][pGKills] = dini_Int(string2, "GKills");
    PlayerInfo[playerid][pGWD] = dini_Float(string2, "GWD");
    PlayerInfo[playerid][pMeldung] = dini_Int(string2, "Meldung");
    PlayerInfo[playerid][pPtankekey] = dini_Int(string2, "Tanke");
    PlayerInfo[playerid][pGesperrt] = dini_Int(string2, "Gesperrt");
    PlayerInfo[playerid][Punkte] = dini_Int(string2, "Punkte");


    und das hier :


    Spoiler anzeigen


    if(IsPlayerConnected(playerid))
    {
    if(gPlayerLogged[playerid])
    {
    new string3[64];
    new playername3[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername3, sizeof(playername3));
    format(string3, sizeof(string3), "/Accounts/%s.ini", playername3);
    new File: hFile = fopen(string3, io_write);
    if (hFile)
    {
    new var[32];
    format(var, 32, "Key=%s\n", PlayerInfo[playerid][pKey]);fwrite(hFile, var);
    PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
    format(var, 32, "Level=%d\n",PlayerInfo[playerid][pLevel]);fwrite(hFile, var);
    format(var, 32, "AdminLevel=%d\n",PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
    format(var, 32, "Supporter=%d\n",PlayerInfo[playerid][pSupporter]);fwrite(hFile, var);
    format(var, 32, "DonateRank=%d\n",PlayerInfo[playerid][pDonateRank]);fwrite(hFile, var);
    format(var, 32, "UpgradePoints=%d\n",PlayerInfo[playerid][gPupgrade]);fwrite(hFile, var);
    format(var, 32, "ConnectedTime=%d\n",PlayerInfo[playerid][pConnectTime]);fwrite(hFile, var);
    format(var, 32, "Registered=%d\n",PlayerInfo[playerid][pReg]);fwrite(hFile, var);
    format(var, 32, "Sex=%d\n",PlayerInfo[playerid][pSex]);fwrite(hFile, var);
    format(var, 32, "Age=%d\n",PlayerInfo[playerid][pAge]);fwrite(hFile, var);
    format(var, 32, "Origin=%d\n",PlayerInfo[playerid][pOrigin]);fwrite(hFile, var);
    format(var, 32, "CK=%d\n",PlayerInfo[playerid][pCK]);fwrite(hFile, var);
    format(var, 32, "Muted=%d\n",PlayerInfo[playerid][pMuted]);fwrite(hFile, var);
    format(var, 32, "Respect=%d\n",PlayerInfo[playerid][pExp]);fwrite(hFile, var);
    format(var, 32, "Money=%d\n",PlayerInfo[playerid][pCash]);fwrite(hFile, var);
    format(var, 32, "Bank=%d\n",PlayerInfo[playerid][pAccount]);fwrite(hFile, var);
    format(var, 32, "Kredit=%d\n",PlayerInfo[playerid][pPlayerKredit]);fwrite(hFile, var);
    format(var, 32, "KreditDauer=%d\n",PlayerInfo[playerid][pPlayerKreditDauer]);fwrite(hFile, var);
    format(var, 32, "Crimes=%d\n",PlayerInfo[playerid][pCrimes]);fwrite(hFile, var);
    format(var, 32, "Kills=%d\n",PlayerInfo[playerid][pKills]);fwrite(hFile, var);
    format(var, 32, "Deaths=%d\n",PlayerInfo[playerid][pDeaths]);fwrite(hFile, var);
    format(var, 32, "Arrested=%d\n",PlayerInfo[playerid][pArrested]);fwrite(hFile, var);
    format(var, 32, "WantedDeaths=%d\n",PlayerInfo[playerid][pWantedDeaths]);fwrite(hFile, var);
    format(var, 32, "Phonebook=%d\n",PlayerInfo[playerid][pPhoneBook]);fwrite(hFile, var);
    format(var, 32, "LottoNr=%d\n",PlayerInfo[playerid][pLottoNr]);fwrite(hFile, var);
    format(var, 32, "Fishes=%d\n",PlayerInfo[playerid][pFishes]);fwrite(hFile, var);
    format(var, 32, "BiggestFish=%d\n",PlayerInfo[playerid][pBiggestFish]);fwrite(hFile, var);
    format(var, 32, "Job=%d\n",PlayerInfo[playerid][pJob]);fwrite(hFile, var);
    format(var, 32, "Paycheck=%d\n",PlayerInfo[playerid][pPayCheck]);fwrite(hFile, var);
    format(var, 32, "HeadValue=%d\n",PlayerInfo[playerid][pHeadValue]);fwrite(hFile, var);
    format(var, 32, "Jailed=%d\n",PlayerInfo[playerid][pJailed]);fwrite(hFile, var);
    format(var, 32, "GangJailed=%d\n",PlayerInfo[playerid][pGangJailed]);fwrite(hFile, var);
    format(var, 32, "Mauled=%d\n",PlayerInfo[playerid][pMauled]);fwrite(hFile, var);
    format(var, 32, "JailTime=%d\n",PlayerInfo[playerid][pJailTime]);fwrite(hFile, var);
    format(var, 32, "Materials=%d\n",PlayerInfo[playerid][pMats]);fwrite(hFile, var);
    format(var, 32, "Drugs=%d\n",PlayerInfo[playerid][pDrugs]);fwrite(hFile, var);
    format(var, 32, "BoxMaterials=%d\n",PlayerInfo[playerid][pBoxMats]);fwrite(hFile, var);
    format(var, 32, "BoxDrugs=%d\n",PlayerInfo[playerid][pBoxDrugs]);fwrite(hFile, var);
    format(var, 32, "FightingStyle=%d\n",GetPlayerFightingStyle(playerid));fwrite(hFile, var);
    format(var, 32, "Leader=%d\n",PlayerInfo[playerid][pLeader]);fwrite(hFile, var);
    format(var, 32, "Member=%d\n",PlayerInfo[playerid][pMember]);fwrite(hFile, var);
    format(var, 32, "FMember=%d\n",PlayerInfo[playerid][pFMember]);fwrite(hFile, var);
    format(var, 32, "Rank=%d\n",PlayerInfo[playerid][pRank]);fwrite(hFile, var);
    format(var, 32, "Char=%d\n",PlayerInfo[playerid][pChar]);fwrite(hFile, var);
    format(var, 32, "ContractTime=%d\n",PlayerInfo[playerid][pContractTime]);fwrite(hFile, var);
    format(var, 32, "DetSkill=%d\n",PlayerInfo[playerid][pDetSkill]);fwrite(hFile, var);
    format(var, 32, "SexSkill=%d\n",PlayerInfo[playerid][pSexSkill]);fwrite(hFile, var);
    format(var, 32, "BoxSkill=%d\n",PlayerInfo[playerid][pBoxSkill]);fwrite(hFile, var);
    format(var, 32, "LawSkill=%d\n",PlayerInfo[playerid][pLawSkill]);fwrite(hFile, var);
    format(var, 32, "MechSkill=%d\n",PlayerInfo[playerid][pMechSkill]);fwrite(hFile, var);
    format(var, 32, "JackSkill=%d\n",PlayerInfo[playerid][pJackSkill]);fwrite(hFile, var);
    format(var, 32, "CarSkill=%d\n",PlayerInfo[playerid][pCarSkill]);fwrite(hFile, var);
    format(var, 32, "NewsSkill=%d\n",PlayerInfo[playerid][pNewsSkill]);fwrite(hFile, var);
    format(var, 32, "DrugsSkill=%d\n",PlayerInfo[playerid][pDrugsSkill]);fwrite(hFile, var);
    format(var, 32, "CookSkill=%d\n",PlayerInfo[playerid][pCookSkill]);fwrite(hFile, var);
    format(var, 32, "FishSkill=%d\n",PlayerInfo[playerid][pFishSkill]);fwrite(hFile, var);
    format(var, 32, "pSHealth=%.1f\n",PlayerInfo[playerid][pSHealth]);fwrite(hFile, var);
    GetPlayerHealth(playerid,PlayerInfo[playerid][pHealth]);
    format(var, 32, "pHealth=%.1f\n",PlayerInfo[playerid][pHealth]);fwrite(hFile, var);
    format(var, 32, "Int=%d\n",PlayerInfo[playerid][pInt]);fwrite(hFile, var);
    format(var, 32, "Local=%d\n",PlayerInfo[playerid][pLocal]);fwrite(hFile, var);
    format(var, 32, "Team=%d\n",PlayerInfo[playerid][pTeam]);fwrite(hFile, var);
    format(var, 32, "Model=%d\n",PlayerInfo[playerid][pModel]);fwrite(hFile, var);
    format(var, 32, "GWD=%f\n",PlayerInfo[playerid][pGWD]);fwrite(hFile, var);
    format(var, 32, "PhoneNr=%d\n",PlayerInfo[playerid][pPnumber]);fwrite(hFile, var);
    format(var, 32, "House=%d\n",PlayerInfo[playerid][pPhousekey]);fwrite(hFile, var);
    format(var, 32, "Bizz=%d\n",PlayerInfo[playerid][pPbiskey]);fwrite(hFile, var);
    format(var, 32, "HandyGeld=%d\n",PlayerInfo[playerid][pHandyGeld]);fwrite(hFile, var);
    format(var, 32, "HandyVer=%d\n",PlayerInfo[playerid][pHandyVer]);fwrite(hFile, var);
    format(var, 32, "Punkte=%i\n",PlayerInfo[playerid][Punkte]);fwrite(hFile, var);
    if ((PlayerInfo[playerid][pPos_x]==0.0 && PlayerInfo[playerid][pPos_y]==0.0 && PlayerInfo[playerid][pPos_z]==0.0))
    {
    PlayerInfo[playerid][pPos_x] = 1684.9;
    PlayerInfo[playerid][pPos_y] = -2244.5;
    PlayerInfo[playerid][pPos_z] = 13.5;
    }
    if(Spectate[playerid] != 255)
    {
    PlayerInfo[playerid][pPos_x] = Unspec[playerid][sPx];
    PlayerInfo[playerid][pPos_y] = Unspec[playerid][sPy];
    PlayerInfo[playerid][pPos_z] = Unspec[playerid][sPz];
    PlayerInfo[playerid][pInt] = Unspec[playerid][sPint];
    PlayerInfo[playerid][pLocal] = Unspec[playerid][sLocal];
    }
    format(var, 32, "Pos_x=%.1f\n",PlayerInfo[playerid][pPos_x]);fwrite(hFile, var);
    format(var, 32, "Pos_y=%.1f\n",PlayerInfo[playerid][pPos_y]);fwrite(hFile, var);
    format(var, 32, "Pos_z=%.1f\n",PlayerInfo[playerid][pPos_z]);fwrite(hFile, var);
    format(var, 32, "CarLic=%d\n",PlayerInfo[playerid][pCarLic]);fwrite(hFile, var);
    format(var, 32, "NewLic=%d\n",PlayerInfo[playerid][pNewLic]);fwrite(hFile, var);
    format(var, 32, "FlyLic=%d\n",PlayerInfo[playerid][pFlyLic]);fwrite(hFile, var);
    format(var, 32, "BoatLic=%d\n",PlayerInfo[playerid][pBoatLic]);fwrite(hFile, var);
    format(var, 32, "FishLic=%d\n",PlayerInfo[playerid][pFishLic]);fwrite(hFile, var);
    format(var, 32, "GunLic=%d\n",PlayerInfo[playerid][pGunLic]);fwrite(hFile, var);// hier wird aller 30 min alles geupdated und gespeichert
    format(var, 32, "LKWLic=%d\n",PlayerInfo[playerid][pLKWLic]);fwrite(hFile, var);
    format(var, 32, "RollerLic=%d\n",PlayerInfo[playerid][pRollerLic]);fwrite(hFile, var);
    format(var, 32, "MotoLic=%d\n",PlayerInfo[playerid][pMotoLic]);fwrite(hFile, var);
    format(var, 32, "Zig=%d\n",PlayerInfo[playerid][pZig]);fwrite(hFile, var);
    format(var, 32, "Kekse=%d\n",PlayerInfo[playerid][pKekse]);fwrite(hFile, var);
    format(var, 32, "ZigSucht=%d\n",PlayerInfo[playerid][pZigSucht]);fwrite(hFile, var);
    format(var, 32, "Gun1=%d\n",PlayerInfo[playerid][pGun1]);fwrite(hFile, var);
    format(var, 32, "Gun2=%d\n",PlayerInfo[playerid][pGun2]);fwrite(hFile, var);
    format(var, 32, "Gun3=%d\n",PlayerInfo[playerid][pGun3]);fwrite(hFile, var);
    format(var, 32, "Gun4=%d\n",PlayerInfo[playerid][pGun4]);fwrite(hFile, var);
    format(var, 32, "Ammo1=%d\n",PlayerInfo[playerid][pAmmo1]);fwrite(hFile, var);
    format(var, 32, "Ammo2=%d\n",PlayerInfo[playerid][pAmmo2]);fwrite(hFile, var);
    format(var, 32, "Ammo3=%d\n",PlayerInfo[playerid][pAmmo3]);fwrite(hFile, var);
    format(var, 32, "Ammo4=%d\n",PlayerInfo[playerid][pAmmo4]);fwrite(hFile, var);
    format(var, 32, "CarTime=%d\n",PlayerInfo[playerid][pCarTime]);fwrite(hFile, var);
    format(var, 32, "Mulltime=%d\n",PlayerInfo[playerid][pMulltime]);fwrite(hFile, var);
    format(var, 32, "PayDay=%d\n",PlayerInfo[playerid][pPayDay]);fwrite(hFile, var);
    format(var, 32, "PayDayHad=%d\n",PlayerInfo[playerid][pPayDayHad]);fwrite(hFile, var);
    format(var, 32, "CDPlayer=%d\n",PlayerInfo[playerid][pCDPlayer]);fwrite(hFile, var);
    format(var, 32, "Wins=%d\n",PlayerInfo[playerid][pWins]);fwrite(hFile, var);
    format(var, 32, "Loses=%d\n",PlayerInfo[playerid][pLoses]);fwrite(hFile, var);
    format(var, 32, "AlcoholPerk=%d\n",PlayerInfo[playerid][pAlcoholPerk]);fwrite(hFile, var);
    format(var, 32, "DrugPerk=%d\n",PlayerInfo[playerid][pDrugPerk]);fwrite(hFile, var);
    format(var, 32, "MiserPerk=%d\n",PlayerInfo[playerid][pMiserPerk]);fwrite(hFile, var);
    format(var, 32, "PainPerk=%d\n",PlayerInfo[playerid][pPainPerk]);fwrite(hFile, var);
    format(var, 32, "TraderPerk=%d\n",PlayerInfo[playerid][pTraderPerk]);fwrite(hFile, var);
    format(var, 32, "Tutorial=%d\n",PlayerInfo[playerid][pTut]);fwrite(hFile, var);
    format(var, 32, "Warnings=%d\n",PlayerInfo[playerid][pWarns]);fwrite(hFile, var);
    format(var, 32, "Adjustable=%d\n",PlayerInfo[playerid][pAdjustable]);fwrite(hFile, var);
    format(var, 32, "Fuel=%d\n",PlayerInfo[playerid][pFuel]);fwrite(hFile, var);
    format(var, 32, "Married=%d\n",PlayerInfo[playerid][pMarried]);fwrite(hFile, var);
    format(var, 32, "MarriedTo=%s\n",PlayerInfo[playerid][pMarriedTo]);fwrite(hFile, var);
    format(var, 32, "SpawnChange=%d\n",SpawnChange[playerid]);fwrite(hFile, var);
    format(var, 32, "WantedLevel=%d\n",WantedLevel[playerid]);fwrite(hFile, var);
    format(var, 32, "WantedPoints=%d\n",WantedPoints[playerid]);fwrite(hFile, var);
    format(var, 32, "PlayMinutes=%d\n",PlayerInfo[playerid][pPlayMinutes]);fwrite(hFile, var);
    format(var, 32, "GesamtMinutes=%d\n",PlayerInfo[playerid][pGesamtMinutes]);fwrite(hFile, var);
    format(var, 32, "MinutesSinceAn=%d\n",PlayerInfo[playerid][pMinutesSinceAn]);fwrite(hFile, var);
    format(var, 32, "SFPASS=%d\n",PlayerInfo[playerid][pSFPASS]);fwrite(hFile, var);
    format(var, 32, "LVPASS=%d\n",PlayerInfo[playerid][pLVPASS]);fwrite(hFile, var);
    format(var, 32, "Offflucht=%d\n",OfflineFlucht[playerid]);fwrite(hFile, var);
    format(var, 32, "Knast=%d\n",Knast[playerid]);fwrite(hFile, var);
    format(var, 32, "Uhr=%d\n",PlayerInfo[playerid][pUhrID]);fwrite(hFile, var);
    format(var, 32, "Handy=%d\n",PlayerInfo[playerid][pHandyID]);fwrite(hFile, var);
    format(var, 32, "KnastTime=%d\n",KnastTime[playerid]);fwrite(hFile, var);
    format(var, 32, "Perso=%d\n",PlayerInfo[playerid][pOwnPerso]);fwrite(hFile, var);
    format(var, 32, "FrakSperre=%d\n",PlayerInfo[playerid][pFrakSperre]);fwrite(hFile, var);
    format(var, 32, "Gehalt=%d\n",PlayerInfo[playerid][pGehalt]);fwrite(hFile, var);
    format(var, 32, "InvWeapon=%d\n",PlayerInfo[playerid][pInvWeapon]);fwrite(hFile, var);
    format(var, 32, "InvAmmo=%d\n",PlayerInfo[playerid][pInvAmmo]);fwrite(hFile, var);
    format(var, 32, "InvWeapon2=%d\n",PlayerInfo[playerid][pInvWeapon2]);fwrite(hFile, var);
    format(var, 32, "InvAmmo2=%d\n",PlayerInfo[playerid][pInvAmmo2]);fwrite(hFile, var);
    format(var, 32, "InvMats=%d\n",PlayerInfo[playerid][pInvMats]);fwrite(hFile, var);
    format(var, 32, "InvDrugs=%d\n",PlayerInfo[playerid][pInvDrugs]);fwrite(hFile, var);
    format(var, 32, "FlugTime=%d\n",PlayerInfo[playerid][pFlugTime]);fwrite(hFile, var);
    format(var, 32, "FarmTime=%d\n",PlayerInfo[playerid][pFarmTime]);fwrite(hFile, var);
    format(var, 32, "GDeaths=%d\n",PlayerInfo[playerid][pGDeaths]);fwrite(hFile, var);
    format(var, 32, "GKills=%d\n",PlayerInfo[playerid][pGKills]);fwrite(hFile, var);
    format(var, 32, "Meldung=%d\n",PlayerInfo[playerid][pMeldung]);fwrite(hFile, var);
    format(var, 32, "Tanke=%d\n",PlayerInfo[playerid][pPtankekey]);fwrite(hFile, var);
    format(var, 32, "Gesperrt=%d\n",PlayerInfo[playerid][pGesperrt]);fwrite(hFile, var);
    new weapons[13];
    new ammo[13];

  • Das ist soweit alles richtig, das gesperrt muss auch in der Datei stehen, du schreibst es ja rein. Ob es da mit 0 oder 1 steht ist was anderes, aber es muss drin stehen, schau da mal nochmal nach.


    Steht die Abfrage, ob der Spieler gebannt ist direkt nach dem Laden der Spieler Stats, oder wo im Code steht das? Poste das bitte mal zusammenhängend, weil wenn da zuvor zum Beispiel ein return ist, dann würde es nichts bringen.

  • Jeffry:
    Ja Gesperrt ist in der Datei, ich meinte oben aber das da "1" nicht steht sondern 0.


    Und hier OnPlayerLogin:


    Spoiler anzeigen


    new string2[128];
    new playername2[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername2, sizeof(playername2));
    format(string2, sizeof(string2), "/Accounts/%s.ini", playername2);
    new File: UserFile = fopen(string2, io_read);
    if ( UserFile )
    {
    new valtmp[256];
    valtmp = dini_Get(string2, "Key");
    strmid(PlayerInfo[playerid][pKey], valtmp, 0, strlen(valtmp), 255);
    if(strcmp(PlayerInfo[playerid][pKey],password, true ) == 0 )
    {
    PlayerInfo[playerid][pLevel] = dini_Int(string2, "Level");
    PlayerInfo[playerid][pAdmin] = dini_Int(string2, "AdminLevel");
    PlayerInfo[playerid][pSupporter] = dini_Int(string2, "Supporter");
    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][pPlayerKredit] = dini_Int(string2, "Kredit");
    PlayerInfo[playerid][pPlayerKreditDauer] = dini_Int(string2, "KreditDauer");
    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][pGangJailed] = dini_Int(string2, "GangJailed");
    PlayerInfo[playerid][pMauled] = dini_Int(string2, "Mauled");
    PlayerInfo[playerid][pJailTime] = dini_Int(string2, "JailTime");
    PlayerInfo[playerid][pMats] = dini_Int(string2, "Materials");
    PlayerInfo[playerid][pDrugs] = dini_Int(string2, "Drugs");
    PlayerInfo[playerid][pBoxMats] = dini_Int(string2, "BoxMaterials");
    PlayerInfo[playerid][pBoxDrugs] = dini_Int(string2, "BoxDrugs");
    SetPlayerFightingStyle(playerid, dini_Int(string2, "FightingStyle"));
    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, "pFishSkill");
    PlayerInfo[playerid][pSHealth] = dini_Float(string2, "pSHealth");
    PlayerInfo[playerid][pHealth] = dini_Float(string2, "pHealth");
    PlayerInfo[playerid][pInt] = dini_Int(string2, "pInt");
    PlayerInfo[playerid][pLocal] = dini_Int(string2, "pLocal");
    PlayerInfo[playerid][pTeam] = dini_Int(string2, "pTeam");
    PlayerInfo[playerid][pModel] = dini_Int(string2, "pModel");
    PlayerInfo[playerid][pPnumber] = dini_Int(string2, "PhoneNr");
    PlayerInfo[playerid][pPhousekey] = dini_Int(string2, "House");
    PlayerInfo[playerid][pPbiskey] = dini_Int(string2, "Bizz");
    PlayerInfo[playerid][pHandyGeld] = dini_Int(string2, "HandyGeld");
    PlayerInfo[playerid][pHandyVer] = dini_Int(string2, "HandyVer");
    PlayerInfo[playerid][pPos_x] = dini_Float(string2, "Pos_x");
    PlayerInfo[playerid][pPos_y] = dini_Float(string2, "Pos_y");
    PlayerInfo[playerid][pPos_z] = dini_Float(string2, "Pos_z");
    PlayerInfo[playerid][pCarLic] = dini_Int(string2, "CarLic");
    PlayerInfo[playerid][pNewLic] = dini_Int(string2, "NewLic");
    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][pLKWLic] = dini_Int(string2, "LKWLic");
    PlayerInfo[playerid][pRollerLic] = dini_Int(string2, "RollerLic");
    PlayerInfo[playerid][pMotoLic] = dini_Int(string2, "MotoLic");
    PlayerInfo[playerid][pZig] = dini_Int(string2, "Zig");
    PlayerInfo[playerid][pKekse] = dini_Int(string2, "Kekse");
    PlayerInfo[playerid][pZigSucht] = dini_Int(string2, "ZigSucht");
    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][pMulltime] = dini_Int(string2, "Mulltime");
    PlayerInfo[playerid][pPayDay] = dini_Int(string2, "PayDay");
    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][pWarns] = dini_Int(string2, "Warnings");
    PlayerInfo[playerid][pAdjustable] = dini_Int(string2, "Adjustable");
    PlayerInfo[playerid][pFuel] = dini_Int(string2, "Fuel");
    PlayerInfo[playerid][pMarried] = dini_Int(string2, "Married");
    PlayerInfo[playerid][pMarriedTo] = dini_Int(string2, "MarriedTo");
    SpawnChange[playerid] = dini_Int(string2, "SpawnChange");
    WantedLevel[playerid] = dini_Int(string2, "WantedLevel");
    WantedLevel[playerid] = dini_Int(string2, "WantedPoints");
    PlayerInfo[playerid][pPlayMinutes] = dini_Int(string2, "PlayMinutes");
    PlayerInfo[playerid][pGesamtMinutes] = dini_Int(string2, "GesamtMinutes");
    PlayerInfo[playerid][pMinutesSinceAn] = dini_Int(string2, "MinutesSinceAn");
    OfflineFlucht[playerid] = dini_Int(string2, "Offflucht");
    Knast[playerid] = dini_Int(string2, "Knast");
    PlayerInfo[playerid][pHandyID] = dini_Int(string2, "Handy");
    PlayerInfo[playerid][pUhrID] = dini_Int(string2, "Uhr");
    KnastTime[playerid] = dini_Int(string2, "KnastTime");
    PlayerInfo[playerid][pOwnPerso] = dini_Int(string2, "Perso");
    PlayerInfo[playerid][pFrakSperre] = dini_Int(string2, "FrakSperre");
    PlayerInfo[playerid][pGehalt] = dini_Int(string2, "Gehalt");
    PlayerInfo[playerid][pInvWeapon] = dini_Int(string2, "InvWeapon");
    PlayerInfo[playerid][pInvAmmo] = dini_Int(string2, "InvAmmo");
    PlayerInfo[playerid][pInvWeapon2] = dini_Int(string2, "InvWeapon2");
    PlayerInfo[playerid][pInvAmmo2] = dini_Int(string2, "InvAmmo2");
    PlayerInfo[playerid][pInvMats] = dini_Int(string2, "InvMats");
    PlayerInfo[playerid][pInvDrugs] = dini_Int(string2, "InvDrugs");
    PlayerInfo[playerid][pFlugTime] = dini_Int(string2, "FlugTime");
    PlayerInfo[playerid][pFarmTime] = dini_Int(string2, "FarmTime");
    PlayerInfo[playerid][pGDeaths] = dini_Int(string2, "GDeaths");
    PlayerInfo[playerid][pGKills] = dini_Int(string2, "GKills");
    PlayerInfo[playerid][pGWD] = dini_Float(string2, "GWD");
    PlayerInfo[playerid][pMeldung] = dini_Int(string2, "Meldung");
    PlayerInfo[playerid][pPtankekey] = dini_Int(string2, "Tanke");
    PlayerInfo[playerid][pGesperrt] = dini_Int(string2, "Gesperrt");
    PlayerInfo[playerid][Punkte] = dini_Int(string2, "Punkte");

    new weapon[14];
    new ammo[14];
    new tmpstring[128];
    for(new i = 1;i< 14;i++)
    {
    format(tmpstring,sizeof tmpstring, "waffenslot%d",i);
    weapon[i-1] = dini_Int(string2, tmpstring);
    format(tmpstring,sizeof tmpstring, "ammoslot%d",i);
    ammo[i-1] = dini_Int(string2, tmpstring);
    GivePlayerWeaponEx(playerid,weapon[i-1],ammo[i-1]);
    }
    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"{A50000}Login","Das Passwort ist nicht korrekt! Bitte gib nun dein richtiges Passwort ein:","Login","Abbrechen");
    fclose(UserFile);
    gPlayerLogTries[playerid] += 1;
    if(gPlayerLogTries[playerid] == 4) { Ban(playerid); }
    return 1;
    }
    PlayerInfo[playerid][pAdjustable] = 0;
    ResetPlayerMoney(playerid);
    ConsumingMoney[playerid] = 1;
    GivePlayerMoneyEx(playerid,PlayerInfo[playerid][pCash]);
    CurrentMoney[playerid] = PlayerInfo[playerid][pCash];
    for(new fs;fs<sizeof(FightSystem);fs++){
    GangZoneShowForPlayer(playerid,FightSystem[fs][fsZoneID],GetZoneColorOfFaction(FightSystem[fs][fsOwnerFaction]));
    }
    if(PlayerInfo[playerid][pReg] == 0)
    {
    PlayerInfo[playerid][pLevel] = 1;
    PlayerInfo[playerid][pSHealth] = 0.0;
    PlayerInfo[playerid][pHealth] = 99.0;
    PlayerInfo[playerid][pPos_x] = 2246.6;
    PlayerInfo[playerid][pPos_y] = -1161.9;
    PlayerInfo[playerid][pPos_z] = 1029.7;
    PlayerInfo[playerid][pInt] = 15;
    PlayerInfo[playerid][pLocal] = 255;
    PlayerInfo[playerid][pTeam] = 3;
    PlayerInfo[playerid][pModel] = 230;
    PlayerInfo[playerid][pPhousekey] = 255;
    PlayerInfo[playerid][pPbiskey] = 255;
    PlayerInfo[playerid][pAccount] = 0;
    PlayerInfo[playerid][pReg] = 1;
    }
    if(PlayerInfo[playerid][pGesperrt] == 1)//PlayerInfo[playerid][pLevel] == -999) //autoban
    {
    format(string2,sizeof(string2)," %s versucht mit seinem gebannten Account online zu kommen und wurde gekickt!",playername2);
    ABroadCast(COLOR_LIGHTRED,string2,1);
    SendClientMessage(playerid,COLOR_ROT," Du bist hier gebannt. Schau im Forum für mehr Informationen");
    Kick(playerid);
    return 1;
    }
    else if(PlayerInfo[playerid][pCK] > 0)
    {
    Kick(playerid);
    }
    printf("%s has logged in.",playername2);
    if(PlayerInfo[playerid][pDonateRank] > 0)
    {
    SendClientMessage(playerid, 0x787878FF,"Willkommen, du besitzt einen Premiumrang");
    }
    if (PlayerInfo[playerid][pAdmin] > 0)
    {
    format(string2, sizeof(string2), "Willkommen, du hast den Adminrang %d.",PlayerInfo[playerid][pAdmin]);
    SendClientMessage(playerid, 0x787878FF,string2);
    }
    if(PlayerInfo[playerid][pSupporter] > 0)
    {
    format(string2, sizeof(string2), "Willkommen, du hast den Supporterrang %d.",PlayerInfo[playerid][pSupporter]);
    SendClientMessage(playerid, 0x787878FF,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;
    SpawnPlayer(playerid);
    DateProp(playerid);
    SendClientMessage(playerid, COLOR_YELLOW4, motd);
    }

  • Schreibe es mal so:
    SendClientMessageToAll(COLOR_LIGHTRED, string);
    format(string, sizeof(string), "AdmCmd: Du wurdest von %s gebannt, Grund: %s", sendername, (result));
    SendClientMessage(giveplayerid,COLOR_LIGHTRED, string);
    PlayerInfo[giveplayerid][pGesperrt] = 1;
    OnPlayerUpdate(giveplayerid); //Hier hatte ich dir die falsche Variable gesagt, sorry.
    return 1;


    Und das musst du mit einem Array machen, sonst bringt das nichts.
    Du könntest aber auch einfach die Kick/Ban-Fix Include nutzen.
    forward KickTimer(playerid);
    new oKick[MAX_PLAYERS];


    public KickTimer(playerid)
    {
    if(oKick[playerid] == 0)
    {
    SetTimerEx("KickTimer",200,false,"i",playerid);
    oKick[playerid] = 1;
    }
    else if(oKick[playerid] == 1)
    {
    Kick(playerid);
    oKick[playerid] = 0;
    }
    return 1;
    }

  • Jeffry:
    Also bringt er Kick Timer nichts oder wie ?


    und ich schau mir mal das Include an


    Mfg :D


    #edit
    Hab da noch was komisches.
    Wenn ich /ban und meine ID dann steht da in der Nachricht an alle "1 wurde von ... gebannt" Also da steht meine Player ID und nicht mein Name :/

  • Jeffry:



    if(strcmp(cmd, "/ban", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "FEHLER: /ban [playerid] [grund]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    if (PlayerInfo[playerid][pAdmin] >= 1)
    {
    if(IsPlayerConnected(giveplayerid))
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    new length = strlen(cmdtext);
    while ((idx < length) && (cmdtext[idx] <= ' '))
    {
    idx++;
    }
    new offset = idx;
    new result[64];
    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
    {
    result[idx - offset] = cmdtext[idx];
    idx++;
    }
    result[idx - offset] = EOS;
    if(!strlen(result))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "FEHLER: /ban [playerid] [grund]");
    return 1;
    }
    if(PlayerInfo[giveplayerid][pAdmin] > PlayerInfo[playerid][pAdmin] > PlayerInfo[playerid][pSupporter])
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Du kannst diesen Spieler nicht bannen, da er ein höheres Adminlevel hat als du!");
    return 1;
    }
    new year, month,day;
    getdate(year, month, day);
    KickTimer(giveplayerid);
    format(string, sizeof(string), "AdmCmd: %s wurde von %s gebannt, Grund: %s (%d-%d-%d)", giveplayerid, sendername, (result),month,day,year);
    BanLog(string);
    format(string, sizeof(string), "AdmCmd: %s wurde von %s gebannt, Grund: %s", giveplayerid, sendername, (result));
    SendClientMessageToAll(COLOR_LIGHTRED, string);
    format(string, sizeof(string), "AdmCmd: Du wurdest von %s gebannt, Grund: %s", sendername, (result));
    SendClientMessage(giveplayerid,COLOR_LIGHTRED, string);
    PlayerInfo[giveplayerid][pGesperrt] = 1;
    OnPlayerUpdate(giveplayerid); //Hier hatte ich dir die falsche Variable gesagt, sorry.
    return 1;
    }
    }//not connected
    }
    else
    {
    format(string, sizeof(string), " %d ist kein aktiver Spieler.", giveplayerid);
    SendClientMessage(playerid, COLOR_GRAD1, string);
    }
    }
    return 1;
    }


    Ich habe mich ebend selber gebannt, jedoch war gesperrt trotzdem auf 0..

  • format(string, sizeof(string), "AdmCmd: %s wurde von %s gebannt, Grund: %s (%d-%d-%d)", giveplayerid, sendername, (result),month,day,year);
    zu:
    format(string, sizeof(string), "AdmCmd: %s wurde von %s gebannt, Grund: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);


    Ebenso bei der anderen Nachricht.



    Ändere bei OnPlayerUpdate mal:
    format(var, 32, "Gesperrt=%d\n",PlayerInfo[playerid][pGesperrt]);fwrite(hFile, var);
    zu:
    format(var, 32, "Gesperrt=%d\n",PlayerInfo[playerid][pGesperrt]);fwrite(hFile, var);printf("var: %s", var);


    Was wird geprintet, wenn du den Spieler bannst?

  • Wieso kommt der print 7 Sekunden nachdem du den Server verlassen hast??


    Setze dann auch mal hier noch einen print:
    SendClientMessageToAll(COLOR_LIGHTRED, string);
    format(string, sizeof(string), "AdmCmd: Du wurdest von %s gebannt, Grund: %s", sendername, (result));
    SendClientMessage(giveplayerid,COLOR_LIGHTRED, string);
    printf("Banned: %d", giveplayerid);
    PlayerInfo[giveplayerid][pGesperrt] = 1;
    printf("gesperrt: %d",PlayerInfo[giveplayerid][pGesperrt]);
    OnPlayerUpdate(giveplayerid);
    return 1;

  • Jeffry:


    Hier :>
    Ich habe das bisschen länger offen gelassen und der schreibt das öfter rein.
    Ich weis nicht ob das gewollt ist aber das ist ja egal.


    "[21:07:40] [join] Diamond has joined the server (1:127.0.0.1)
    [21:07:47] Diamond has logged in.
    [21:08:05] Banned: 1
    [21:08:05] gesperrt: 1
    [21:08:05] [part] Diamond has left the server (1:2)
    [21:08:22] var: Gesperrt=0


    [21:09:26] var: Gesperrt=0"

  • Das liegt daran, dass ID 0 ja noch im Server ist.
    Schreibe den print so:
    format(var, 32, "Gesperrt=%d\n",PlayerInfo[playerid][pGesperrt]);fwrite(hFile, var);printf("var: %s | playerid: %d", var, playerid);


    Dann poste nur die Zeilen entsprechend der playerid die du gebannt hast. Das dürften nach dem Ban nicht all zu viele sein.