Hi Leute,
Habe ein Problem mit meinem PayDay - System, leider bekommt nur ein einziger Spieler den PayDay. Woran das liegt weiss ich leider nicht...
public PayDay(i)
{
new string[128];
new account,interest;
new rent = 0;
if(IsPlayerConnected(i))
{
SetPlayerGehalt(i);
new playername2[MAX_PLAYER_NAME];
GetPlayerName(i, playername2, sizeof(playername2));
account = PlayerInfo[i][pAccount];
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 > PlayerMoney[i])
{
PlayerInfo[i][pPhousekey] = 255;
SendClientMessage(i, COLOR_WHITE, "Du konntest deine Miete nicht bezahlen, und wurdest rausgeschmissen");
rent = 0;
}
HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;
}
new tmpintrate;
if (key != 255 && strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
{
if(PlayerInfo[i][pDonateRank] > 0) { tmpintrate = intrate+4; }
else { tmpintrate = intrate+2; }//HouseInfo[key][hLevel]
}
else
{
if(PlayerInfo[i][pDonateRank] > 0) { tmpintrate = 3; }
else { tmpintrate = 1; }
}
Tax += TaxValue;//Should work for every player online
PlayerInfo[i][pAccount] -= TaxValue;
if(PlayerInfo[i][pDonateRank] > 0)
{
}
new ebill = (PlayerInfo[i][pAccount]/10000)*(PlayerInfo[i][pLevel]);
ConsumingMoney[i] = 1;
moneygive(i, Gehalt[i]);
moneygive(i, -Tax);
if(PlayerInfo[i][pAccount] > 0)
{
PlayerInfo[i][pAccount] -= ebill;
SBizzInfo[4][sbTill] += ebill;
}
else
{
ebill = 0;
}
interest = (PlayerInfo[i][pAccount]/1000)*(tmpintrate);
PlayerInfo[i][pExp]++;
PlayerPlayMusic(i);
PlayerInfo[i][pAccount] = account+interest;
SendClientMessage(i, COLOR_WHITE, "|___ Abrechnung ___|");
format(string, sizeof(string), " Gehalt: $%d Steuern: -$%d", Gehalt[i], Tax);
SendClientMessage(i, COLOR_WHITE, string);
if(PlayerInfo[i][pPhousekey] != 255 || PlayerInfo[i][pPbiskey] != 255)
{
format(string, sizeof(string), " Stromkosten: -$%d", ebill);
SendClientMessage(i, COLOR_WHITE, string);
}
format(string, sizeof(string), " Kontostand: $%d", account);
SendClientMessage(i, COLOR_WHITE, string);
format(string, sizeof(string), " Zinssatz: 0.%d Prozent",tmpintrate);
SendClientMessage(i, COLOR_WHITE, string);
format(string, sizeof(string), " Zinsen: $%d", interest);
SendClientMessage(i, COLOR_WHITE, string);
SendClientMessage(i, COLOR_WHITE, "|--------------------------------------|");
format(string, sizeof(string), " Neuer Kontostand: $%d", PlayerInfo[i][pAccount]);
SendClientMessage(i, COLOR_WHITE, string);
format(string, sizeof(string), " Miete: -$%d", rent);
SendClientMessage(i, COLOR_WHITE, string);
format(string, sizeof(string), "~w~abrechnung");
GameTextForPlayer(i, string, 5000, 1);
rent = 0;
PlayerInfo[i][pPayDay] = 0;
PlayerInfo[i][pLoginZeit] = 1;
PlayerInfo[i][pConnectTime] -= 3600;
if(PlayerInfo[i][pDonateRank] > 0)
{
PlayerInfo[i][pPayDayHad] += 1;
if(PlayerInfo[i][pPayDayHad] >= 5)
{
PlayerInfo[i][pExp]++;
PlayerInfo[i][pPayDayHad] = 0;
}
}
}
// Checkprop();
return 1;
}
Wisst ihr woran das liegt?