PayDay funktioniert nicht richtig

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
  • Von deinem Payday System?



    Code:


    Spoiler anzeigen
    public PayDay()
    {
    new string[128];
    new rent = 0;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    if(M_Bot[i][PAFK] == 0)
    {
    if(MoneyMessage[i]==1)
    {
    SendClientMessage(i, COLOR_LIGHTRED, "Sie konnten ihre Schulden nicht Bezahlen.");
    GameTextForPlayer(i, "~r~Verhaftet", 2000, 1);
    SetPlayerInterior(i, 6);
    SetPlayerPos(i, 264.6288,77.5742,1001.0391);
    PlayerInfo[i][pJailed] = 1;
    ResetPlayerWeapons(i);
    ResetPlayerMoney(i);
    WantedPoints[i] = 0;
    PlayerInfo[i][pJailTime] = 240;
    format(string, sizeof(string), "Sie wurden für %d sekunden verhaftet. Kaution: Keine", PlayerInfo[i][pJailTime]);
    SendClientMessage(i, COLOR_LIGHTBLUE, string);
    }
    new playername2[MAX_PLAYER_NAME];
    GetPlayerName(i, playername2, sizeof(playername2));
    new key = PlayerInfo[i][pPhousekey];
    if(key != 255)
    {
    rent = HouseInfo[key][hRent];
    if(strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
    {
    rent = 0;
    }
    else if(rent > GetPlayerMoney(i))
    {
    PlayerInfo[i][pPhousekey] = 255;
    SendClientMessage(i, COLOR_WHITE, "You have been evicted.");
    rent = 0;
    }
    HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;
    }
    if (key != 255 && strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
    {
    if(PlayerInfo[i][ppremium] > 0) { }
    else { }//HouseInfo[key][hLevel]
    }
    else
    {
    if(PlayerInfo[i][ppremium] > 0) { }
    else { }
    }
    if(PlayerInfo[i][pPayDay] >= 3)
    {
    Tax += TaxValue;//Should work for every player online
    PlayerInfo[i][pAccount] -= TaxValue;
    if(PlayerInfo[i][ppremium] > 0)
    {
    new bonus = PlayerInfo[i][pPayCheck] / 2;
    PlayerInfo[i][pPayCheck] += bonus;
    }
    new checks = PlayerInfo[i][pPayCheck];
    new ebill = (PlayerInfo[i][pAccount]/10000)*(PlayerInfo[i][pLevel]);
    //new oil = (PlayerInfo[i][pPhousekey]*100);
    ConsumingMoney[i] = 1;
    GivePlayerMoney(i, checks);
    if(PlayerInfo[i][pAccount] > 0)
    {
    PlayerInfo[i][pAccount] -= ebill;
    SBizzInfo[4][sbTill] += ebill;
    }
    else
    {
    ebill = 0;
    }
    if(PlayerInfo[i][pPhousekey] != 255)
    {
    //PlayerInfo[i][pAccount] -= oil;
    //SBizzInfo[3][sbTill] += oil;
    }
    else
    {
    //oil = 0;
    }
    if(PlayerInfo[i][pMember] == 0 && PlayerInfo[i][pLeader] == 0)
    {
    checks += 500;
    }
    PlayerInfo[i][pExp]++;
    PlayerPlayMusic(i);
    SendClientMessage(i,COLOR_YELLOW, "|================| KONTOAUSZUG |================|");
    format(string, sizeof(string), "Gehalt: $%d Steuern: -$%d", pPayCheck,TaxValue);
    SendClientMessage(i,COLOR_WHITE, string);
    format(string, sizeof(string), "Aktueller Kontostand: $%d",PlayerInfo[i][pAccount]);
    SendClientMessage(i,COLOR_WHITE, string);
    SendClientMessage(i,COLOR_YELLOW, "|================| KONTOAUSZUG |================|");
    }
    if(PlayerInfo[i][pRank]==1)
    {
    PlayerInfo[i][pAccount]+=1275;
    GivePlayerMoney(i,1000);
    }
    if(PlayerInfo[i][pRank]==2)
    {
    PlayerInfo[i][pAccount]+=1575;
    GivePlayerMoney(i,2000);
    }
    if(PlayerInfo[i][pRank]==3)
    {
    PlayerInfo[i][pAccount]+=1875;
    GivePlayerMoney(i,3000);
    }
    if(PlayerInfo[i][pRank]==4)
    {
    PlayerInfo[i][pAccount]+=2175;
    GivePlayerMoney(i,4000);
    }
    if(PlayerInfo[i][pRank]==5)
    {
    PlayerInfo[i][pAccount]+=2475;
    GivePlayerMoney(i,5000);
    }
    if(PlayerInfo[i][pRank]==6)
    {
    PlayerInfo[i][pAccount]+=2775;
    GivePlayerMoney(i,6000);
    }
    if(PlayerInfo[i][pRank]==7)
    {
    PlayerInfo[i][pAccount]+=2975;
    GivePlayerMoney(i,7000);
    }
    if(PlayerInfo[i][pRank]==8)
    {
    PlayerInfo[i][pAccount]+=3275;
    GivePlayerMoney(i,8000);
    }
    if(PlayerInfo[i][pRank]==9)
    {
    PlayerInfo[i][pAccount]+=3575;
    GivePlayerMoney(i,9000);
    }
    if(PlayerInfo[i][pRank]==10)
    {
    PlayerInfo[i][pAccount]+=4000;
    GivePlayerMoney(i,10000);
    }
    if(PlayerInfo[i][pRank]==11)
    {
    PlayerInfo[i][pAccount]+=4375;
    GivePlayerMoney(i,11000);
    }
    if(PlayerInfo[i][pMember]<=0 && PlayerInfo[i][pLeader]<=0 && PlayerInfo[i][pJob]<=0)
    {
    PlayerInfo[i][pAccount]+=500;
    GivePlayerMoney(i,6000);
    }
    if(PlayerInfo[i][pMember]<=0 && PlayerInfo[i][pLeader]<=0 && PlayerInfo[i][pJob]>=1)
    {
    PlayerInfo[i][pAccount]+=725;
    GivePlayerMoney(i,7000);
    }
    if(PlayerInfo[i][pMember]<=0 && PlayerInfo[i][pLeader]<=0 && PlayerInfo[i][pJob]==10)
    {
    PlayerInfo[i][pAccount]+=325;
    }
    format(string, sizeof(string), "~y~Payday~n~~w~GehaltsCheck");
    GameTextForPlayer(i, string, 5000, 1);
    rent = 0;
    PlayerInfo[i][pPayDay] = 0;
    PlayerInfo[i][pPayCheck] = 0;
    PlayerInfo[i][pConnectTime] += 1;
    if(PlayerInfo[i][ppremium] > 0)
    {
    PlayerInfo[i][pPayDayHad] += 1;
    if(PlayerInfo[i][pPayDayHad] >= 5)
    {
    PlayerInfo[i][pExp]++;
    PlayerInfo[i][pPayDayHad] = 0;
    }
    }
    }
    else
    {
    SendClientMessage(i, COLOR_LIGHTRED, "Sie haben nicht lang genug gespielt um einen Gehaltscheck zu erhalten.");
    }
    }
    else
    {
    SendClientMessage(i, COLOR_LIGHTRED, "Sie können im AFK-Modus keinen Gehaltscheck erhalten.");
    }
    }
    }