[POMOC]Plata

Započeo [BR]Maki187, Decembar 17, 2011, 13:45:07 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: larp(moj edit)
Detaljan opis problema: Zamislio sam jedan dobar drzavni sistem, al da bi poceo da ga radim, moram da sredim platu... problem je u tome sto je plata nekad 2 $, nekad 400$ nekad 6000$ itd (varira od nule pa navise), e sad ja zelim da igrac STALNO ima platu 150 $ + ono sto ima na platnom ceku (ako nema nista onda je samo 150 $), e sad, problem je u tome sta god da uradim, sta god da obrisem i prepravim, plata stalno varira gore dole...
evo dole koda bez mojih izmena... nadam se da ce mi neko pomoci... unapred hvala  :)
Dio skripte:
public PayDay()
{
new string[128];
new account,interest;
new rent = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i))
{
    if(PlayerInfo[i][pLevel] > 0)
    {
    if(MoneyMessage[i]==1)
{
    new bank = PlayerInfo[i][pAccount];
    SendClientMessage(i, COLOR_LIGHTRED, "You failed to pay your debt, Jail time.");
    GameTextForPlayer(i, "~r~Busted!", 2000, 1);
    SafeSetPlayerInterior(i, 6);
    SafeSetPlayerPos(i, 264.6288,77.5742,1001.0391);
            PlayerInfo[i][pJailed] = 1;
            SafeResetPlayerWeapons(i);
            SafeResetPlayerMoney(i);
SafeGivePlayerMoney(i, 1);
WantedPoints[i] = 0;
PlayerInfo[i][pAccount] = (bank + DebtMoney[i]);
DebtMoney[i] = 0;
PlayerInfo[i][pJailTime] = 240;
TextDrawShowForPlayer(i, Textdraw1[i]);
format(string, sizeof(string), "You are jailed for %d seconds.   Bail: Unable", PlayerInfo[i][pJailTime]);
SendClientMessage(i, COLOR_WHITE, string);
}
new playername2[MAX_PLAYER_NAME];
GetPlayerName(i, playername2, sizeof(playername2));
account = PlayerInfo[i][pAccount];
new key = PlayerInfo[i][pPhousekey];
new tmpintrate;
if (key != 9999 && strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
{
    if(PlayerInfo[i][pDonator] > 0) { tmpintrate = intrate+4; }
else { tmpintrate = intrate+2; }//HouseInfo[key][hLevel]
}
else
{
    if(PlayerInfo[i][pDonator] > 0) { tmpintrate = 3; }
else { tmpintrate = 1; }
}
if(PlayerInfo[i][pPayDay] >= 30)
{
    Tax += TaxValue;//Should work for every player online
    PlayerInfo[i][pAccount] -= TaxValue;
new checks = PlayerInfo[i][pPayCheck] / 5;
if(PlayerInfo[i][pDonator] > 0)
{
    new bonus = PlayerInfo[i][pPayCheck] / 10;
    checks += bonus;
}
    new ebill = (PlayerInfo[i][pAccount]/10000)*(PlayerInfo[i][pLevel]);
    account += 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, COLOR_GREEN, "|___ Izvestaj iz banke ___|");
format(string, sizeof(string), "  Plata: $%d   Taksa: -$%d", checks, TaxValue);
SendClientMessage(i, COLOR_WHITE, string);
if(PlayerInfo[i][pPhousekey] != 9999 || PlayerInfo[i][pPbiskey] != 9999)
{
    format(string, sizeof(string), "  Racun za struju: -$%d", ebill);
SendClientMessage(i, COLOR_GRAD1, string);
}
format(string, sizeof(string), "  Staro stanje: $%d", account - checks);
SendClientMessage(i, COLOR_WHITE, string);
format(string, sizeof(string), "  Kamata: 0.%d posto",tmpintrate);
SendClientMessage(i, COLOR_GRAD2, string);
format(string, sizeof(string), "  Kamatni Interes: $%d", interest);
SendClientMessage(i, COLOR_GRAD3, string);
SendClientMessage(i, COLOR_GREEN, "|--------------------------------------|");
format(string, sizeof(string), "  Novo stanje: $%d", PlayerInfo[i][pAccount]);
SendClientMessage(i, COLOR_GRAD5, string);
format(string, sizeof(string), "  Rent: -$%d", rent);
SendClientMessage(i, COLOR_GRAD5, string);
format(string, sizeof(string), "~y~PayDay~n~~w~Plata je stigla na vas racun");
GameTextForPlayer(i, string, 5000, 1);
rent = 0;
PlayerInfo[i][pPayDay] = 0;
PlayerInfo[i][pPayCheck] = 0;
if(FarmerVar[i] == 0)
{
FarmerPickup[i][0] = 0;
}
if(SmugglerWork[i] == 0)
{
PayDaySecure[i] = 0;
}
if(PlayerInfo[i][pDonator] > 0)
{
    PlayerInfo[i][pPayDayHad] += 1;
    if(PlayerInfo[i][pPayDayHad] >= 5)
    {
        PlayerInfo[i][pExp]++;
        PlayerInfo[i][pPayDayHad] = 0;
    }
}
}
else
{
    SendClientMessage(i, COLOR_WHITE, "* Nisi igrao dovoljno dugo da bi dobio platu!");
}
}
}
}
SaveAccounts();
    SaveStuff();
    SaveAnticheat();
return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno):

Daj varijablu u koju spremaš ono što još treba dodati na plaću.

Last nick: Paradox

ako sam te dobro razumeo na ovo mislis

pPayCheck

tu se skupljaju pare od poslova, ja sam mislio da se mozda neki random nvoac ubacuje na paycheck, al pretrazio sam u skripti i nema niceg...

public PayDay()
{
new string[128];
new account,interest;
new rent = 0;

for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i))
{
    if(PlayerInfo[i][pLevel] > 0)
    {
    if(MoneyMessage[i] == 1)
{
    new bank = PlayerInfo[i][pAccount];
    SendClientMessage(i, COLOR_LIGHTRED, "You failed to pay your debt, Jail time.");
    GameTextForPlayer(i, "~r~Busted!", 2000, 1);
    SafeSetPlayerInterior(i, 6);
    SafeSetPlayerPos(i, 264.6288,77.5742,1001.0391);
            PlayerInfo[i][pJailed] = 1;
            SafeResetPlayerWeapons(i);
            SafeResetPlayerMoney(i);
SafeGivePlayerMoney(i, 1);
WantedPoints[i] = 0;
PlayerInfo[i][pAccount] = (bank + DebtMoney[i]);
DebtMoney[i] = 0;
PlayerInfo[i][pJailTime] = 240;
TextDrawShowForPlayer(i, Textdraw1[i]);
format(string, sizeof(string), "You are jailed for %d seconds.   Bail: Unable", PlayerInfo[i][pJailTime]);
SendClientMessage(i, COLOR_WHITE, string);
}

new playername2[MAX_PLAYER_NAME];
GetPlayerName(i, playername2, sizeof(playername2));
account = PlayerInfo[i][pAccount];
new key = PlayerInfo[i][pPhousekey];
new tmpintrate;
if (key != 9999 && strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
{
    if(PlayerInfo[i][pDonator] > 0) { tmpintrate = intrate+4; }
else { tmpintrate = intrate+2; }//HouseInfo[key][hLevel]
}
else
{
    if(PlayerInfo[i][pDonator] > 0) { tmpintrate = 3; }
else { tmpintrate = 1; }
}
if(PlayerInfo[i][pPayDay] >= 30)
{
    Tax += TaxValue;//Should work for every player online
    PlayerInfo[i][pAccount] -= TaxValue;
new checks = 150 + PlayerInfo[i][pPayCheck];
if(PlayerInfo[i][pDonator] > 0)
{
    new bonus = PlayerInfo[i][pPayCheck] / 10;
    checks += bonus;
}
    new ebill = (PlayerInfo[i][pAccount]/10000)*(PlayerInfo[i][pLevel]);
    account += 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, COLOR_GREEN, "|___ Izvestaj iz banke ___|");
format(string, sizeof(string), "  Plata: $%d   Taksa: -$%d", checks, TaxValue);
SendClientMessage(i, COLOR_WHITE, string);
if(PlayerInfo[i][pPhousekey] != 9999 || PlayerInfo[i][pPbiskey] != 9999)
{
    format(string, sizeof(string), "  Racun za struju: -$%d", ebill);
SendClientMessage(i, COLOR_GRAD1, string);
}
format(string, sizeof(string), "  Staro stanje: $%d", account - checks);
SendClientMessage(i, COLOR_WHITE, string);
format(string, sizeof(string), "  Kamata: 0.%d posto",tmpintrate);
SendClientMessage(i, COLOR_GRAD2, string);
format(string, sizeof(string), "  Kamatni Interes: $%d", interest);
SendClientMessage(i, COLOR_GRAD3, string);
SendClientMessage(i, COLOR_GREEN, "|--------------------------------------|");
format(string, sizeof(string), "  Novo stanje: $%d", PlayerInfo[i][pAccount]);
SendClientMessage(i, COLOR_GRAD5, string);
format(string, sizeof(string), "  Rent: -$%d", rent);
SendClientMessage(i, COLOR_GRAD5, string);
format(string, sizeof(string), "~y~PayDay~n~~w~Plata je stigla na vas racun");
GameTextForPlayer(i, string, 5000, 1);
rent = 0;
PlayerInfo[i][pPayDay] = 0;
PlayerInfo[i][pPayCheck] = 0;
if(FarmerVar[i] == 0)
{
FarmerPickup[i][0] = 0;
}
if(SmugglerWork[i] == 0)
{
PayDaySecure[i] = 0;
}
if(PlayerInfo[i][pDonator] > 0)
{
    PlayerInfo[i][pPayDayHad] += 1;
    if(PlayerInfo[i][pPayDayHad] >= 5)
    {
        PlayerInfo[i][pExp]++;
        PlayerInfo[i][pPayDayHad] = 0;
    }
}
}
else
{
    SendClientMessage(i, COLOR_WHITE, "* Nisi igrao dovoljno dugo da bi dobio platu!");
}
}
}
}
SaveAccounts();
    SaveStuff();
    SaveAnticheat();
return 1;
}


Evo to ti je to... Dobiva $150 + ono što dodatno zaradi. I ostavio sam da donatori dobiju još nešto dodatno. :)

Last nick: Paradox

hvala, al nece, nesto slicno sam i ja probao, uvek daje razlicitu platu, kad odem /spayday da testiram, npr dobijem 500 dolara, onda to uradim par sec kasnije pa dobijem 410 itd...

Daj da vidim i komandu.

Last nick: Paradox

Brate hvala ti, nije bilo do komande gledao sam, poziva se smao an public payday

napravio sam drugu varijablu, tj plata, i staivo je u payday umesto paycheck, i sad je ok, tj plata je sad 150 $

mada me zbunjuje posto nigde nedodaje novac na paycheck... al nevanzo, sve u svemu hvala puno :)