Jump to content
  • 0

Problema PayDay !!!!


stefanutzu14

Question

11 answers to this question

Recommended Posts

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(MoneyMessage==1)

{

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

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

    SetPlayerInterior(i, 6);

    PlayerInfo[pInt] = 6;

  SetPlayerPos(i, 264.6288,77.5742,1001.0391);

            PlayerInfo[pJailed] = 1;

            SafeResetPlayerWeapons(i);

            SafeResetPlayerMoney(i);

WantedPoints = 0;

PlayerInfo[pJailTime] = 240;

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

SendClientMessage(i, COLOR_WHITE, 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, "Ai fost evitat.");

rent = 0;

}

HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+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; }

}

if(PlayerInfo[pPayDay] >= 5)

{

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

    PlayerInfo[pAccount] -= TaxValue;

new checks = PlayerInfo[pPayCheck] / 5;

if(PlayerInfo[pDonateRank] > 0)

{

    new bonus = PlayerInfo[pPayCheck] / 10;

    checks += bonus;

}

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

    //ConsumingMoney = 1;

    //SafeGivePlayerMoney(i, checks);

    account += checks;

    if(PlayerInfo[pAccount] > 0)

    {

    PlayerInfo[pAccount] -= ebill;

    SBizzInfo[4][sbTill] += ebill;

}

else

{

    ebill = 0;

}

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

PlayerInfo[pExp] += 2;

PlayerPlayMusic(i);

PlayerInfo[pAccount] = account+interest;

SendClientMessage(i, COLOR_GREEN, "|___ BANK STATMENT ___|");

format(string, sizeof(string), "  Paycheck: $%d  Tax Money: -$%d", checks, TaxValue);

SendClientMessage(i, COLOR_WHITE, string);

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

{

    format(string, sizeof(string), "  Electricity Bill: -$%d", ebill);

SendClientMessage(i, COLOR_GRAD1, string);

}

format(string, sizeof(string), "  Balance: $%d", account - checks);

SendClientMessage(i, COLOR_WHITE, string);

format(string, sizeof(string), "  Interest Rate: 0.%d percent",tmpintrate);

SendClientMessage(i, COLOR_GRAD2, string);

format(string, sizeof(string), "  Interest Gained $%d", interest);

SendClientMessage(i, COLOR_GRAD3, string);

SendClientMessage(i, COLOR_GREEN, "|--------------------------------------|");

format(string, sizeof(string), "  New Balance: $%d", PlayerInfo[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~Check paid into your account");

GameTextForPlayer(i, string, 5000, 1);

rent = 0;

PlayerInfo[pPayDay] = 0;

PlayerInfo[pPayCheck] = 0;

PlayerInfo[pConnectTime] += 3;

if(FarmerVar == 0)

{

FarmerPickup[0] = 0;

}

if(DrugFarmerVar == 0)

{

DrugFarmerPickup[0] = 0;

}

if(SmugglerWork == 0)

{

PayDaySecure = 0;

}

if(PlayerInfo[pDonateRank] > 0)

{

    PlayerInfo[pPayDayHad] += 1;

    if(PlayerInfo[pPayDayHad] >= 5)

    {

        PlayerInfo[pExp]++;

        PlayerInfo[pPayDayHad] = 0;

    }

}

}

else

{

    SendClientMessage(i, COLOR_WHITE, "* You haven't played long enough to obtain a PayDay.");

}

}

}

}

SaveAccounts();

Checkprop();

return 1;

}

strtok(const string[], &index)

{

new length = strlen(string);

while ((index < length) && (string[index] <= ' '))

{

index++;

}

new offset = index;

new result[20];

while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))

{

result[index - offset] = string[index];

index++;

}

result[index - offset] = EOS;

return result;

}

public split(const strsrc[], strdest[][], delimiter)

{

new i, li;

new aNum;

new len;

while(i <= strlen(strsrc)){

    if(strsrc==delimiter || i==strlen(strsrc)){

        len = strmid(strdest[aNum], strsrc, li, i, 128);

        strdest[aNum][len] = 0;

        li = i+1;

        aNum++;

}

i++;

}

return 1;

}

94.176.96.37:7778 -->>> Server Role-Play !

add [email protected] pentru detalii !

Caut om cu playeri !

Link to comment
Share on other sites

incearca asa:[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(MoneyMessage==1)

{

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

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

  SetPlayerInterior(i, 10);

SetPlayerPos(i, 223.2281,114.4777,999.0156);

            PlayerInfo[pJailed] = 1;

            ResetPlayerWeapons(i);

WantedPoints = 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_WHITE1, "You have been evicted.");

rent = 0;

}

HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+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; }

}

if(PlayerInfo[pPayDay] >= 5)

{

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

    PlayerInfo[pAccount] -= TaxValue;

    /*if(PlayerInfo[pDonateRank] > 0)

{

    new bonus = PlayerInfo[pPayCheck] / 3;

    PlayerInfo[pPayCheck] += bonus;

}*/

new checks = PlayerInfo[pPayCheck]/2;

    new ebill = 50;

    new wbill = 46;

    new gbill = 45;

    new abill = 42;

    new tvbill = 38;

    ConsumingMoney = 1;

    GivePlayerMoney(i, checks);

        if(PlayerInfo[pAccount] > 0)

    {

    PlayerInfo[pAccount] -= ebill;

    SBizzInfo[4][sbTill] += ebill;

    PlayerInfo[pAccount] -= wbill;

    SBizzInfo[12][sbTill] += wbill;

    PlayerInfo[pAccount] -= gbill;

    SBizzInfo[14][sbTill] += gbill;

    PlayerInfo[pAccount] -= abill;

    SBizzInfo[13][sbTill] += abill;

    PlayerInfo[pAccount] -= tvbill;

    SBizzInfo[13][sbTill] += tvbill;

}

else

{

    ebill = 0;

    wbill = 0;

    gbill = 0;

    abill = 0;

    tvbill = 0;

}

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

PlayerPlayMusic(i);

PlayerInfo[pAccount] = account+interest;

SendClientMessage(i, COLOR_WHITE1, "|___ BANK STATMENT ___|");

format(string, sizeof(string), "  Paycheck: $%d  Tax Money: -$%d", checks, TaxValue);

SendClientMessage(i, COLOR_GRAD1, string);

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

{

    format(string, sizeof(string), "  Electricity Bill: -$%d  Gas Bill: -$%d  TV Bill: -$%d", ebill,gbill,tvbill);

SendClientMessage(i, COLOR_GRAD1, string);

format(string, sizeof(string), "  Water Bill: -$%d  Asiguration Bill: -$%d", wbill,abill);

SendClientMessage(i, COLOR_GRAD1, string);

}

format(string, sizeof(string), "  Balance: $%d", account);

SendClientMessage(i, COLOR_GRAD1, string);

format(string, sizeof(string), "  Interest Rate: 0.%d percent",tmpintrate);

SendClientMessage(i, COLOR_GRAD2, string);

format(string, sizeof(string), "  Interest Gained $%d", interest);

SendClientMessage(i, COLOR_GRAD3, string);

SendClientMessage(i, COLOR_GRAD4, "|--------------------------------------|");

format(string, sizeof(string), "  New Balance: $%d", PlayerInfo[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~Paycheck");

GameTextForPlayer(i, string, 5000, 1);

rent = 0;

PlayerInfo[pExp]++;

PlayerInfo[pPayDay] = 0;

PlayerInfo[pPayCheck] = 0;

PlayerInfo[pConnectTime] += 1;

/*if(PlayerInfo[pDonateRank] > 0)

{

    PlayerInfo[pPayDayHad] += 1;

    if(PlayerInfo[pPayDayHad] >= 5)

    {

        PlayerInfo[pExp]++;

        PlayerInfo[pPayDayHad] = 0;

    }

    }*/

}

else

{

    SendClientMessage(i, COLOR_LIGHTRED, "* You haven't played long enough to obtain a PayDay.");

}

}

}

}

Checkprop();

return 1;

}

strotok(const string[], &index)

{

new length = strlen(string);

while ((index < length) && (string[index] <= ' '))

{

index++;

}

new offset = index;

new result[20];

while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))

{

result[index - offset] = string[index];

index++;

}

result[index - offset] = EOS;

return result;

}

public split(const strsrc[], strdest[][], delimiter)

{

new i, li;

new aNum;

new len;

while(i <= strlen(strsrc)){

    if(strsrc==delimiter || i==strlen(strsrc)){

        len = strmid(strdest[aNum], strsrc, li, i, 128);

        strdest[aNum][len] = 0;

        li = i+1;

        aNum++;

}

i++;

}

return 1;

}

[/pawn] nu sunt sigur ca va merge sa ca te rog daca iti da erori sa nu iesi din pawno dupa compile si daca primesti erori le postezi si cand mia postezi linii incadreazale intre [pawn*] [/pawn*] dar fara * pe care le-am pus eu

I'm back haha !

Link to comment
Share on other sites

apasa ctrl+z pana iti da ce ai avut tu. o sa revin cu un edit cu ce sa incerci sa bagi

edit incearca asa:

[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(MoneyMessage==1)

{

    SendClientMessage(i, COLOR_1RED, ": Ne pare rau dar nu ai platit datoria, esti la inchisoare!");

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

    SetPlayerInterior(i, 10);

    PlayerInfo[pInt] = 10;

  SetPlayerPos(i, 227.4202,112.0810,999.0156);

            PlayerInfo[pJailed] = 1;

            ResetPlayerWeapons(i);

            ResetPlayerMoney(i);

WantedPoints = 0;

PlayerInfo[pJailTime] = 240;

TextDrawShowForPlayer(i, JailTimeText);

format(string, sizeof(string), "Esti arestat pentru %d secunde.  Cautiune: Unable", PlayerInfo[pJailTime]);

SendClientMessage(i, COLOR_WHITE, 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, "A fost evacuat!");

rent = 0;

}

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

}

new tmpintrate;

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

{

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

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

}

else

{

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

else { tmpintrate = 1; }

}

if(PlayerInfo[pPayDay] >= 5)

{

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

    PlayerInfo[pAccount] -= TaxValue;

new checks = PlayerInfo[pPayCheck] / 5;

if(PlayerInfo[pDonateRank] > 0)

{

    new bonus = PlayerInfo[pPayCheck] / 10;

    checks += bonus;

}

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

ConsumingMoney = 1;

    GivePlayerMoney(i, checks);

                    if(PlayerInfo[pAccount] > 0)

    {

    PlayerInfo[pAccount] -= ebill;

    SBizzInfo[4][sbTill] += ebill;

}

else

{

    ebill = 0;

}

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

PlayerInfo[pExp]++;

PlayerPlayMusic(i);

PlayerInfo[pAccount] = account+interest;

SendClientMessage(i, COLOR_GREEN, "__________ Informatii Bank __________");

format(string, sizeof(string), "» Salariu: %d$ • Taxe: -%d$ • Balanta: %d$", checks, TaxValue, account - checks);

SendClientMessage(i, COLOR_WHITE, string);

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

{

    format(string, sizeof(string), "» Electricitatea: -%d$ •  Dobanda: 0.%d procente", ebill,tmpintrate);

SendClientMessage(i, COLOR_WHITE, string);

}

format(string, sizeof(string), "» Noua Balanta: %d$ • Rent -%d$", PlayerInfo[pAccount], rent);

SendClientMessage(i, COLOR_WHITE, string);

SendClientMessage(i, COLOR_GREEN, "__________ Informatii Bank __________");

format(string, sizeof(string), "~r~PayDay~n~~y~Ai prmit un RP");

GameTextForPlayer(i, string, 5000, 1);

rent = 0;

PlayerInfo[pPayDay] = 0;

PlayerInfo[pPayCheck] = 0;

PlayerInfo[pConnectTime] += 1;

if(PlayerInfo[pDonateRank] > 0)

{

    PlayerInfo[pPayDayHad] += 1;

    if(PlayerInfo[pPayDayHad] >= 5)

    {

        PlayerInfo[pExp]++;

        PlayerInfo[pPayDayHad] = 0;

    }

}

}

else

{

    SendClientMessage(i, COLOR_WHITE, ": Ne pare rau dar trebuie sa joci 39 minute pentru a primi PayDay.");

}

}

}

}

SaveAccounts();

return 1;

}

[/pawn] dar vezi sa schimbi doar pana la public split(const strsrc[], strdest[][], delimiter) si vezi sa nu uiti sa copiezi vreo paranteza

I'm back haha !

Link to comment
Share on other sites

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.