06.05.2017, 15:52
PHP код:
//OnPlayerPickUpPickUp
new houseid = -1;
new IDD = IsPlayerNearHouse(playerid);
for(new idd; idd<MAX_HOUSES; idd++)
{
if(HouseInfo[idd][HousePickup] == pickupid)
{
houseid = idd;
break;
}
}
if(houseid != -1)
{
new str[128];
format(str, 128, "~y~Price: ~w~$%d~n~~y~Owner: ~w~%s~n~~y~House ID: ~w~%d", HouseInfo[houseid][HouseValue], HouseInfo[houseid][HouseOwner], IDD);
GameTextForPlayer(playerid, str, 6000, 3);
new ownerid = GetPlayerID(HouseInfo[IDD][HouseOwner]);
if(ownerid == playerid)
{
SetPlayerHealth(ownerid,100.0);
SetPlayerArmour(ownerid,100.0);
}
}
Код:
[17:40:42] [debug] Run time error 4: "Array index out of bounds" [17:40:42] [debug] Attempted to read/write array element at negative index -1 [17:40:42] [debug] AMX backtrace: [17:40:42] [debug] #0 00153c60 in public OnPlayerPickUpPickup (playerid=0, pickupid=1961) at D:\samp folder\ZoneX - ZX\gamemodes\ZoneX.pwn:10825 [17:40:45] Saved 1982 Properties! [17:40:51] [debug] Run time error 4: "Array index out of bounds" [17:40:51] [debug] Attempted to read/write array element at negative index -1 [17:40:51] [debug] AMX backtrace: [17:40:51] [debug] #0 00153c60 in public OnPlayerPickUpPickup (playerid=0, pickupid=1961) at D:\samp folder\ZoneX - ZX\gamemodes\ZoneX.pwn:10825