Wysłany: 2013-04-09, 15:44
optimus
PawnoMen
Wiek: 27 Na forum: 5614 dni Posty: 453
Nick w MP: [PMS]ReveresPL
Piwa : 159
Witam ma ot?? problem z odliczniem...
Oto kod:
Kod:
new Count = 5;
new CountText[5][5] ={
"~b~1",
"~y~2",
"~g~3",
"~g~4",
"~g~5"
};
forward CountDown();
public CountDown()
{
if(Count > 0)
{
GameTextForAll(CountText[Count-1], 2500, 3);
Count--;
SoundForAll(1056);
SetTimer("CountDown", 1000, 0);
}
else
{
GameTextForAll("~r~START", 2500, 3);
SoundForAll(1057);
Count = 6;
for(new i=0; i<MAX_PLAYERS; i++)
{
TogglePlayerControllable(i, 1);
}
}
return 1;
}
B??d crashdetect:
Kod:
[15] [debug] Run time error 4: "Array index out of bounds"
[15] [debug] Accessing element at index 5 past array upper bound 4
[15] [debug] AMX backtrace:
[15] [debug] #0 00010350 in public CountDown () from mm.amx
I tak wywala dop?ki nie wyjd? z serwera...
Prosz? o pomoc.
Wysłany: 2013-04-09, 15:58
Combacior
Wiek: 29 Na forum: 5795 dni Posty: 1516
Piwa : 2161
Kod: new Count = 5;
new CountText[][] ={
"~b~1",
"~y~2",
"~g~3",
"~g~4",
"~g~5"
};
forward CountDown();
public CountDown()
{
if(Count > 0)
{
GameTextForAll(CountText[Count-1], 2500, 3);
Count--;
SoundForAll(1056);
SetTimer("CountDown", 1000, 0);
}
else
{
GameTextForAll("~r~START", 2500, 3);
SoundForAll(1057);
Count = 5;
for(new i=0; i<MAX_PLAYERS; i++)
{
TogglePlayerControllable(i, 1);
}
}
return 1;
}
Tagi: odliczanie :: się :: crashuje
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: