Jump to content
  • 0

Problema PayDay


dandrew12

Question

Salut, cum pot face si eu un payday mai mic adica $ pe care ii iei de la 1-2k la 5-10$

[pawn]public PayDay()

{

new string[128];

new account,interest;

new rent = 0;

for(new i = 0; i < MAX_PLAYERS; i++)

{

if(IsPlayerConnected(i))

{

    if(PlayerInfo[pLevel] > 0)

    {

    if(Var[MoneyMessage]==1)

{

    SendClientMessage(i, COLOR_LIGHTRED, "You failed to pay your debt, Jail time.");

    GameTextForPlayer(i, "~r~Busted!", 2000, 1);

    SetPlayerInterior(i, 6);

  SetPlayerPos(i, 264.6288,77.5742,1001.0391);

            PlayerInfo[pJailed] = 1;

            ResetPlayerWeapons(i);

Var[WantedLevel] = 0;

PlayerInfo[pJailTime] = 240;

format(string, sizeof(string), "You are jailed for %d seconds.  Bail: Unable", PlayerInfo[pJailTime]);

SendClientMessage(i, COLOR_LIGHTBLUE, string);

}

new playername2[MAX_PLAYER_NAME];

GetPlayerName(i, playername2, sizeof(playername2));

account = PlayerInfo[pAccount];

new key = PlayerInfo[pPhousekey];

if(key != 255)

{

rent = HouseInfo[key][hRent];

if(strcmp(playername2, HouseInfo[key][hOwner], true) == 0)

{

rent = 0;

}

else if(rent > GetPlayerMoney(i))

{

PlayerInfo[pPhousekey] = 255;

SendClientMessage(i, COLOR_WHITE, "You have been evicted.");

rent = 0;

}

HouseInfo[key][hMoney] = HouseInfo[key][hMoney]+rent;

}

new tmpintrate;

if (key != 255 && strcmp(playername2, HouseInfo[key][hOwner], true) == 0)

{

    if(PlayerInfo[pDonateRank] > 0) { tmpintrate = intrate+4; }

else { tmpintrate = intrate+2; }//HouseInfo[key][hLevel]

}

else

{

    if(PlayerInfo[pDonateRank] > 0) { tmpintrate = 3; }

else { tmpintrate = 1; }

}

    Tax += TaxValue;//Should work for every player online

    PlayerInfo[pAccount] -= TaxValue;

    if(PlayerInfo[pDonateRank] > 0)

{

    new bonus = PlayerInfo[pPayCheck] / 2;

    PlayerInfo[pPayCheck] += bonus;

}

new checks = PlayerInfo[pPayCheck]/2;

    new ebill = (PlayerInfo[pAccount]/200000)*(PlayerInfo[pLevel]);

    Var[ConsumingMoney] = 1;

    GivePlayerMoney(i, checks);

    if(PlayerInfo[pAccount] > 0)

    {

    PlayerInfo[pAccount] -= ebill;

    SBizzInfo[4][sbTill] += ebill;

}

else

{

    ebill = 0;

}

interest = (PlayerInfo[pAccount]/10000)*(tmpintrate);

PlayerInfo[pExp]++;

PlayerPlayMusic(i);

PlayerInfo[pAccount] = account+interest;

SendClientMessage(i, COLOR_WHITE, "|___ {F200FF}BANK STATMENT {FFFFFF}___|");

format(string, sizeof(string), "  {00FF00}Paycheck: {FFFFFF}$%d  {00FF00}Tax Money: {FFFFFF}-$%d", checks, TaxValue);

SendClientMessage(i, COLOR_GRAD1, string);

if(PlayerInfo[pPhousekey] != 255 || PlayerInfo[pPbiskey] != 255)

{

    format(string, sizeof(string), "  {00FF00}Electricity Bill: {FFFFFF}-$%d", ebill);

SendClientMessage(i, COLOR_GRAD1, string);

}

format(string, sizeof(string), "  {00FF00}Balance: {FFFFFF}$%d", account);

SendClientMessage(i, COLOR_GRAD1, string);

format(string, sizeof(string), "  {00FF00}Interest Rate: {FFFFFF}0.%d percent",tmpintrate);

SendClientMessage(i, COLOR_GRAD2, string);

format(string, sizeof(string), "  {00FF00}Interest Gained {FFFFFF}$%d", interest);

SendClientMessage(i, COLOR_GRAD3, string);

SendClientMessage(i, COLOR_GRAD4, "{F200FF}|--------------------------------------|");

format(string, sizeof(string), "  {00FF00}New Balance: {FFFFFF}$%d", PlayerInfo[pAccount]);

SendClientMessage(i, COLOR_GRAD5, string);

format(string, sizeof(string), "  {00FF00}Rent: {FFFFFF}-$%d", rent);

SendClientMessage(i, COLOR_GRAD5, string);

format(string, sizeof(string), "~r~PayDay~n~~w~Paycheck");

GameTextForPlayer(i, string, 5000, 1);

rent = 0;

RobBankOn = 0;

                RobBankOn1 = 0;

PlayerInfo[pRobbed] = 0;

PlayerInfo[pPayDay] = 0;

PlayerInfo[pPayCheck] = 0;

PlayerInfo[pConnectTime] += 1;

if(PlayerInfo[pDonateRank] >= 1) PlayerInfo [pExp] += 1 ;

}

}

}

//Checkprop();

return 1;

}[/pawn]

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.