Paycheck not showing to all
#1

Hi guys,
So i had a perfectly working payday system before but i wanted to turn it into a textdraw system. So when i did it it seemed to work fine, but i forgot i was the only one in the server. now i tried it out with a friend and it only shows to 1 person and doesnt even set the balance or anything to it. cAn anyone see whats wrong please?


EDIT: Also i got a command to launch the payday but if theres more then 1 person in the server it says Unknown Command. I also have put those textdraws for every player like: new paytext0[MAX_PLAYERS] and nothing helped. Please help me.

ANOTHER EDIT: Theres a minimum wait time per hour for a person to get a payday. I've made a command to give me the full time and launched the command to give the payday. If only i had the time to receive payday, it launched the command just fine, but if there is another person with enough time to receive payday too it doesnt launch and says Unknown Command.


So. Resuming all this: Payday aint working for more then one person. Idk why but every hour it gives the payday only to 1 person and no one else.

PHP код:
public:PayDay()
{
    for(new 
= -1MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            if(
gPlayerLogged[i] == 1)
            {
                if(
PlayerInfo[i][pJailed] == 0)
                {
                    if(
PlayerInfo[i][pAllowedPayday] >= 5)
                    {
                        if(
AFKMins[i] <= 400)
                        {
                            if(
PlayerInfo[i][pContBank] == 0)
                              {
                                  
SendClientMessage(i,COLOR_RED,"{FF0000}[Erro]: {FFFFFF}Infelizmente nгo criaste conta bancбria, logo nгo recebeste paycheck!");
                              }
                              else
                              {
                                 new 
wstring[113];
                                new 
randcheck 300 random(650);
                                new 
randvipcheck 1500 random(1500);
                                new 
rotas[MAX_PLAYERS];
                                new 
interest = (PlayerInfo[i][pBank]/1000)*(intrate);
                                new 
boost GetPlayers()*10;
                                 new 
randtax cash5;
                                 new 
salariofac[MAX_PLAYERS];
                                new 
faction PlayerInfo[i][pFaction];
                                new 
rank PlayerInfo[i][pRank];
                                
PlayerInfo[i][pQuinzedias]++;
                                
PlayerInfo[i][pBank] += interest;
                                
PlayerInfo[i][pBank] -= randtax;
                                
PlayerInfo[i][pBank] += randcheck;
                                
PlayerInfo[i][pBank] += boost;
                                   
DynamicFactions[0][fBank] += boost;
                                
PlayerInfo[i][pPayCheck] = 0;
                                
PlayerInfo[i][pAllowedPayday] = 0;
                                
PlayerInfo[i][pExp]++;
                                
PlayerInfo[i][pPlayingHours] += 1;
                                
DynamicFactions[6][fBank] += randtax;
                                
PlayerPlayMusic(i);
                                
Plantardn[i] = 0;
                                
TextDrawShowForPlayer(ipaytext0);
                                
TextDrawShowForPlayer(ipaytext1);
                                
TextDrawShowForPlayer(ipaytext2);
                                
TextDrawShowForPlayer(ipaytext3);
                                
TextDrawShowForPlayer(ipaytext4);
                                
TextDrawShowForPlayer(ipaytext5);
                                
TextDrawShowForPlayer(ipaytext6);
                                
TextDrawShowForPlayer(ipaytext7);
                                
TextDrawShowForPlayer(ipaytext8);
                                
TextDrawShowForPlayer(ipaytext9);
                                
TextDrawShowForPlayer(ipaytext10);
                                
TextDrawShowForPlayer(ipaytext11);
                                
TextDrawShowForPlayer(ipaytext12);
                                
TextDrawShowForPlayer(ipaytext13);
                                
TextDrawShowForPlayer(ipaytext14);
                                
TextDrawShowForPlayer(ipaytext15);
                                
TextDrawShowForPlayer(ipaytext16);
                                
TextDrawShowForPlayer(ipaytext17);
                                
TextDrawShowForPlayer(ipaytext18);
                                
TextDrawShowForPlayer(ipaytext19);
                                
TextDrawShowForPlayer(ipaytext20);
                                
TextDrawShowForPlayer(ipaytext21);
                                
TextDrawShowForPlayer(ipaytext22);
                                
TextDrawShowForPlayer(ipaytext23);
                                
TextDrawShowForPlayer(ipaytext24);
                                
TextDrawShowForPlayer(ipaytext27);
                                
TextDrawShowForPlayer(ipaytext28);
                                if(
PlayerInfo[i][pQuinzedias] == 2)
                                {
                                    
PlayerInfo[i][pQuinzedias] = 0;
                                    
PlayerInfo[i][pMeses]++;
                                    if(
PlayerInfo[i][pMeses] == 12)
                                    {
                                        
PlayerInfo[i][pMeses] = 0;
                                        
PlayerInfo[i][pAge]++;
                                        
format(wstringsizeof(wstring), "PARABENS!!!! Й o teu aniversбrio, fizeste agora %d anos!"PlayerInfo[i][pAge]);
                                        
SendClientMessage(i,COLOR_WHITE,wstring);
                                    }
                                    else if(
PlayerInfo[i][pMeses] > && PlayerInfo[i][pMeses] < 12)
                                    {
                                        
format(wstringsizeof(wstring), "Tens agora %d anos e %d meses."PlayerInfo[i][pAge], PlayerInfo[i][pMeses]);
                                        
SendClientMessage(i,COLOR_WHITE,wstring);
                                    }
                                }
                                
                                if(
PlayerInfo[i][pNRotasE] >= 1)
                                {
                                       new 
price;
                                    if(
PlayerInfo[i][pCursEng] == 1)
                                    {
                                        
price 100*PlayerInfo[i][pNivelJob];
                                    }
                                    else
                                    {
                                        
price 50*PlayerInfo[i][pNivelJob];
                                    }
                                    
PlayerInfo[i][pBank] += price*PlayerInfo[i][pNRotasE];
                                    
rotas[i] = price*PlayerInfo[i][pNRotasE];
                                    
PlayerInfo[i][pNRotasE] = 0;
                                }
                                new 
succeed random(40);
                                if(
succeed == 1)
                                {
                                    
PlayerInfo[i][pGripe] = 1;
                                }
                                else if(
succeed == 2)
                                {
                                    
PlayerInfo[i][pDoresDeCabeca] = 1;
                                }
                                else if(
succeed == 3)
                                {
                                    
PlayerInfo[i][pDiaReia] = 1;
                                }
                                if(
PlayerInfo[i][pEmprestimo] > 0)
                                {
                                    new 
EDE PlayerInfo[i][pEmprestimoC];
                                    
PlayerInfo[i][pEmprestimo] = PlayerInfo[i][pEmprestimo] - 1000;
                                    
PlayerInfo[i][pBank] -= 1000;
                                    
Businesses[EDE][Till] = Businesses[EDE][Till] + 1000;
                                    if(
PlayerInfo[i][pEmprestimo] <= 0)
                                    {
                                        
PlayerInfo[i][pEmprestimo] = 0;
                                        
PlayerInfo[i][pEmprestimoC] = 255;
                                    }
                                }
                                if(
PlayerInfo[i][pAluguer] >= 1)
                                {
                                    new 
PDAC PlayerInfo[i][pAluguer];
                                    new 
CDCA PlayerInfo[i][pHouseKey];
                                    
PlayerInfo[i][pBank] -= PDAC;
                                    
Houses[CDCA][Money] = Houses[CDCA][Money] + PDAC;
                                }
                                if(
PlayerInfo[i][pVipActive] != 0)
                                {
                                    
PlayerInfo[i][pBank] += randvipcheck;
                                    
PlayerInfo[i][pVipActive] = PlayerInfo[i][pVipActive] - 1;
                                    
format(wstringsizeof(wstring), "Bonus Vip:$%d [ Golds restantes: %d]"randvipcheckPlayerInfo[i][pVipActive]);
                                      
SendClientMessage(i,COLOR_WHITEwstring);
                                }
                                if(
PlayerInfo[i][pFaction] != 255)
                                {
                                    new 
GetFaction DynamicFactions[PlayerInfo[i][pFaction]][fType];
                                    if(
GetFaction == || GetFaction == || GetFaction == || GetFaction == || GetFaction == 6)
                                    {
                                         if(
rank == 1)
                                        {
                                            
PlayerInfo[i][pBank] += DynamicFactionsSalary[faction][fSalary1];
                                            
DynamicFactions[faction][fBank]-=DynamicFactionsSalary[faction][fSalary1];
                                            
salariofac[i] = DynamicFactionsSalary[faction][fSalary1];
                                            
format(wstringsizeof(wstring), "Salario: $%d [ Rank: %s ] [Balanзo Faction:$%d ]"DynamicFactionsSalary[faction][fSalary1], DynamicFactions[faction][fRank1], DynamicFactions[faction][fBank]);
                                            
SendClientMessage(i,COLOR_WHITEwstring);
                                        }
                                         else if(
rank == 2)
                                        {
                                            
PlayerInfo[i][pBank] += DynamicFactionsSalary[faction][fSalary2];
                                            
DynamicFactions[faction][fBank]-= DynamicFactionsSalary[faction][fSalary2];
                                            
salariofac[i] = DynamicFactionsSalary[faction][fSalary2];
                                            
format(wstringsizeof(wstring), "Salario: $%d [ Rank: %s ] [Balanзo Faction:$%d ]"DynamicFactionsSalary[faction][fSalary2], DynamicFactions[faction][fRank2], DynamicFactions[faction][fBank]);
                                            
SendClientMessage(i,COLOR_WHITEwstring);
                                        }
                                         else if(
rank == 3)
                                        {
                                            
PlayerInfo[i][pBank] += DynamicFactionsSalary[faction][fSalary3];
                                            
DynamicFactions[faction][fBank]-= DynamicFactionsSalary[faction][fSalary3];
                                            
salariofac[i] = DynamicFactionsSalary[faction][fSalary3];
                                            
format(wstringsizeof(wstring), "Salario: $%d [ Rank: %s ] "DynamicFactionsSalary[faction][fSalary3], DynamicFactions[faction][fRank3]);
                                            
SendClientMessage(i,COLOR_WHITEwstring);
                                        }
                                         else if(
rank == 4)
                                        {
                                            
PlayerInfo[i][pBank] += DynamicFactionsSalary[faction][fSalary4];
                                            
DynamicFactions[faction][fBank]-= DynamicFactionsSalary[faction][fSalary4];
                                            
salariofac[i] = DynamicFactionsSalary[faction][fSalary4];
                                            
format(wstringsizeof(wstring), "Salario: $%d [ Rank: %s ] "DynamicFactionsSalary[faction][fSalary4], DynamicFactions[faction][fRank4]);
                                            
SendClientMessage(i,COLOR_WHITEwstring);
                                        }
                                         else if(
rank == 5)
                                        {
                                            
PlayerInfo[i][pBank] += DynamicFactionsSalary[faction][fSalary5];
                                            
DynamicFactions[faction][fBank]-= DynamicFactionsSalary[faction][fSalary5];
                                            
salariofac[i] = DynamicFactionsSalary[faction][fSalary5];
                                            
format(wstringsizeof(wstring), "Salario: $%d [ Rank: %s ] "DynamicFactionsSalary[faction][fSalary5], DynamicFactions[faction][fRank5]);
                                            
SendClientMessage(i,COLOR_WHITEwstring);
                                        }
                                         else if(
rank == 6)
                                        {
                                            
PlayerInfo[i][pBank] += DynamicFactionsSalary[faction][fSalary6];
                                            
DynamicFactions[faction][fBank]-= DynamicFactionsSalary[faction][fSalary6];
                                            
salariofac[i] = DynamicFactionsSalary[faction][fSalary6];
                                            
format(wstringsizeof(wstring), "Salario: $%d [ Rank: %s ] "DynamicFactionsSalary[faction][fSalary6], DynamicFactions[faction][fRank6]);
                                            
SendClientMessage(i,COLOR_WHITEwstring);
                                        }
                                         else if(
rank == 7)
                                        {
                                            
PlayerInfo[i][pBank] += DynamicFactionsSalary[faction][fSalary7];
                                            
DynamicFactions[faction][fBank]-= DynamicFactionsSalary[faction][fSalary7];
                                            
salariofac[i] = DynamicFactionsSalary[faction][fSalary7];
                                            
format(wstringsizeof(wstring), "Salario: $%d [ Rank: %s ] "DynamicFactionsSalary[faction][fSalary7], DynamicFactions[faction][fRank7]);
                                            
SendClientMessage(i,COLOR_WHITEwstring);
                                        }
                                         else if(
rank == 8)
                                        {
                                            
PlayerInfo[i][pBank] += DynamicFactionsSalary[faction][fSalary8];
                                            
DynamicFactions[faction][fBank]-= DynamicFactionsSalary[faction][fSalary8];
                                            
salariofac[i] = DynamicFactionsSalary[faction][fSalary8];
                                            
format(wstringsizeof(wstring), "Salario: $%d [ Rank: %s ] "DynamicFactionsSalary[faction][fSalary8], DynamicFactions[faction][fRank8]);
                                            
SendClientMessage(i,COLOR_WHITEwstring);
                                        }
                                         else if(
rank == 9)
                                        {
                                            
PlayerInfo[i][pBank] += DynamicFactionsSalary[faction][fSalary9];
                                            
DynamicFactions[faction][fBank]-= DynamicFactionsSalary[faction][fSalary9];
                                            
salariofac[i] = DynamicFactionsSalary[faction][fSalary9];
                                            
format(wstringsizeof(wstring), "Salario: $%d [ Rank: %s ] "DynamicFactionsSalary[faction][fSalary9], DynamicFactions[faction][fRank9]);
                                            
SendClientMessage(i,COLOR_WHITEwstring);
                                        }
                                         else if(
rank == 10)
                                        {
                                            
PlayerInfo[i][pBank] += DynamicFactionsSalary[faction][fSalary10];
                                            
DynamicFactions[faction][fBank]-= DynamicFactionsSalary[faction][fSalary10];
                                            
salariofac[i] = DynamicFactionsSalary[faction][fSalary10];
                                            
format(wstringsizeof(wstring), "Salario: $%d [ Rank: %s ] "DynamicFactionsSalary[faction][fSalary10], DynamicFactions[faction][fRank10]);
                                            
SendClientMessage(i,COLOR_WHITEwstring);
                                        }
                                        if( 
CopOnDuty[i] == || MedicOnDuty[i] == || MecanicOnDuty[i] == )
                                        {
                                            
PlayerInfo[i][pHorasDuty] += 1;
                                        }
                                        
                                        
                                    }
                                }
                                new 
nxtlevel PlayerInfo[i][pLevel]+1;
                        new 
expamount nxtlevel*3;
                        if(
PlayerInfo[i][pExp] < expamount)
                        {
                        }
                        else
                        {
                               
format(wstringsizeof(wstring), "Subiste de nivel, parabens, йs agora nivel: %d."nxtlevel);
                            
SendClientMessage(i,COLOR_WHITEwstring);
                            
PlayerInfo[i][pLevel]++;
                               
format(wstringsizeof(wstring), "Para subires mais outro nivel, precisas de %d/%d de experiкncia.",expamount,expamount);
                            
SendClientMessage(i,COLOR_WHITEwstring);
                            
PlayerInfo[i][pExp] = 0;
                            if(
PlayerInfo[i][pVipActive] == 0)
                            {
                                new 
bonus PlayerInfo[i][pLevel]*500;
                                
format(wstringsizeof(wstring), "Ganhaste Bуnus por subires de nivel: %d."bonus);
                                
SendClientMessage(i,COLOR_WHITEwstring);
                                
PlayerInfo[i][pBank] += bonus;
                                
DynamicFactions[0][fBank] -= bonus;
                            }
                            else if(
PlayerInfo[i][pVipActive] != 0)
                            {
                                new 
bonus PlayerInfo[i][pLevel]*1000;
                                
format(wstringsizeof(wstring), "Ganhaste Bуnus por subires de nivel: %d."bonus);
                                
SendClientMessage(i,COLOR_WHITEwstring);
                                
PlayerInfo[i][pBank] += bonus;
                                
DynamicFactions[0][fBank] -= bonus;
                            }
                          }
                                        new 
salariofinal;
                                        
salariofinal randcheck salariofac[i] + rotas[i];
                                        new 
salario[128];
                                        
format(salario,sizeof(salario), "%d"salariofinal);
                                        
TextDrawSetString(paytext10salario);
                                        new 
novobalanco[128];
                                        
format(novobalanco,sizeof(novobalanco), "%d"PlayerInfo[i][pBank]);
                                        
TextDrawSetString(paytext11novobalanco);
                                        new 
exp[128];
                                        
format(expsizeof(exp), "%d/%d",PlayerInfo[i][pExp],expamount);
                                        
TextDrawSetString(paytext12exp);
                                        new 
irs[128];
                                        
format(irssizeof(irs),"-%d"randtax);
                                        
TextDrawSetString(paytext13irs);
                                        if(
PlayerInfo[i][pEmprestimo] > 0)
                                        {
                                        
TextDrawSetString(paytext14"-1000$");
                                        }
                                        else
                                        {
                                        
TextDrawSetString(paytext14"0$");
                                        }
                                        new 
renda[128];
                                        
format(renda,sizeof(renda), "-%d"PlayerInfo[i][pAluguer]);
                                        
TextDrawSetString(paytext15renda);
                                        new 
num1[128];
                                        new 
num2[128];
                                        new 
num3[128];
                                        new 
num4[128];
                                        new 
num5[128];
                                        new 
star1[128];
                                        new 
star2[128];
                                        
format(num1sizeof(num1), "%d"PlayerNumber[0][i]);
                                        
format(num2sizeof(num2), "%d"PlayerNumber[1][i]);
                                        
format(num3sizeof(num3), "%d"PlayerNumber[2][i]);
                                        
format(num4sizeof(num4), "%d"PlayerNumber[3][i]);
                                        
format(num5sizeof(num5), "%d"PlayerNumber[4][i]);
                                        
format(star1sizeof(star1), "%d"PlayerStar[0][i]);
                                        
format(star2sizeof(star2), "%d"PlayerStar[1][i]);
                                        
TextDrawSetString(paytext18num1);
                                        
TextDrawSetString(paytext19num2);
                                        
TextDrawSetString(paytext20num3);
                                        
TextDrawSetString(paytext21num4);
                                        
TextDrawSetString(paytext22num5);
                                        
TextDrawSetString(paytext23star1);
                                        
TextDrawSetString(paytext24star2);
                                        
SetTimerEx("paynovo"10000false"i"i);
                                        
                                        
                                        
                                if ((
aevento) == 1)
                                {
                                    
PlayerInfo[i][pBank] += 200;
                                    
SendClientMessage(i,COLOR_GREEN"[EVENTO]: Recebeste um bonus de 200$ graзas ao evento");
                                }
                                if(
PlayerInfo[i][pAge] >= 85)
                                {
                                    new 
Morre random(2)+1;
                                    if(
Morre == 1)
                                    {
                                        
PlayerInfo[i][pCK] = 1;
                                        
OnPlayerDataSave(i);
                                        
format(wstringsizeof(wstring), "A Personagem %s foi morta(CK)devido a uma longa idade, que descanses em paz amigo."GetPlayerNameEx(i));
                                        
SendClientMessageToAll(COLOR_ADMINCMDwstring);
                                        
KickPlayer(i,"WhiteValley Bot","A tua personagem foi morta. Para voltares a jogar terбs de criar uma nova(nova conta).");
                                        return 
1;
                                    }
                                }
                               }
                          }
                          
                        else
                        {
                            
ReceberPayDAy[i] = 1;
                            
SetTimerEx("PayDay_Ex_AFK"60000false"d"i);
                            
SendClientMessage(i,COLOR_WHITE,"{1E90FF}[INFO]: {FFFFFF} Se dentro de 1 Minuto se nгo mexeres, pederбs o paycheck!!");
                        }
                    }
                    else
                    {
                        
SendClientMessage(i,COLOR_WHITE,"{1E90FF}[INFO]: {FFFFFF} Nгo jogaste tempo suficiente para receberes o paycheck.");
                    }
                }
                else
                {
                    
SendClientMessage(i,COLOR_WHITE,"{1E90FF}[INFO]: {FFFFFF} Estбs no AdminJail(AJ), por isso nгo recebeste paycheck!");
                }
            }
            else
            {
                
SendClientMessage(i,COLOR_WHITE,"{1E90FF}[INFO]: {FFFFFF} Nao estas logado, nao recebeste o paycheck.");
            }
        }
    }
    if(
Respawn == -&& CountDown == -1)
    {
        
Respawn 16;
        
SetTimer("Respawns",1000,0);
        
SendClientMessageToAll(COLOR_WHITE,"{1E90FF}[INFO]: {FFFFFF} Respawn de todos veiculos desocupados em 15 segundos!!!");
    }
    else
    {
        
SendClientMessageToAll(COLOR_WHITE,"{1E90FF}[INFO]: {FFFFFF} Respawn cancelado devido a um Respawn em andamento.");
    }
    return 
1;

Reply
#2

Remove the "return 1;"

Replace this with your current one:
PHP код:
if(Morre == 1

        
PlayerInfo[i][pCK] = 1
        
OnPlayerDataSave(i); 
        
format(wstringsizeof(wstring), "A Personagem %s         foi morta(CK)devido a uma longa idade, que descanses   em paz amigo."GetPlayerNameEx(i));                                                  
        
SendClientMessageToAll(COLOR_ADMINCMDwstring); 
        
KickPlayer(i,"WhiteValley Bot","A tua personagem foi morta. Para voltares a jogar terбs de criar uma nova(nova conta)."); 

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)