02.11.2013, 10:06
pawn Код:
[10:20:10] [debug] Run time error 4: "Array index out of bounds"
[10:20:10] [debug] Accessing element at negative index -1
[10:20:10] [debug] AMX backtrace:
[10:20:10] [debug] #0 0011e110 in GetHouseMaxSleepHp (houseid=-1) at C:\AMD\rp.pwn:28831
[10:20:10] [debug] #1 00052314 in public GeneralListener () at C:\AMD\rp.pwn:6836
[10:20:12] [debug] Run time error 4: "Array index out of bounds"
pawn Код:
//28831
stock GetHouseMaxSleepHp(houseid)
{
return (50 + (10 * HouseInfo[houseid][hUpgrades][HOUSE_UPGRADE_BED]));
}
pawn Код:
//6836
new Float:hp;
GetPlayerHealth(playerid,hp);
if(hp < GetHouseMaxSleepHp(in_house[playerid]))
{
hp += 1.0;
SetPlayerHealth(playerid,hp);
new chance = random(100);
if(chance > 90) { SendEmote(playerid,"sforaie..."); }
}
else
{
SendEmote(playerid,"se trezeste");
TogglePlayerControllable(playerid,1);
CallLocalFunction("cmd_stopanim","is",playerid,"1");
sleeping[playerid] = 0;
}