Also villeicht hilft mir ja hier jemand, undzwar möchte ich dass Premium User, jeden zweiten Payday immer 2Respektpunkte bekommen wie mach ich das?
public PayDay()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pPayTime] >= 60)
{
new account,interest;
new rent = 0;
if(PlayerInfo[i][pLevel] > 0)
{
if(MoneyMessage[i]==1)
{
SendClientMessage(i, COLOR_RED, "Du hast deine Schulden nicht bezahlt und sitzt dafür nun im Knast!");
GameTextForPlayer(i, "~r~Verhaftet!", 2000, 1);
SetPlayerInterior(i, 6);
PlayerInfo[i][pInt] = 6;
SetPlayerPos(i, 264.6288,77.5742,1001.0391);
PlayerInfo[i][pJailed] = 1;
SetPlayerSkin(i, 62);
ResetPlayerWeapons(i);
ResetPlayerMoney(i);
WantedPoints[i] = 0;
PlayerInfo[i][pJailTime] = 200;
format(string, sizeof(string), "Du bist für %d Sekunden Verhaftet! Kaution: Keine", PlayerInfo[i][pJailTime]);
SendClientMessage(i, COLOR_LIGHTRED, string);
}
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 > GetPlayerMoney(i))
{
PlayerInfo[i][pPhousekey] = 255;
SendClientMessage(i, COLOR_WHITE, "Du hast deine Miete nicht bezahlt 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 = 3;
}
else
{
tmpintrate = 1;
}//HouseInfo[key][hLevel]
}
else
{
if(PlayerInfo[i][pDonateRank] > 0)
{
tmpintrate = 3;
}
else
{
tmpintrate = 1;
}
}
if(PlayerInfo[i][pPayDay] >= 5)
{
Tax += TaxValue;//Should work for every player online
PlayerInfo[i][pAccount] -= TaxValue;
new checks = PlayerInfo[i][pPayCheck] / 5;
if(PlayerInfo[i][pDonateRank] > 0)
{
new bonus = PlayerInfo[i][pPayCheck] / 10;
checks += bonus;
}
//new ebill = (HouseInfo[PlayerInfo[i][pPhousekey]][hValue])/(50);
new ebill = (PlayerInfo[i][pAccount]/100000)*(PlayerInfo[i][pLevel]);
ConsumingMoney[i] = 1;
GivePlayerMoney(i, checks);
if(PlayerInfo[i][pAccount] > 0)
{
PlayerInfo[i][pAccount] -= ebill;
SBizzInfo[4][sbTill] += ebill;
}
else
{
ebill = 0;
}
interest = (PlayerInfo[i][pAccount]/10000)*(tmpintrate);
if(PlayerInfo[i][pDonateRank] >= 1 || PlayerInfo[i][pVIPClub] >= 1)
{
tmpintrate = 5;
interest = (PlayerInfo[i][pAccount]/10000)*(tmpintrate);
}
PlayerInfo[i][pExp]++;
PlayerPlayMusic(i);
PlayerInfo[i][pAccount] = account+interest;
SendClientMessage(i, COLOR_GREEN, "|==========KONTOAUSZUG==========|");
format(string, sizeof(string), " Gehalt: $%d Steuern: -$%d", checks, TaxValue);
SendClientMessage(i, COLOR_WHITE, string);
if(PlayerInfo[i][pPhousekey] != 255 || PlayerInfo[i][pPbiskey] != 255)
{
format(string, sizeof(string), " Nebenkosten: -$%d", ebill);
SendClientMessage(i, COLOR_WHITE, string);
}
if(PlayerInfo[i][pHandyVer] == 1)
{
SendClientMessage(i,COLOR_WHITE," Handyvertrag: -$100");
GivePlayerMoney(i, -100);
}
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);
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);
SendClientMessage(i, COLOR_GREEN, "|===============================|");
if(PlayerCar[i][Dtc_PlayerKey[i]][CarMinus] > 0 || PlayerInfo[i][pKreditRechnung] > 0)
{
SendClientMessage(i, COLOR_GREEN, "|==========Ihre Kreditkarten Rechnung==========|");
if(PlayerCar[i][Dtc_PlayerKey[i]][CarMinus] > 0)
{
format(string,sizeof(string),"Rechnung 'Online-Autohaus': %d für das Automodell %d",PlayerCar[i][Dtc_PlayerKey[i]][CarMinus],CarName[PlayerCar[i][Dtc_PlayerKey[i]][CarModel]-400]);
SendClientMessage(i, COLOR_LIGHTBLUE,string);
PlayerInfo[i][pAccount] -= PlayerCar[i][Dtc_PlayerKey[i]][CarMinus];
PlayerCar[i][Dtc_PlayerKey[i]][CarMinus] = 0;
PlayerUpdate(i);
OnPlayerCarUpdateIngame(i);
}
if(PlayerInfo[i][pKreditRechnung] > 0)
{
format(string,sizeof(string),"Rechnung 'Master Card®': %d für Tanken an der Tankstelle",PlayerInfo[i][pKreditRechnung]);
SendClientMessage(i, COLOR_LIGHTBLUE,string);
PlayerInfo[i][pAccount] -= PlayerInfo[i][pKreditRechnung];
PlayerInfo[i][pKreditRechnung] = 0;
PlayerUpdate(i);
}
SendClientMessage(i, COLOR_GREEN, "|===============================|");
}
PlayerInfo[i][pPayTime] = 0;
if(PlayerInfo[i][pHotel] == 2 || PlayerInfo[i][pHotel] == 1 )
{
GivePlayerMoney(i,-200);
format(string, sizeof(string), " Hotelkosten: -$200");
SendClientMessage(i, COLOR_WHITE, string);
}
format(string, sizeof(string), "~y~ Zahltag! Gehalt~n~ ~g~ $%d",checks);
GameTextForPlayer(i, string, 5000, 1);
rent = 0;
PlayerInfo[i][pPayDay] = 0;
PlayerInfo[i][pPayCheck] = 0;
PlayerInfo[i][pConnectTime] += 1;
if(PlayerInfo[i][pLevel] >= 0)
{
new nxtlevel = PlayerInfo[i][pLevel]+1;
new expamount = nxtlevel*levelexp;
new infostring[256];
if (PlayerInfo[i][pExp] < expamount)
{
format(infostring, 256, " Du besitzt nun %d Respektpunkte!",PlayerInfo[i][pExp]);
SendClientMessage(i, COLOR_GRAD1, infostring);
return 1;
}
else
{
format(string, sizeof(string), "~g~LEVEL UP~n~~w~Du bist jetzt Level %d", nxtlevel);
PlayerPlaySound(i, 1052, 0.0, 0.0, 0.0);
PlayerPlayMusic(i);
PlayerInfo[i][pLevel]++;
if(PlayerInfo[i][pDonateRank] > 0)
{
PlayerInfo[i][pExp] -= expamount;
new total = PlayerInfo[i][pExp];
if(total > 0)
{
PlayerInfo[i][pExp] = total;
}
else
{
PlayerInfo[i][pExp] = 0;
}
}
else
{
PlayerInfo[i][pExp] = 0;
}
PlayerInfo[i][gPupgrade] = PlayerInfo[i][gPupgrade]+2;
}
}
if(PlayerInfo[i][pDonateRank] > 0)
{
PlayerInfo[i][pPayDayHad] += 1;
if(PlayerInfo[i][pPayDayHad] >= 5)
{
PlayerInfo[i][pExp]++;
PlayerInfo[i][pPayDayHad] = 0;
}
}
}
}
}
}
}
Checkprop();
return 1;
}