dimachepul
Новичок
Баг с тестом на ГМ
Вот что крашдетектор выдает
PHP:
public: Gmtest(playerid)
{
new Float:nowhealth[MAX_PLAYERS];
if(AdmGM[AdmGMID[playerid]] == 1)
{
GetPlayerHealth(AdmGMID[playerid],nowhealth[AdmGMID[playerid]]);
}
if((AdmGMHP[AdmGMID[playerid]]-nowhealth[AdmGMID[playerid]]) > 0)
{
format(string, sizeof(string), "До: \t\t\t\t%.0f.0 HP\nПосле: \t\t\t%.0f.0 HP\nHP уменьшилось на: \t\t%.0f.0\n\n{7FB151}ГМ не обнаружено. HP игрока восстановлено.",AdmGMHP[AdmGMID[playerid]],nowhealth[AdmGMID[playerid]],(AdmGMHP[AdmGMID[playerid]]-nowhealth[AdmGMID[playerid]]));
ShowPlayerDialog(playerid,888,DIALOG_STYLE_MSGBOX , "Проверка на God Mode",string, "Закрыть", "");
SetHealth(AdmGMID[playerid], AdmGMHP[AdmGMID[playerid]]);
SetPlayerArmour(AdmGMID[playerid], AdmGMArm[playerid]);
AdmGMArm[playerid] = 0;
SetHealth(AdmGMID[playerid], AdmGMHP[AdmGMID[playerid]]);
AdmGM[AdmGMID[playerid]] = 0;
AdmGMHP[AdmGMID[playerid]] = 0;
AdmGMID[playerid] = INVALID_PLAYER_ID;
}
else if((AdmGMHP[AdmGMID[playerid]]-nowhealth[AdmGMID[playerid]]) == 0)
{
format(string, sizeof(string), "До: \t\t\t%.0f.0 HP\nПосле: \t\t%.0f.0 HP\nHP не уменьшилось\n\n{CD5A5A}Возможно этот игрок использует ГМ.",AdmGMHP[AdmGMID[playerid]],nowhealth[AdmGMID[playerid]]);
ShowPlayerDialog(playerid,888,DIALOG_STYLE_MSGBOX , "Проверка God Mode",string, "Закрыть", "");
AdmGM[AdmGMID[playerid]] = 0;
AdmGMArm[playerid] = 0;
AdmGMHP[AdmGMID[playerid]] = 0;
AdmGMID[playerid] = INVALID_PLAYER_ID;
}
KillTimer(GmtestTimer[playerid]);
}
PHP:
[23:29:16] [debug] AMX backtrace:
[23:29:16] [debug] #0 00081d70 in public Gmtest (playerid=0) at C:\Users\Administrator\Desktop\DM\gamemodes\MyMod.pwn:637
[23:29:17] [debug] Run time error 4: "Array index out of bounds"
[23:29:17] [debug] Accessing element at index 65535 past array upper bound 9
[23:29:17] [debug] AMX backtrace:
[23:29:17] [debug] #0 00081d70 in public Gmtest (playerid=0) at C:\Users\Administrator\Desktop\DM\gamemodes\MyMod.pwn:637
[23:29:17] [debug] Run time error 4: "Array index out of bounds"
[23:29:17] [debug] Accessing element at index 65535 past array upper bound 9
[23:29:17] [debug] AMX backtrace:
[23:29:17] [debug] #0 00081d70 in public Gmtest (playerid=0) at C:\Users\Administrator\Desktop\DM\gamemodes\MyMod.pwn:637
[23:29:17] [debug] Run time error 4: "Array index out of bounds"
[23:29:17] [debug] Accessing element at index 65535 past array upper bound 9
