Ich wollte mal einen /payday Command erstellen, weiß aber nicht so recht wie ich das anstellen soll.
So sieht es bei mir aus mit dem payday:
public PayDay()
{
new string[128];
new interest;
new rent = 0;
for(new i = 0; i <MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
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~Busted!", 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_WHITE, 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, "** 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 = intrate+4; }
else { tmpintrate = intrate+2; }
}
else
{
if(PlayerInfo[i][pDonateRank] > 0) { tmpintrate = 3; }
else { tmpintrate = 1; }
}
if(PlayerInfo[i][pPayDay] >= 5)
{
Tax += TaxValue;
PlayerInfo[i][pAccount] -= TaxValue;
new checks = PlayerInfo[i][pPayCheck] / 5;
if(PlayerInfo[i][pNeedSex] == 400)
{
checks = -200;
}
if(PlayerInfo[i][pDonateRank] > 0)
{
new bonus = PlayerInfo[i][pPayCheck] / 10;
checks += bonus;
}
new ebill = (PlayerInfo[i][pAccount]/10000)*(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]/1000)*(tmpintrate);
PlayerInfo[i][pExp]++;
PlayerPlayMusic(i);
SendClientMessage(i, COLOR_LIGHTBLUE, "|~~~~~~~~~| Zahltag |~~~~~~~~~|");
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_GRAD1, string);
}
if(PlayerInfo[i][pHandyVer] == 1)
{
SendClientMessage(i,COLOR_GRAD2," Handyvertrag: -$100");
GivePlayerMoney(i, -100);
}
format(string, sizeof(string), " Zinssatz: 0.%d Prozent",tmpintrate);
SendClientMessage(i, COLOR_GRAD2, string);
format(string, sizeof(string), " Zinsen : $%d", interest);
SendClientMessage(i, COLOR_GRAD2, string);
SendClientMessage(i, COLOR_LIGHTBLUE, "|~~~~~~~~~~~~~~~~~~~~~~~~~~~|");
format(string, sizeof(string), " Neuer Kontostand: $%d", PlayerInfo[i][pAccount]);
SendClientMessage(i, COLOR_GRAD2, string);
format(string, sizeof(string), " Miete: -$%d", rent);
SendClientMessage(i, COLOR_GRAD2, string);
if(PlayerInfo[i][pHotel] == 2 || PlayerInfo[i][pHotel] == 1 )
{
GivePlayerMoney(i,-200);
format(string, sizeof(string), " Hotelkosten: -$200");
SendClientMessage(i, COLOR_GRAD2, string);
}
format(string, sizeof(string), "~y~ Zahltag!~n~~w~ dein Gehalt~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);
}
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;
}
}
}
if(PlayerInfo[i][pDonateRank] > 0)
{
PlayerInfo[i][pPayDayHad] += 1;
if(PlayerInfo[i][pPayDayHad] >= 5)
{
PlayerInfo[i][pExp]++;
PlayerInfo[i][pPayDayHad] = 0;
}
}
}
else
{
SendClientMessage(i, COLOR_WHITE, "** Du hast nicht lang genug gespielt um den Payday zu erhalten.");
}
}
}
}
return 1;
}
Könnte mir da mal irgend jemand witer Helfen bitte!?