21.05.2014, 19:15
hey. what the problem with this?
PHP код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == hpickup[ClosestHouse(playerid)])
{
new azonosito = ClosestHouse(playerid);
new string[128], string1[128];
format(string,sizeof(string),"%s", HouseInfo[azonosito][hTulaj]);
PlayerTextDrawSetString(playerid,HazNev,string);
format(string1,sizeof(string1),"Fort Carson %i", HouseInfo[azonosito][hID]);
PlayerTextDrawSetString(playerid,HazSzam,string1);
PlayerTextDrawShow(playerid, PlayerText:HazNev);
PlayerTextDrawShow(playerid, PlayerText:HazBox);
PlayerTextDrawShow(playerid, PlayerText:HazSzam);
SetTimerEx("haztextdraw", 15000, false, "i", playerid);
}
return 1;
}
PHP код:
stock ClosestHouse(playerid)
{
for(new i=0; i<MAX_HOUSES; i++)
{
if(IsPlayerInRangeOfPoint(playerid,1.0,HouseInfo[i][hEnterX] ,HouseInfo[i][hEnterY],HouseInfo[i][hEnterZ]))
{
return i;
}
}
return -10;
}
PHP код:
[21:32:20] [debug] Run time error 4: "Array index out of bounds"
[21:32:20] [debug] Accessing element at negative index -10
[21:32:20] [debug] AMX backtrace:
[21:32:20] [debug] #0 0005a440 in ?? (0x00000000, 0x00000001) from rrrpg.amx
[21:32:20] [debug] #1 000156a8 in public Streamer_OnPlayerPickUpPickup (0x00000000, 0x00000001) from rrrpg.amx
[21:32:20] [debug] #2 0000fd10 in public OnPlayerPickUpPickup (0x00000000, 0x00000001) from rrrpg.amx
[21:32:21] [debug] Run time error 4: "Array index out of bounds"
[21:32:21] [debug] Accessing element at negative index -10
[21:32:21] [debug] AMX backtrace:
[21:32:21] [debug] #0 0005a440 in ?? (0x00000000, 0x00000001) from rrrpg.amx
[21:32:21] [debug] #1 000156a8 in public Streamer_OnPlayerPickUpPickup (0x00000000, 0x00000001) from rrrpg.amx
[21:32:21] [debug] #2 0000fd10 in public OnPlayerPickUpPickup (0x00000000, 0x00000001) from rrrpg.amx
[21:32:22] [debug] Run time error 4: "Array index out of bounds"
[21:32:22] [debug] Accessing element at negative index -10
[21:32:22] [debug] AMX backtrace:
[21:32:22] [debug] #0 0005a440 in ?? (0x00000000, 0x00000001) from rrrpg.amx
[21:32:22] [debug] #1 000156a8 in public Streamer_OnPlayerPickUpPickup (0x00000000, 0x00000001) from rrrpg.amx
[21:32:22] [debug] #2 0000fd10 in public OnPlayerPickUpPickup (0x00000000, 0x00000001) from rrrpg.amx