[Ajuda] public PayDay #bug
#1

Olв, hoje quero sua ajuda novamente, pois zй, minha gm tб meio bugada entгo й o seguinte, tenho um servidor e tenho esta seguinte 'public PayDay' bugada:

PHP код:
public PayDay()
{
    new 
string[128];
    new 
account,interest;
    new 
rent 0;
    new 
time random(20);
    
SetWeather(time);
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            if(
PlayerInfo[i][pLevel] > 0)
            {
            if(
gzbsdono == 1)
            {
               if(
PlayerInfo[i][pLeader] == || PlayerInfo[i][pMember] == 6)
               {
                 
GivePlayerMoneyEx(i,1000);
               }
               if(
PlayerInfo[i][pLeader] == || PlayerInfo[i][pMember] == || PlayerInfo[i][pLeader] == 10 || PlayerInfo[i][pMember] == 10)
               {
                 
GivePlayerMoneyEx(i,-2500);
               }
            }
            if(
GZCemiteriodono == 1)
            {
               if(
PlayerInfo[i][pLeader] == || PlayerInfo[i][pMember] == 5)
               {
                 
PlayerInfo[i][pDrogas] += 150;
                 
GivePlayerWeapon(i,24,50);
                 
GivePlayerWeapon(i,25,20);
                 
GivePlayerWeapon(i,29,300);
                 
GivePlayerWeapon(i,33,30);
                 
SetPlayerArmour(i,100);
                 
GivePlayerMoneyEx(i,300);
               }
            }
            else if(
GZCemiteriodono == 2)
            {
               if(
PlayerInfo[i][pLeader] == 15 || PlayerInfo[i][pMember] == 15)
               {
                 
PlayerInfo[i][pDrogas] += 150;
                 
GivePlayerWeapon(i,24,50);
                 
GivePlayerWeapon(i,25,20);
                 
GivePlayerWeapon(i,29,300);
                 
GivePlayerWeapon(i,33,30);
                 
SetPlayerArmour(i,100);
                 
GivePlayerMoneyEx(i,300);
               }
            }
            else if(
GZCemiteriodono == 3)
            {
               if(
PlayerInfo[i][pLeader] == 16 || PlayerInfo[i][pMember] == 16)
               {
                 
PlayerInfo[i][pDrogas] += 150;
                 
GivePlayerWeapon(i,24,50);
                 
GivePlayerWeapon(i,25,20);
                 
GivePlayerWeapon(i,29,300);
                 
GivePlayerWeapon(i,33,30);
                 
SetPlayerArmour(i,100);
                 
GivePlayerMoneyEx(i,300);
               }
            }
            else if(
GZCemiteriodono == 4)
            {
               if(
PlayerInfo[i][pLeader] == 12 || PlayerInfo[i][pMember] == 12)
               {
                 
PlayerInfo[i][pDrogas] += 150;
                 
GivePlayerWeapon(i,24,50);
                 
GivePlayerWeapon(i,25,20);
                 
GivePlayerWeapon(i,29,300);
                 
GivePlayerWeapon(i,33,30);
                 
SetPlayerArmour(i,100);
                 
GivePlayerMoneyEx(i,300);
               }
            }
            if(
gzCorredordono == 1)
            {
               if(
PlayerInfo[i][pLeader] == 14 || PlayerInfo[i][pMember] == 14)
               {
                 
PlayerInfo[i][pDrogas] += 150;
                 
GivePlayerWeapon(i,24,70);
                 
GivePlayerWeapon(i,29,300);
                 
GivePlayerWeapon(i,31,100);
                 
SetPlayerArmour(i,100);
                 
GivePlayerMoneyEx(i,500);
               }
            }
            else if(
gzCorredordono == 2)
            {
               if(
PlayerInfo[i][pLeader] == 17 || PlayerInfo[i][pMember] == 17)
               {
                 
PlayerInfo[i][pDrogas] += 150;
                 
GivePlayerWeapon(i,24,70);
                 
GivePlayerWeapon(i,29,300);
                 
GivePlayerWeapon(i,31,100);
                 
SetPlayerArmour(i,100);
                 
GivePlayerMoneyEx(i,500);
               }
            }
            if(
MoneyMessage[i]==&& PlayerInfo[i][pJailed] == 0)
                {
                    
SendClientMessage(i,COLOR_LIGHTRED,"Vocк nгo pagou a sua dнvida e lhe enviaram um pedido de prisгo!");
                    
GameTextForPlayer(i"~r~Apreendido !"20001);
                    
SetPlayerInterior(i,6);
                    
SetPlayerPos(i264.6288,77.5742,1001.0391);
                    
PlayerInfo[i][pJailed] = 1;
                    
ResetPlayerWeapons(i);
                    
PlayerInfo[i][pWantedLevel] = 0;
                    
PlayerInfo[i][pJailTime] = 600;
                    
format(string,sizeof(string),"Vocк esta preso por %d segundos.",PlayerInfo[i][pJailTime]);
                    
SendClientMessage(i,COLOR_LIGHTBLUE,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 GetPlayerMoneyEx(i))
                    {
                        
PlayerInfo[i][pPhousekey] = 255;
                        
SendClientMessage(i,COLOR_LIGHTRED,"Vocк nгo pagou o aluguel e foi despejado(a)!");
                        
rent 0;
                    }
                    
HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;
                }
                new 
tmpintrate;
                if (
key != 255 && strcmp(playername2,HouseInfo[key][hOwner],true) == 0)
                {
                    if(
PlayerInfo[i][pPremio] > 0) { tmpintrate intrate+4; }
                    else { 
tmpintrate intrate+2; }//HouseInfo[key][hLevel]
                
}
                else
                {
                    if(
PlayerInfo[i][pPremio] > 0) { tmpintrate 3; }
                    else { 
tmpintrate 1; }
                }
                if(
PlayerInfo[i][pPayDay] >= 5)
                {
                    
Tax += TaxValue// Should work for every player online.
                    
account PlayerInfo[i][pAccount];
                    
PlayerInfo[i][pAccount] -= TaxValue;
                    if(
PlayerInfo[i][pPremio] > 1)
                    {
                        new 
bonus PlayerInfo[i][pSalario] / 2;
                        
PlayerInfo[i][pSalario] += bonus;
                    }
                    new 
carro PlayerInfo[i][pCarro];
                    new 
IPVA CarInfo[carro][cValue]/500;
//                    new checks = PlayerInfo[i][pSalario] - 500;
                    
new ebill = (PlayerInfo[i][pAccount]/5000)*(PlayerInfo[i][pLevel]);//20000
                    
new checks PlayerInfo[i][pSalario];
                    if(
gzuldono == 1)
                    {
                       if(
PlayerInfo[i][pLeader] == || PlayerInfo[i][pMember] == 6)
                       {
                           
GivePlayerMoneyEx(i,ebill);
                       }
                    }
                    
checks PlayerInfo[i][pAccount];
                    
ConsumingMoney[i] = 1;
                    if(
PlayerInfo[i][pAccount] > 0)
                    {
                        
PlayerInfo[i][pAccount] -= ebill;
                        
SBizzInfo[4][sbTill] += ebill;
                        
ExtortionSBiz(4,ebill/2);
                    }
                    else
                    {
                        
ebill 0;
                    }
                    
interest = (PlayerInfo[i][pAccount]/1000)*(tmpintrate);
                    new 
FGTS checks/50;
                    
account += checks;
                    
PlayerInfo[i][pFGTS] += FGTS;
                    
PlayerInfo[i][pExp]++;
                    
PlayerPlayMusic(i);
                    
checks PlayerInfo[i][pAccount];
                    
PlayerInfo[i][pAccount] = account+interest;
                    new 
salario PlayerInfo[i][pSalario];
                    
PlayerInfo[i][pAccount]=salario+PlayerInfo[i][pAccount];
                    
SendClientMessage(i,COLOR_WHITE"|======= EXTRATO BANCARIO =======|");
                    
format(string,sizeof(string),"Salбrio: $%d  Imposto: $%d",checks,TaxValue);
                    
SendClientMessage(i,COLOR_WHITE,string);
                    
format(string,sizeof(string),"Fundo de garantia: $%d",FGTS);
                    
SendClientMessage(i,COLOR_WHITE,string);
                    
HouseInfo[15][hTakings] += TaxValue;
                    if(
PlayerInfo[i][pPhousekey] != 255 || PlayerInfo[i][pPbiskey] != 255)
                    {
                        
format(string,sizeof(string),"Eletricidade: $%d",ebill);
                        
SendClientMessage(i,COLOR_WHITE,string);
                    }
                    if(
PlayerInfo[i][pCarro] != 255)
                    {
                        
format(string,sizeof(string),"IPVA: $%d",IPVA);
                        
SendClientMessage(i,COLOR_WHITE,string);
                        
GivePlayerMoneyEx(i,-IPVA);
                        
SBizzInfo[24][sbTill] += IPVA;
                        
SBizzInfo[24][sbProdutos]--;
                    }
                    if(
SBizzInfo[24][sbProdutos] == 0)
                    {
                       
SBizzInfo[24][sbProdutos]++;
                    }
                    
checks -= ebill;
                    
SendClientMessage(i,COLOR_WHITEstring);
                    
format(string,sizeof(string),"Aluguel: -$%d",rent);
                    
SendClientMessage(i,COLOR_WHITE,string);
                    
format(string,sizeof(string),"Juros: 0.%d porcento",tmpintrate);
                    
SendClientMessage(i,COLOR_WHITE,string);
                    
format(string,sizeof(string),"Juros ganho $%d",interest);
                    
SendClientMessage(i,COLOR_WHITE,string);
                    
format(string,sizeof(string),"Saldo Antigo: $%d  Novo Saldo: $%d",account,PlayerInfo[i][pAccount]);
                    
SendClientMessage(i,COLOR_WHITE,string);
                    
SendClientMessage(i,COLOR_WHITE"|--------------------------------------------------|");
                    
format(string,sizeof(string),"~y~PayDay~n~~w~Pagamento");
                    
GameTextForPlayer(i,string,5000,1);
                    
rent 0;
//                    GivePlayerGP(i, checks);
                    
PlayerInfo[i][pPayDay] = 0;
                    
PlayerInfo[i][pSalario] = 0;
                    
PlayerInfo[i][pConnectTime] += 1;
                    if(
PlayerInfo[i][pPremio] >= 1)
                    {
                        
PlayerInfo[i][pPayDayHad] += 1;
                        if(
PlayerInfo[i][pPayDayHad] >= 3)
                        {
                            
PlayerInfo[i][pPayDayHad] = 0;
                        }
                    }
                    new 
nxtlevel PlayerInfo[i][pLevel]+1// Sistema de level - By: Suk Nudock
                    
new expamount nxtlevel*levelexp;
                    if(
PlayerInfo[i][pExp] < expamount)
                    {
//                           format(string,sizeof(string), "Experiкncia: %d/%d - Necessбrio %d de exp para proximo nнvel.", PlayerInfo[i][pExp],expamount,(expamount-PlayerInfo[i][pExp]));
//                        SendClientMessage(i,COLOR_YELLOW,string);
                        
TextDrawUpdate(i);
                    }
                    else
                    {
                        
PlayerPlaySound(i11850.00.00.0);
                        
GivePlayerMoneyEx(i,1000);
                        
format(string,sizeof(string),"~r~Level Up",nxtlevel);
                        
PlayerInfo[i][pLevel]++;
                           
format(stringsizeof(string), "* Vocк precisara jogar %d horas para o prуximo nнvel!"expamount);
                        
SendClientMessage(i,COLOR_LIGHTBLUEstring);
                        
PlayerInfo[i][pExp] = 0;
                           
PlayerInfo[i][gPupgrade] = PlayerInfo[i][gPupgrade]+2;
                        
format(string,256,"Vocк tem %d pontos de melhoria. (( /melhorar ))",PlayerInfo[i][gPupgrade]);
                        
SendClientMessage(i,COLOR_WHITE,string);
                        
TextDrawUpdate(i);
                    }
                }
                else
                {
                    
SendClientMessage(i,COLOR_LIGHTRED,"* Vocк nгo jogou tempo suficiente ou estб ausente, nгo receberб o salбrio.");
                }
            }
        }
    }
    
format(string,sizeof(string),"Notнcias da Loterica: Jб comecou a loteria.");
    
OOCOff(COLOR_WHITE,string);
    new 
rand random(100);
    
Lotto(rand);
    
Checkprop();
    return 
1;

O bug й o seguinte, quando dar um PayDay no meu servidor, ele buga todo o jogador(a), pq nгo sei se tб depositando a grana do jogador(a) na sua conta bancaria, pois zй, eu nгo sei explica por isso quero sua ajuda, e outra o pagamento da gz das orgs esta dando a grana para o jogador direto em veis depositar na conta bancaria do jogador(a), af muita coisa dificil...

Quem vai me ajudar? nгo sу eu, meu servidor todo (players) agradece!
Reply
#2

Qual й a variбvel que armazena o valor que o player tem no banco?
Reply
#3

Acho que й este:

PlayerInfo[i][pAccount]=salario+PlayerInfo[i][pAccount];
Reply
#4

Por isso que nгo gosto de editar Game Mode. Acabo nгo entendendo nada do script.
Olhe esse tutorial sobre Operadores. Teуrico & Prбtico
Se PlayerInfo[i][pAccount] armazenar o valor da conta bancaria do player.
pawn Код:
PlayerInfo[i][pAccount] +valor; // substitua o valor pelo salario que o jogador ira receber.
Reply
#5

Okay
Reply
#6

Б entendi,

new do salario:

Код:
new salario = PlayerInfo[i][pSalario];
Tiro este:

Код:
PlayerInfo[i][pAccount]=salario+PlayerInfo[i][pAccount];
e coloco este:

Код:
PlayerInfo[i][pAccount] +salario; // substitua o valor pelo salario que o jogador ira receber.
Se for oque estou pensando jб terminei de desbugar esta 'public PayDay' .
Reply
#7

Nгo sei se estб certo nгo entendo o script do seu gm.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)