Просмотр полной версии : [Вопрос] Краш мода
Крашит мод, MzCheck...CrashDetect выводит ошибки указывающие на:
for(new i =0;i<3;i++)
{
for(new z = 0;z<20;z++){OnmZONE[i][z] =0;}
}
В чём проблема?
for(new i = 0; i < sizeof(OnmZONE); i++)
{
for(new z = 0; z < sizeof(OnmZONE[]); z++)
OnmZONE[i][z] = 1;
}
Что именно crashdetect пишет? Да и не проще ли сделать так:
for(new z = 0;z<20;z++)
{
OnmZONE[0][z] =0;
OnmZONE[1][z] =0;
OnmZONE[2][z] =0;
}
?
Не только на MzCheck но и SetPlayerUnjail вот сам лог:
[19:52:21] [debug] #0 00126aac in public SetPlayerUnjail () at C:\Users\Admin\Downloads\Sunshine Role Play(YourGame.su)\Sunshine Role Play(YourGame.su)\gamemodes\Sunshine(YourGame).pwn:21257
[19:52:23] [debug] Run time error 4: "Array index out of bounds"
[19:52:23] [debug] Accessing element at index 1 past array upper bound 0
[19:52:23] [debug] AMX backtrace:
[19:52:23] [debug] #0 00126aac in public SetPlayerUnjail () at C:\Users\Admin\Downloads\Sunshine Role Play(YourGame.su)\Sunshine Role Play(YourGame.su)\gamemodes\Sunshine(YourGame).pwn:21257
[19:52:24] [debug] Run time error 4: "Array index out of bounds"
[19:52:24] [debug] Accessing element at index 1 past array upper bound 0
[19:52:24] [debug] AMX backtrace:
[19:52:24] [debug] #0 00126aac in public SetPlayerUnjail () at C:\Users\Admin\Downloads\Sunshine Role Play(YourGame.su)\Sunshine Role Play(YourGame.su)\gamemodes\Sunshine(YourGame).pwn:21257
[19:52:25] [debug] Run time error 4: "Array index out of bounds"
[19:52:25] [debug] Accessing element at index 1 past array upper bound 0
[19:52:25] [debug] AMX backtrace:
[19:52:25] [debug] #0 00126aac in public SetPlayerUnjail () at C:\Users\Admin\Downloads\Sunshine Role Play(YourGame.su)\Sunshine Role Play(YourGame.su)\gamemodes\Sunshine(YourGame).pwn:21257
[19:52:26] [debug] Run time error 4: "Array index out of bounds"
[19:52:26] [debug] Accessing element at index 1 past array upper bound 0
[19:52:26] [debug] AMX backtrace:
[19:52:26] [debug] #0 00126aac in public SetPlayerUnjail () at C:\Users\Admin\Downloads\Sunshine Role Play(YourGame.su)\Sunshine Role Play(YourGame.su)\gamemodes\Sunshine(YourGame).pwn:21257
[19:52:27] [debug] Run time error 4: "Array index out of bounds"
[19:52:27] [debug] Accessing element at index 1 past array upper bound 0
[19:52:27] [debug] AMX backtrace:
[19:52:27] [debug] #0 00126aac in public SetPlayerUnjail () at C:\Users\Admin\Downloads\Sunshine Role Play(YourGame.su)\Sunshine Role Play(YourGame.su)\gamemodes\Sunshine(YourGame).pwn:21257
[19:52:28] [debug] Run time error 4: "Array index out of bounds"
[19:52:28] [debug] Accessing element at index 1 past array upper bound 0
[19:52:28] [debug] AMX backtrace:
[19:52:28] [debug] #0 00126aac in public SetPlayerUnjail () at C:\Users\Admin\Downloads\Sunshine Role Play(YourGame.su)\Sunshine Role Play(YourGame.su)\gamemodes\Sunshine(YourGame).pwn:21257
[19:52:29] [debug] Run time error 4: "Array index out of bounds"
[19:52:29] [debug] Accessing element at index 1 past array upper bound 0
[19:52:29] [debug] AMX backtrace:
[19:52:29] [debug] #0 00126aac in public SetPlayerUnjail () at C:\Users\Admin\Downloads\Sunshine Role Play(YourGame.su)\Sunshine Role Play(YourGame.su)\gamemodes\Sunshine(YourGame).pwn:21257
Строка:
if(MZSafeTime[f]>0)
Покажите инициализацию цикла.
Покажите инициализацию цикла.
for(new f =0;f<3;f++)
{
if(MZSafeTime[f]>0)
{
MZSafeTime[f] --;
if(MZSafeTime[f] == 200 || MZSafeTime[f] == 450)
{
format(string,sizeof(string),"::: У вас осталось %d секунд. Место встречи: Заброшенный аэропорт:::",MZSafeTime[f]);
SendFamilyMessage(MZInfo[f][mNapad],COLOR_RED,string);
for(new h = 0; h < sizeof(BizzInfo); h++)
{
if(BizzInfo[h][bZahvat] == 1){SendFamilyMessage(BizzInfo[h][bMafia],COLOR_RED,string);}
}
}
}
}
for(new f =0;f<3;f++)
на
for(new f; f < sizeof(MZSafeTime); f++)
?
for(new f =0;f<3;f++)
на
for(new f; f < sizeof(MZSafeTime); f++)
?
Спасибо, помогло.
Теперь:
[20:13:00] [debug] Run time error 4: "Array index out of bounds"
[20:13:00] [debug] Accessing element at index 1 past array upper bound 0
[20:13:00] [debug] AMX backtrace:
[20:13:00] [debug] #0 00039f68 in public MzCheck () at C:\Users\Admin\Downloads\Sunshine Role Play(YourGame.su)\Sunshine Role Play(YourGame.su)\gamemodes\Sunshine(YourGame).pwn:2868
[20:13:11] [debug] Run time error 4: "Array index out of bounds"
[20:13:11] [debug] Accessing element at index 1 past array upper bound 0
[20:13:11] [debug] AMX backtrace:
[20:13:11] [debug] #0 00039f68 in public MzCheck () at C:\Users\Admin\Downloads\Sunshine Role Play(YourGame.su)\Sunshine Role Play(YourGame.su)\gamemodes\Sunshine(YourGame).pwn:2868
[20:13:22] [debug] Run time error 4: "Array index out of bounds"
[20:13:22] [debug] Accessing element at index 1 past array upper bound 0
[20:13:22] [debug] AMX backtrace:
[20:13:22] [debug] #0 00039f68 in public MzCheck () at C:\Users\Admin\Downloads\Sunshine Role Play(YourGame.su)\Sunshine Role Play(YourGame.su)\gamemodes\Sunshine(YourGame).pwn:2868
[20:13:33] [debug] Run time error 4: "Array index out of bounds"
[20:13:33] [debug] Accessing element at index 1 past array upper bound 0
[20:13:33] [debug] AMX backtrace:
[20:13:33] [debug] #0 00039f68 in public MzCheck () at C:\Users\Admin\Downloads\Sunshine Role Play(YourGame.su)\Sunshine Role Play(YourGame.su)\gamemodes\Sunshine(YourGame).pwn:2868
[20:13:44] [debug] Run time error 4: "Array index out of bounds"
[20:13:44] [debug] Accessing element at index 1 past array upper bound 0
[20:13:44] [debug] AMX backtrace:
[20:13:44] [debug] #0 00039f68 in public MzCheck () at C:\Users\Admin\Downloads\Sunshine Role Play(YourGame.su)\Sunshine Role Play(YourGame.su)\gamemodes\Sunshine(YourGame).pwn:2868
[20:13:55] [debug] Run time error 4: "Array index out of bounds"
[20:13:55] [debug] Accessing element at index 1 past array upper bound 0
[20:13:55] [debug] AMX backtrace:
[20:13:55] [debug] #0 00039f68 in public MzCheck () at C:\Users\Admin\Downloads\Sunshine Role Play(YourGame.su)\Sunshine Role Play(YourGame.su)\gamemodes\Sunshine(YourGame).pwn:2868
Строка:
for(new z = 0;z<20;z++){OnmZONE[i][z] =0;}
Полный код:
for(new i =0;i<3;i++)
{
for(new z = 0;z<20;z++){OnmZONE[i][z] =0;}
}
Опять же, показывайте цикл
Спасибо, помогло.
Теперь:
[20:13:00] [debug] Run time error 4: "Array index out of bounds"
[20:13:00] [debug] Accessing element at index 1 past array upper bound 0
[20:13:00] [debug] AMX backtrace:
[20:13:00] [debug] #0 00039f68 in public MzCheck () at C:\Users\Admin\Downloads\Sunshine Role Play(YourGame.su)\Sunshine Role Play(YourGame.su)\gamemodes\Sunshine(YourGame).pwn:2868
[20:13:11] [debug] Run time error 4: "Array index out of bounds"
[20:13:11] [debug] Accessing element at index 1 past array upper bound 0
[20:13:11] [debug] AMX backtrace:
[20:13:11] [debug] #0 00039f68 in public MzCheck () at C:\Users\Admin\Downloads\Sunshine Role Play(YourGame.su)\Sunshine Role Play(YourGame.su)\gamemodes\Sunshine(YourGame).pwn:2868
[20:13:22] [debug] Run time error 4: "Array index out of bounds"
[20:13:22] [debug] Accessing element at index 1 past array upper bound 0
[20:13:22] [debug] AMX backtrace:
[20:13:22] [debug] #0 00039f68 in public MzCheck () at C:\Users\Admin\Downloads\Sunshine Role Play(YourGame.su)\Sunshine Role Play(YourGame.su)\gamemodes\Sunshine(YourGame).pwn:2868
[20:13:33] [debug] Run time error 4: "Array index out of bounds"
[20:13:33] [debug] Accessing element at index 1 past array upper bound 0
[20:13:33] [debug] AMX backtrace:
[20:13:33] [debug] #0 00039f68 in public MzCheck () at C:\Users\Admin\Downloads\Sunshine Role Play(YourGame.su)\Sunshine Role Play(YourGame.su)\gamemodes\Sunshine(YourGame).pwn:2868
[20:13:44] [debug] Run time error 4: "Array index out of bounds"
[20:13:44] [debug] Accessing element at index 1 past array upper bound 0
[20:13:44] [debug] AMX backtrace:
[20:13:44] [debug] #0 00039f68 in public MzCheck () at C:\Users\Admin\Downloads\Sunshine Role Play(YourGame.su)\Sunshine Role Play(YourGame.su)\gamemodes\Sunshine(YourGame).pwn:2868
[20:13:55] [debug] Run time error 4: "Array index out of bounds"
[20:13:55] [debug] Accessing element at index 1 past array upper bound 0
[20:13:55] [debug] AMX backtrace:
[20:13:55] [debug] #0 00039f68 in public MzCheck () at C:\Users\Admin\Downloads\Sunshine Role Play(YourGame.su)\Sunshine Role Play(YourGame.su)\gamemodes\Sunshine(YourGame).pwn:2868
Строка:
for(new z = 0;z<20;z++){OnmZONE[i][z] =0;}
Полный код:
for(new i =0;i<3;i++)
{
for(new z = 0;z<20;z++){OnmZONE[i][z] =0;}
}
Вот же
for(new i = 0; i < sizeof(OnmZONE); i++)
{
for(new z = 0; z < sizeof(OnmZONE[]); z++)
OnmZONE[i][z] = 1;
}
Вот же
Ещё вопрос, ты знаком с инклудом y_timers?
Ещё вопрос, ты знаком с инклудом y_timers?
Ну виделись пару раз. А что?
Ну виделись пару раз. А что?
Как будет без y_timers это?
stop STimer[playerid];
stop SpecHATimer[playerid];
SpecHATimer[playerid] = repeat ReAdmin(playerid,params[0]);
http://forum.sa-mp.com/showthread.php?t=182948
KillTimer(STimer[playerid]);
KillTimer(SpecHATimer[playerid]);
Ну а repeat - что-то вроде зацикленного таймера. Только не сам таймер, а объявление о том, что его нужно вызывать постоянно. Само объявление будет выглядеть как-то так:
timer ReAdmin[/*Время вызова*/](playerid,blabla)
{
//Код, вызываемый таймером
}
То бишь, timer надо перевести в обычный forward + public, а уже таймер будет выглядеть так:
SpecHATimer[playerid] = SetTimerEx("ReAdmin", /*Время вызова*/, true, "ii", playerid, params[0]);//Только не уверен, что в params передаётся число, так что исправите, если что
Powered by vBulletin® Version 4.2.0 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. Перевод: zCarot