08.08.2016, 00:06
(
Последний раз редактировалось GunZsmd; 08.08.2016 в 01:03.
)
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.
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 i = -1; i < MAX_PLAYERS; i++)
{
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(i, paytext0);
TextDrawShowForPlayer(i, paytext1);
TextDrawShowForPlayer(i, paytext2);
TextDrawShowForPlayer(i, paytext3);
TextDrawShowForPlayer(i, paytext4);
TextDrawShowForPlayer(i, paytext5);
TextDrawShowForPlayer(i, paytext6);
TextDrawShowForPlayer(i, paytext7);
TextDrawShowForPlayer(i, paytext8);
TextDrawShowForPlayer(i, paytext9);
TextDrawShowForPlayer(i, paytext10);
TextDrawShowForPlayer(i, paytext11);
TextDrawShowForPlayer(i, paytext12);
TextDrawShowForPlayer(i, paytext13);
TextDrawShowForPlayer(i, paytext14);
TextDrawShowForPlayer(i, paytext15);
TextDrawShowForPlayer(i, paytext16);
TextDrawShowForPlayer(i, paytext17);
TextDrawShowForPlayer(i, paytext18);
TextDrawShowForPlayer(i, paytext19);
TextDrawShowForPlayer(i, paytext20);
TextDrawShowForPlayer(i, paytext21);
TextDrawShowForPlayer(i, paytext22);
TextDrawShowForPlayer(i, paytext23);
TextDrawShowForPlayer(i, paytext24);
TextDrawShowForPlayer(i, paytext27);
TextDrawShowForPlayer(i, paytext28);
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(wstring, sizeof(wstring), "PARABENS!!!! Й o teu aniversбrio, fizeste agora %d anos!", PlayerInfo[i][pAge]);
SendClientMessage(i,COLOR_WHITE,wstring);
}
else if(PlayerInfo[i][pMeses] > 0 && PlayerInfo[i][pMeses] < 12)
{
format(wstring, sizeof(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 = 1 + 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(wstring, sizeof(wstring), "Bonus Vip:$%d [ Golds restantes: %d]", randvipcheck, PlayerInfo[i][pVipActive]);
SendClientMessage(i,COLOR_WHITE, wstring);
}
if(PlayerInfo[i][pFaction] != 255)
{
new GetFaction = DynamicFactions[PlayerInfo[i][pFaction]][fType];
if(GetFaction == 1 || GetFaction == 2 || GetFaction == 3 || GetFaction == 4 || GetFaction == 6)
{
if(rank == 1)
{
PlayerInfo[i][pBank] += DynamicFactionsSalary[faction][fSalary1];
DynamicFactions[faction][fBank]-=DynamicFactionsSalary[faction][fSalary1];
salariofac[i] = DynamicFactionsSalary[faction][fSalary1];
format(wstring, sizeof(wstring), "Salario: $%d [ Rank: %s ] [Balanзo Faction:$%d ]", DynamicFactionsSalary[faction][fSalary1], DynamicFactions[faction][fRank1], DynamicFactions[faction][fBank]);
SendClientMessage(i,COLOR_WHITE, wstring);
}
else if(rank == 2)
{
PlayerInfo[i][pBank] += DynamicFactionsSalary[faction][fSalary2];
DynamicFactions[faction][fBank]-= DynamicFactionsSalary[faction][fSalary2];
salariofac[i] = DynamicFactionsSalary[faction][fSalary2];
format(wstring, sizeof(wstring), "Salario: $%d [ Rank: %s ] [Balanзo Faction:$%d ]", DynamicFactionsSalary[faction][fSalary2], DynamicFactions[faction][fRank2], DynamicFactions[faction][fBank]);
SendClientMessage(i,COLOR_WHITE, wstring);
}
else if(rank == 3)
{
PlayerInfo[i][pBank] += DynamicFactionsSalary[faction][fSalary3];
DynamicFactions[faction][fBank]-= DynamicFactionsSalary[faction][fSalary3];
salariofac[i] = DynamicFactionsSalary[faction][fSalary3];
format(wstring, sizeof(wstring), "Salario: $%d [ Rank: %s ] ", DynamicFactionsSalary[faction][fSalary3], DynamicFactions[faction][fRank3]);
SendClientMessage(i,COLOR_WHITE, wstring);
}
else if(rank == 4)
{
PlayerInfo[i][pBank] += DynamicFactionsSalary[faction][fSalary4];
DynamicFactions[faction][fBank]-= DynamicFactionsSalary[faction][fSalary4];
salariofac[i] = DynamicFactionsSalary[faction][fSalary4];
format(wstring, sizeof(wstring), "Salario: $%d [ Rank: %s ] ", DynamicFactionsSalary[faction][fSalary4], DynamicFactions[faction][fRank4]);
SendClientMessage(i,COLOR_WHITE, wstring);
}
else if(rank == 5)
{
PlayerInfo[i][pBank] += DynamicFactionsSalary[faction][fSalary5];
DynamicFactions[faction][fBank]-= DynamicFactionsSalary[faction][fSalary5];
salariofac[i] = DynamicFactionsSalary[faction][fSalary5];
format(wstring, sizeof(wstring), "Salario: $%d [ Rank: %s ] ", DynamicFactionsSalary[faction][fSalary5], DynamicFactions[faction][fRank5]);
SendClientMessage(i,COLOR_WHITE, wstring);
}
else if(rank == 6)
{
PlayerInfo[i][pBank] += DynamicFactionsSalary[faction][fSalary6];
DynamicFactions[faction][fBank]-= DynamicFactionsSalary[faction][fSalary6];
salariofac[i] = DynamicFactionsSalary[faction][fSalary6];
format(wstring, sizeof(wstring), "Salario: $%d [ Rank: %s ] ", DynamicFactionsSalary[faction][fSalary6], DynamicFactions[faction][fRank6]);
SendClientMessage(i,COLOR_WHITE, wstring);
}
else if(rank == 7)
{
PlayerInfo[i][pBank] += DynamicFactionsSalary[faction][fSalary7];
DynamicFactions[faction][fBank]-= DynamicFactionsSalary[faction][fSalary7];
salariofac[i] = DynamicFactionsSalary[faction][fSalary7];
format(wstring, sizeof(wstring), "Salario: $%d [ Rank: %s ] ", DynamicFactionsSalary[faction][fSalary7], DynamicFactions[faction][fRank7]);
SendClientMessage(i,COLOR_WHITE, wstring);
}
else if(rank == 8)
{
PlayerInfo[i][pBank] += DynamicFactionsSalary[faction][fSalary8];
DynamicFactions[faction][fBank]-= DynamicFactionsSalary[faction][fSalary8];
salariofac[i] = DynamicFactionsSalary[faction][fSalary8];
format(wstring, sizeof(wstring), "Salario: $%d [ Rank: %s ] ", DynamicFactionsSalary[faction][fSalary8], DynamicFactions[faction][fRank8]);
SendClientMessage(i,COLOR_WHITE, wstring);
}
else if(rank == 9)
{
PlayerInfo[i][pBank] += DynamicFactionsSalary[faction][fSalary9];
DynamicFactions[faction][fBank]-= DynamicFactionsSalary[faction][fSalary9];
salariofac[i] = DynamicFactionsSalary[faction][fSalary9];
format(wstring, sizeof(wstring), "Salario: $%d [ Rank: %s ] ", DynamicFactionsSalary[faction][fSalary9], DynamicFactions[faction][fRank9]);
SendClientMessage(i,COLOR_WHITE, wstring);
}
else if(rank == 10)
{
PlayerInfo[i][pBank] += DynamicFactionsSalary[faction][fSalary10];
DynamicFactions[faction][fBank]-= DynamicFactionsSalary[faction][fSalary10];
salariofac[i] = DynamicFactionsSalary[faction][fSalary10];
format(wstring, sizeof(wstring), "Salario: $%d [ Rank: %s ] ", DynamicFactionsSalary[faction][fSalary10], DynamicFactions[faction][fRank10]);
SendClientMessage(i,COLOR_WHITE, wstring);
}
if( CopOnDuty[i] == 1 || MedicOnDuty[i] == 1 || MecanicOnDuty[i] == 1 )
{
PlayerInfo[i][pHorasDuty] += 1;
}
}
}
new nxtlevel = PlayerInfo[i][pLevel]+1;
new expamount = nxtlevel*3;
if(PlayerInfo[i][pExp] < expamount)
{
}
else
{
format(wstring, sizeof(wstring), "Subiste de nivel, parabens, йs agora nivel: %d.", nxtlevel);
SendClientMessage(i,COLOR_WHITE, wstring);
PlayerInfo[i][pLevel]++;
format(wstring, sizeof(wstring), "Para subires mais outro nivel, precisas de %d/%d de experiкncia.",expamount,expamount);
SendClientMessage(i,COLOR_WHITE, wstring);
PlayerInfo[i][pExp] = 0;
if(PlayerInfo[i][pVipActive] == 0)
{
new bonus = PlayerInfo[i][pLevel]*500;
format(wstring, sizeof(wstring), "Ganhaste Bуnus por subires de nivel: %d.", bonus);
SendClientMessage(i,COLOR_WHITE, wstring);
PlayerInfo[i][pBank] += bonus;
DynamicFactions[0][fBank] -= bonus;
}
else if(PlayerInfo[i][pVipActive] != 0)
{
new bonus = PlayerInfo[i][pLevel]*1000;
format(wstring, sizeof(wstring), "Ganhaste Bуnus por subires de nivel: %d.", bonus);
SendClientMessage(i,COLOR_WHITE, wstring);
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(paytext10, salario);
new novobalanco[128];
format(novobalanco,sizeof(novobalanco), "%d", PlayerInfo[i][pBank]);
TextDrawSetString(paytext11, novobalanco);
new exp[128];
format(exp, sizeof(exp), "%d/%d",PlayerInfo[i][pExp],expamount);
TextDrawSetString(paytext12, exp);
new irs[128];
format(irs, sizeof(irs),"-%d", randtax);
TextDrawSetString(paytext13, irs);
if(PlayerInfo[i][pEmprestimo] > 0)
{
TextDrawSetString(paytext14, "-1000$");
}
else
{
TextDrawSetString(paytext14, "0$");
}
new renda[128];
format(renda,sizeof(renda), "-%d", PlayerInfo[i][pAluguer]);
TextDrawSetString(paytext15, renda);
new num1[128];
new num2[128];
new num3[128];
new num4[128];
new num5[128];
new star1[128];
new star2[128];
format(num1, sizeof(num1), "%d", PlayerNumber[0][i]);
format(num2, sizeof(num2), "%d", PlayerNumber[1][i]);
format(num3, sizeof(num3), "%d", PlayerNumber[2][i]);
format(num4, sizeof(num4), "%d", PlayerNumber[3][i]);
format(num5, sizeof(num5), "%d", PlayerNumber[4][i]);
format(star1, sizeof(star1), "%d", PlayerStar[0][i]);
format(star2, sizeof(star2), "%d", PlayerStar[1][i]);
TextDrawSetString(paytext18, num1);
TextDrawSetString(paytext19, num2);
TextDrawSetString(paytext20, num3);
TextDrawSetString(paytext21, num4);
TextDrawSetString(paytext22, num5);
TextDrawSetString(paytext23, star1);
TextDrawSetString(paytext24, star2);
SetTimerEx("paynovo", 10000, false, "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(wstring, sizeof(wstring), "A Personagem %s foi morta(CK)devido a uma longa idade, que descanses em paz amigo.", GetPlayerNameEx(i));
SendClientMessageToAll(COLOR_ADMINCMD, wstring);
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", 60000, false, "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 == -1 && 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;
}