[POMOC] PayDay

Započeo []Flynâ„¢, Januar 09, 2011, 18:26:11 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Problem je u tome da mi plata nekad bude 50K, nekad 100 i nesto K itd. Ne bi trebalo da bude tako velika,nzm u cemu je problem ...
Moze pomoc? Ovo mi je HITNO potrebno.


public PayDay()
{
new string[128];
new account,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, CRVENA, "[POLICIJA] Nisi platio dug, moras u zatvor.");
   GameTextForPlayer(i, "~r~Uhapsen!", 2000, 1);
   SetPlayerInterior(i, 0);
  SetPlayerPos(i, 264.0477,77.7472,1001.0391);
           PlayerInfo[i][pJailed] = 1;
           ResetPlayerWeapons(i);
WantedPoints[i] = 0;
PlayerInfo[i][pJailTime] = 240;
format(string, sizeof(string), "[POLICIJA] Zatvoren si na %d sekunde.   Kaucija: Onemoguceno", PlayerInfo[i][pJailTime]);
SendClientMessage(i, PLAVA, 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, BELA, "Izbacen si iz kuce.");
rent = 0;
}
HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;
}
new tmpintrate;
if (key != 255 && strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
{
   if(PlayerInfo[i][twixDonatorRank] > 0) { tmpintrate = intrate+4; }
else { tmpintrate = intrate+2; }
}
else
{
   if(PlayerInfo[i][twixDonatorRank] > 0) { tmpintrate = 3; }
else { tmpintrate = 1; }
}
if(PlayerInfo[i][pPayDay] >= 5)
{
   Tax += TaxValue;
   PlayerInfo[i][pAccount] -= TaxValue;
   if(PlayerInfo[i][twixDonatorRank] > 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]);
   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);
PlayerInfo[i][pAccount] = account+interest;
SendClientMessage(i, ZUTA, ":____Bankovni Izvestaj____:");
format(string, sizeof(string), "  Placa: $%d   Porez: -$%d", checks, TaxValue);
SendClientMessage(i, BELA, string);
if(PlayerInfo[i][pPhousekey] != 255 || PlayerInfo[i][pPbiskey] != 255)
{
   format(string, sizeof(string), "  Racun struje: -$%d", ebill);
SendClientMessage(i, SVETLOPLAVA, string);
}
format(string, sizeof(string), "  Iznos: $%d", account);
SendClientMessage(i, BELA, string);
format(string, sizeof(string), "  Rata: 0.%d posto",tmpintrate);
SendClientMessage(i, BELA, string);
format(string, sizeof(string), "  Rata porasla za $%d", interest);
SendClientMessage(i, BELA, string);
format(string, sizeof(string), "  Novi iznos: $%d", PlayerInfo[i][pAccount]);
SendClientMessage(i, BELA, string);
format(string, sizeof(string), "  Rent: -$%d", rent);
SendClientMessage(i, BELA, string);
  if(hotelrent[i] == 1 || hotelrent[i] == 2)
                   {
                   SendClientMessage(i, BELA, " Hotel Rent: -$100");
                   GivePlayerMoney(i, -100);
                   }
format(string, sizeof(string), "~w~Placa");
GameTextForPlayer(i, string, 5000, 1);
rent = 0;
PlayerInfo[i][pPayDay] = 0;
PlayerInfo[i][pPayCheck] = 0;
PlayerInfo[i][pConnectTime] += 1;
if(PlayerInfo[i][twixDonatorRank] > 0)
{
   PlayerInfo[i][pPayDayHad] += 1;
   if(PlayerInfo[i][pPayDayHad] >= 5)
   {
       PlayerInfo[i][pExp]++;
       PlayerInfo[i][pPayDayHad] = 0;
   }
}
}
else
{
SendClientMessage(i, COLOR_IVORY, "|_________OBAVESTENJE IZ FIRME_________|");
SendClientMessage(i, BELA, "Niste igrali dovoljno dugo da bi dobili platu !");
}
}
}
}
Checkprop();
return 1;
}
Poslednja Izmena: Januar 09, 2011, 18:27:55 POSLE PODNE od Joxy

Pa ovisi o pPayCheck-u, znaci ovisi kolko igras na serveru.
Aequam memento rebus in arduis servare mentem.

Meni treba,kako da smanjim platu.. Jer plata mi nekad bude i preko 100k   ::)

new checks = PlayerInfo[pPayCheck] / 100;
Aequam memento rebus in arduis servare mentem.