15.12.2015, 01:25
(
Последний раз редактировалось Hayden_Almeida; 15.12.2015 в 13:41.
)
Hello Guys. I am having a little trouble with my For Loop.
The Public: "Verify_ITAU" is called 1 time, with NO LOOPING.
Here is my code:
And the Result INGAME (screenshot): http://i.imgur.com/aK4HS7Q.png
As you can see, its giving 8 Times the Message. Dont know why. In my point, have no reason for this is happening.
The Public: "Verify_ITAU" is called 1 time, with NO LOOPING.
Here is my code:
Код:
public Verify_ITAU() { if(ITAU_FASE == 3) { new Cont = 0; for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(BankRobbery[i] == true) { if(IsPlayerInRangeOfPoint(i, 20.0, 829.0986,6.4355,1004.1870) || IsPlayerInRangeOfPoint(i, 300.0, 700.5287,-1162.6360,15.5628)) // Center of the Bank { Cont++; } if(Cont > 0) // if has anyone in area { SetTimer("Verify_ITAU", 15000, false); } else if(Cont == 0) { new ExpGanho = 15; // not Important, giving Experience for player Entrada_ITAU_Trancado = true; // Not Important, Locking the Bank's door. SendClientMessage(i, COLOR_WHITE, "Conseguiu assaltar com sucesso!"); // the msg said: "Robbery sucess" AssaltandoBanco[i] = false; // set the Player Var to false, not important here. PlayerInfo[i][pCash] = (PlayerInfo[i][pCash] + Grana_COFRES[i]); // giving money to player Grana_COFRES[i] = 0; // setting the money robbed of the player to 0 (var of the player) ITAU_FASE = 4; // this is the Phase (sequence) GameTextForPlayer(i, "~g~conseguiu!", 5000, 4); // "You did it" KillTimer(ALARME_TIMER); // Stopping the Alarm Sound SetTimerEx("GanhoExp", 6500, false, "i", i); // Giving the MSG "EXP +" } } } } } if(ITAU_FASE == 4) { for(new w = 0; w < MAX_PLAYERS; w++) { if(IsPlayerConnected(w)) { SendClientMessage(w,COLOR_AVISO, "Banco ITAЪ trancado! Quem estiver dentro SAIA IMEDIATAMENTE. O Interior serб resetado dentro de 5 minutos. (2)"); // "ITAU BANK locked! Who is inside it, get out now. The interior will be reset in 5 minutes.(2)" } } } return 1; }
As you can see, its giving 8 Times the Message. Dont know why. In my point, have no reason for this is happening.