04.07.2014, 23:29
Greetings,
Am I doing it wrong? Thanks in advance!
pawn Код:
//underneath an other function
SetTimer("CheckPlayers", 1000, 1);
Код:
The function which is causing : Run time error 3: "Stack/heap collision (insufficient stack size)"
pawn Код:
public CheckPlayers()
{
foreach(new i : Player)
{
if(IsPlayerInWater(i))
{
OnPlayerLoseDerby(i);
}
if(PlayerCount == 1 && PlayerIsPlaying[i] == 1)
{
TogglePlayerControllable(i, 0);
new str[100];
format(str, sizeof(str), "Winner is: %s", GetPlayerNameEx(i));
SendClientMessage(i,GREEN, str);
if(PlayerIsPlaying[i] == 1){
GivePlayerMoney(i, 1000); }
PlayerIsPlaying[i] = 0;
DerbyStart = 0;
NextMap();
}
if(PlayerCount == 0 && PlayerIsPlaying[i] == 0)
{
TogglePlayerControllable(i, 0);
SendClientMessage(i,GREEN, "No Winner");
PlayerIsPlaying[i] = 0;
DerbyStart = 0;
KillTimer(DetectPlayer);
NextMap();
}
}
return 1;
}