[Ajuda] Pagamento.
#1

Quando da pagamento(payday) no meu server todos vгo preso, tentei procurar oque ta causando esse bug nгo achei se alguem tiver ideia do que seja me ajuda ae valeu .
Reply
#2

Manda o PD
Reply
#3

pawn Код:
if(strcmp(cmd, "/payday", true) == 0)
    {
    if (PlayerInfo[playerid][pAdmin] >= 3000)
    {
    new mtext[20];
    new year, month,day;
    getdate(year, month, day);
    if(month == 1) { mtext = "Janeiro"; }
    else if(month == 2) { mtext = "Fevereiro"; }
    else if(month == 3) { mtext = "Marзo"; }
    else if(month == 4) { mtext = "Abril"; }
    else if(month == 5) { mtext = "Maio"; }
    else if(month == 6) { mtext = "Junho"; }
    else if(month == 7) { mtext = "Julho"; }
    else if(month == 8) { mtext = "Agosto"; }
    else if(month == 9) { mtext = "Setembro"; }
    else if(month == 10) { mtext = "Outubro"; }
    else if(month == 11) { mtext = "Novembro"; }
    else if(month == 12) { mtext = "Dezembro"; }
    new hour,minuite,second;
    gettime(hour,minuite,second);
    FixHour(hour);
    hour = shifthour;
    format(string, sizeof(string), "((Payday))  Hora: %d:%d", hour+1, minuite);
    SendClientMessage(playerid, COLOR_WHITE, string);
    PayDay();
    }
    else
    {
    SendClientMessage(playerid,COLOR_GREY, "[ERRO]Vocк nгo estб autorizado a usar este Comando!");
    }
    return 1;
    }
Reply
#4

post isto : PayDay
Reply
#5

public Payday()
Reply
#6

pawn Код:
public PayDay()
{
    new string[128];
    new account,interest,intereste;
    new rent = 0;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
                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 > GetPlayerGP(i))
                    {
                        PlayerInfo[i][pPhousekey] = 255;
                        SendClientMessage(i, COLOR_WHITE, "Vocк foi expulso");
                        rent = 0;
                    }
                    HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;
                }
                new tmpintrate;
                if(PlayerInfo[i][pDonateRank] > 0) { tmpintrate = 9; }
                if (key != 255 && PlayerInfo[i][pDonateRank] == 0) { tmpintrate = 3; }
                if (key == 255 && PlayerInfo[i][pDonateRank] == 0) { tmpintrate = 1; }
                if(PlayerInfo[i][pPayDay] >= 0)
                {
                    Tax += TaxValue;//Should work for every player online
                    PlayerInfo[i][pAccount] -= TaxValue;
                    if(PlayerInfo[i][pDonateRank] > 0)
                    {
                        new bonus = PlayerInfo[i][pPayCheck] / 2;
                        PlayerInfo[i][pPayCheck] += bonus;
                    }
                    new checks = PlayerInfo[i][pPayCheck];
                    new ebill = (PlayerInfo[i][pAccount]/40000)*(PlayerInfo[i][pLevel]);
                    new TaxEstado = 5000;
                    new wbill = (PlayerInfo[i][pAccount]/52000)*(PlayerInfo[i][pLevel]);
                    ConsumingMoney[i] = 1;
                    GivePlayerGP(i, checks);
                    if(PlayerInfo[i][pAccount] > 0)
                    {
                        PlayerInfo[i][pAccount] -= ebill;
                        SBizzInfo[4][sbTill] += ebill;
                    }
                    else
                    {
                        ebill = 0;
                    }
                    if(PlayerInfo[i][pAccount] > 0)
                    {
                        PlayerInfo[i][pAccount] -= wbill;
                        SBizzInfo[12][sbTill] += wbill;
                    }
                    else
                    {
                        wbill = 0;
                    }
                    PlayerInfo[i][pExp]++;
                    PlayerPlayMusic(i);
                    if(PlayerInfo[i][pMember] == 0)
                    {
                      SendClientMessage(i, COLOR_WHITE, "|___ EXTRATO DO BANCO ___|");
                      format(string, sizeof(string), "  Salбrio: R$500", TaxEstado);
                      GivePlayerGP(i, 500);
                      SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    if(PlayerInfo[i][pMember] == 1)
                    {
                      SendClientMessage(i, COLOR_WHITE, "|___ EXTRATO DO BANCO ___|");
                      format(string, sizeof(string), "  Salбrio: R$780", TaxEstado);
                      GivePlayerGP(i, 780);
                      SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    if(PlayerInfo[i][pMember] == 2)
                    {
                      SendClientMessage(i, COLOR_WHITE, "|___ EXTRATO DO BANCO ___|");
                      format(string, sizeof(string), "  Salбrio: R$680", TaxEstado);
                      GivePlayerGP(i, 680);
                      SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    if(PlayerInfo[i][pMember] == 3)
                    {
                      SendClientMessage(i, COLOR_WHITE, "|___ EXTRATO DO BANCO ___|");
                      format(string, sizeof(string), "  Salбrio: R$980", TaxEstado);
                      GivePlayerGP(i, 980);
                      SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    if(PlayerInfo[i][pMember] == 4)
                    {
                      SendClientMessage(i, COLOR_WHITE, "|___ EXTRATO DO BANCO ___|");
                      format(string, sizeof(string), "  Salбrio: R$1500", TaxEstado);
                      GivePlayerGP(i, 1500);
                      SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    if(PlayerInfo[i][pMember] == 5)
                    {
                      SendClientMessage(i, COLOR_WHITE, "|___ EXTRATO DO BANCO ___|");
                      format(string, sizeof(string), "  Salбrio: R$520", TaxEstado);
                      GivePlayerGP(i, 520);
                      SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    if(PlayerInfo[i][pMember] == 6)
                    {
                      SendClientMessage(i, COLOR_WHITE, "|___ EXTRATO DO BANCO ___|");
                      format(string, sizeof(string), "  Salбrio: R$520", TaxEstado);
                      GivePlayerGP(i, 520);
                      SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    if(PlayerInfo[i][pMember] == 7)
                    {
                      SendClientMessage(i, COLOR_WHITE, "|___ EXTRATO DO BANCO ___|");
                      format(string, sizeof(string), "  Salбrio: R$2100", TaxEstado);
                      GivePlayerGP(i, 2100);
                      SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    if(PlayerInfo[i][pMember] == 8)
                    {
                      SendClientMessage(i, COLOR_WHITE, "|___ EXTRATO DO BANCO ___|");
                      format(string, sizeof(string), "  Salбrio: R$970", TaxEstado);
                      GivePlayerGP(i, 970);
                      SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    if(PlayerInfo[i][pMember] == 9)
                    {
                      SendClientMessage(i, COLOR_WHITE, "|___ EXTRATO DO BANCO ___|");
                      format(string, sizeof(string), "  Salбrio: R$1250", TaxEstado);
                      GivePlayerGP(i, 1250);
                      SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    if(PlayerInfo[i][pMember] == 10)
                    {
                      SendClientMessage(i, COLOR_WHITE, "|___ EXTRATO DO BANCO ___|");
                      format(string, sizeof(string), "  Salбrio: R$520", TaxEstado);
                      GivePlayerGP(i, 520);
                      SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    if(PlayerInfo[i][pMember] == 12)
                    {
                      SendClientMessage(i, COLOR_WHITE, "|___ EXTRATO DO BANCO ___|");
                      format(string, sizeof(string), "  Salбrio: R$520", TaxEstado);
                      GivePlayerGP(i, 520);
                      SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    if(PlayerInfo[i][pMember] == 13)
                    {
                      SendClientMessage(i, COLOR_WHITE, "|___ EXTRATO DO BANCO ___|");
                      format(string, sizeof(string), "  Salбrio: R$520", TaxEstado);
                      GivePlayerGP(i, 520);
                      SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    if(PlayerInfo[i][pMember] == 14)
                    {
                      SendClientMessage(i, COLOR_WHITE, "|___ EXTRATO DO BANCO ___|");
                      format(string, sizeof(string), "[Emprego] Salбrio: R$350", TaxEstado);
                      GivePlayerGP(i, 350);
                      SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    if(PlayerInfo[i][pMember] == 15)
                    {
                      SendClientMessage(i, COLOR_WHITE, "|___ EXTRATO DO BANCO ___|");
                      format(string, sizeof(string), "  Salбrio: R$520", TaxEstado);
                      GivePlayerGP(i, 520);
                      SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    if(PlayerInfo[i][pMember] == 16)
                    {
                      SendClientMessage(i, COLOR_WHITE, "|___ EXTRATO DO BANCO ___|");
                      format(string, sizeof(string), "  Salбrio: R$980", TaxEstado);
                      GivePlayerGP(i, 980);
                      SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    if(PlayerInfo[i][pMember] == 17)
                    {
                      SendClientMessage(i, COLOR_WHITE, "|___ EXTRATO DO BANCO ___|");
                      format(string, sizeof(string), "  Salбrio: R$980", TaxEstado);
                      GivePlayerGP(i, 980);
                      SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    if(PlayerInfo[i][pMember] == 18)
                    {
                      SendClientMessage(i, COLOR_WHITE, "|___ EXTRATO DO BANCO ___|");
                      format(string, sizeof(string), "  Salбrio: R$520", TaxEstado);
                      GivePlayerGP(i, 520);
                      SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    if(PlayerInfo[i][pMember] == 19)
                    {
                      SendClientMessage(i, COLOR_WHITE, "|___ EXTRATO DO BANCO ___|");
                      format(string, sizeof(string), "  Salбrio: R$520", TaxEstado);
                      GivePlayerGP(i, 520);
                      SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    if(PlayerInfo[i][pMember] == 20)
                    {
                      SendClientMessage(i, COLOR_WHITE, "|___ EXTRATO DO BANCO ___|");
                      format(string, sizeof(string), "  Salбrio: R$520", TaxEstado);
                      GivePlayerGP(i, 520);
                      SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    if(PlayerInfo[i][pMember] == 21)
                    {
                      SendClientMessage(i, COLOR_WHITE, "|___ EXTRATO DO BANCO ___|");
                      format(string, sizeof(string), "  Salбrio: R$920", TaxEstado);
                      GivePlayerGP(i, 920);
                      SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    if(PlayerInfo[i][pMember] == 22)
                    {
                      SendClientMessage(i, COLOR_WHITE, "|___ EXTRATO DO BANCO ___|");
                      format(string, sizeof(string), "  Salбrio: R$1250", TaxEstado);
                      GivePlayerGP(i, 1250);
                      SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    if(PlayerInfo[i][pJob] >= 0)
                    {
                      format(string, sizeof(string), "  Seguro Emprego: R$500", TaxEstado);
                      GivePlayerGP(i, 500);
                      SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    if(PlayerInfo[i][pMember] == 21 || PlayerInfo[i][pMember] == 3 || PlayerInfo[i][pMember] == 1 || PlayerInfo[i][pMember] == 2 || PlayerInfo[i][pMember] == 7 || PlayerInfo[i][pMember] == 14)
                    {
                      format(string, sizeof(string), "  Seguro Governo: R$450", TaxEstado);
                      GivePlayerGP(i, 450);
                      SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    if(PlayerInfo[i][pPhousekey] != 255)
                    {
                        format(string, sizeof(string), "  Taxa elйtrica: R$ %d", ebill);
                        SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    if(PlayerInfo[i][pPhousekey] != 255)
                    {
                        format(string, sizeof(string), "  Taxa de бgua: R$ %d", wbill);
                        SendClientMessage(i, COLOR_GRAD1, string);
                    }
                    if(PlayerInfo[i][pDonateRank] <= 1)
                    {
                        interest = (PlayerInfo[i][pAccount]/1000)*(tmpintrate);
                        PlayerInfo[i][pAccount] = account+interest;
                        format(string, sizeof(string), "  Juros: 0.%d por cento",tmpintrate);
                        SendClientMessage(i, COLOR_GRAD1, string);
                        format(string, sizeof(string), "  Juros Obtidos R$ %d", interest);
                        SendClientMessage(i, COLOR_GRAD3, string);
                        SendClientMessage(i, COLOR_GRAD4, "|--------------------------------------|");
                        format(string, sizeof(string), "  Novo balanзo: R$ %d", PlayerInfo[i][pAccount]);
                        SendClientMessage(i, COLOR_GRAD5, string);
                    }
                    if(PlayerInfo[i][pDonateRank] == 2)
                    {
                        intereste = (PlayerInfo[i][pAccount]/100)*(2);
                        PlayerInfo[i][pAccount] = account+intereste;
                        format(string, sizeof(string), "  Juros: 2.0 por cento",tmpintrate);
                        SendClientMessage(i, COLOR_GRAD1, string);
                        format(string, sizeof(string), "  Juros Obtidos R$ %d", intereste);
                        SendClientMessage(i, COLOR_GRAD3, string);
                        SendClientMessage(i, COLOR_GRAD4, "|--------------------------------------|");
                        format(string, sizeof(string), "  Novo balanзo: R$ %d", PlayerInfo[i][pAccount]);
                        SendClientMessage(i, COLOR_GRAD5, string);
                    }
                    format(string, sizeof(string), "  Aluguel: R$ %d", rent);
                    SendClientMessage(i, COLOR_GRAD5, string);
                    format(string, sizeof(string), "~y~ ~b~Pagamento ~y~$");
                    GameTextForPlayer(i, string, 5000, 1);
                    rent = 0;
                    PlayerInfo[i][pPayDay] = 0;
                    PlayerInfo[i][pPayCheck] = 0;
                    PlayerInfo[i][pConnectTime] += 1;
                    if(PlayerInfo[i][pDonateRank] > 0)
                    {
                        PlayerInfo[i][pPayDayHad] += 1;
                        if(PlayerInfo[i][pPayDayHad] == 6 && PlayerInfo[i][pDonateRank] >= 1)
                        {
                            PlayerInfo[i][pExp]++;
                            PlayerInfo[i][pPayDayHad] = 0;
                        }
                    }
                }
                else
                {
                    SendClientMessage(i, COLOR_OOC, "Vocк nгo jogou o suficiente para ter seu Pagamento.");
           }
       }
    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;
}
Reply
#7

Agora que visualizei meu PAYDAY estб totalmente errado.. D:
Reply
#8

Alguem ajuda ai
Reply
#9

Nгo cheguei a identificar nenhuma variavel que setasse o(s) player(s) na prisгo.
Poste o sistema completo.
Reply
#10

HAUEHAUEHUAHEUHAUEHE
Me desculpe, mas isso й meio engraзado. Todo mundo vai preso HAUHEUAHEU Que fail.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)