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; }
Hint: if you expect help here, code in English. I can't be bothered to dissect a piece of code if I can't understand its context.
|
The function is called 8 times (only explanation).
= timer issue |
Cont++; } if(Cont > 0) // if has anyone in area { SetTimer("Verify_ITAU", 15000, false); }
SetTimer("Verify_ITAU", 15000, false);