Helló!
Többeket kérdeztem, hogy ez mi, de senki nem tudta rá eddig a választ. Hátha ti tudjátok!
[13:47:08] [debug] Run time error 4: \"Array index out of bounds\"
[13:47:08] [debug] Accessing element at index 65535 past array upper bound 599
[13:47:08] [debug] AMX backtrace:
[13:47:08] [debug] #0 00015210 in public HullaTimer (0) from teszt1.amx
Amire kidobja:
if(DialogHulla[playerid] == 2)
{
new string[256];
hid = hullaid;
format(string, sizeof(string), \"Név:%s\", HullaInfo[hid][hnev]);
ShowPlayerDialog(playerid, DIALOG_HULLA3, 0, \"Eredmény\", string, \"Redben\", \"\");
ClearAnimations(playerid);
DialogHulla[playerid] = 0;
}
(A behúzás valmiért elsazródott azt ne nézzétek!)
Változtattam a scripten és még jöbb lett XD
[14:21:08] [debug] Run time error 4: \"Array index out of bounds\"
[14:21:08] [debug] Accessing element at index 65535 past array upper bound 599
[14:21:08] [debug] AMX backtrace:
[14:21:08] [debug] #0 00015204 in public HullaTimer (0, 65535) from teszt1.amx
Ez az előbbiből lemaradt:
SetTimerEx(\"HullaTimer\", 2450, false, \"ii\", playerid, hullaid);
public HullaTimer(playerid, hullaid)
{
if(DialogHulla[playerid] == 1)
{
new string[256];
format(string, sizeof(string), \"Név:%s\", HullaInfo[hullaid][hnev]);
ShowPlayerDialog(playerid, DIALOG_HULLA3, 0, \"Eredmény\", string, \"Redben\", \"\");
ClearAnimations(playerid);
DialogHulla[playerid] = 0;
}
Lemaradt az elejéröl a public, de azt kültem el.
Nos lehet hogy félre értelek
#define MAX_SERVER_HULLA 600
enum HInfo
{
ID,
SkinID,
hnev[MAX_PLAYER_NAME],
hgyilkos[MAX_PLAYER_NAME],
allapot,
Float:X,
Float:Y,
Float:Z,
Float:A
}
new HullaInfo[MAX_SERVER_HULLA][HInfo];
//globális változók
new hullaid;
//itt kap értéket glob. változó
public OnPlayerUpdate(playerid)
{
new actorid = GetPlayerTargetActor(playerid);
hullaid = GetPlayerTargetActor(playerid);
if (actorid != INVALID_ACTOR_ID)
{
new string[256];
format(string, sizeof(string),\"Hulla ID:\\t{33ff00}%d{ffffff}\\nÁllapota:\\t%d%%\\nInterakciók\\tMég (3) fázsi van!\\n \", actorid, HullaInfo[actorid][allapot]);
ShowPlayerDialog(playerid, DIALOG_HULLA, 4, \"Hulla system\", string,\"Select\", \"Cancel\");
}
return 1;
}
//a dialog egy másik dialogon keresztül erre hivatkozik
if (dialogid == DIALOG_HULLA2)
{
if (!response)
{
return 1;
}
if (listitem == 0)
{
ApplyAnimation(playerid,\"BOMBER\",\"BOM_PLANT\",4.0,0,0,0,1,5000,1);
GameTextForPlayer(playerid, \"Azonositas folyamatban...\", 5000, 5);
SetTimerEx(\"HullaTimer\", 2450, false, \"ii\", playerid, hullaid);
DialogHulla[playerid] = 1;
}
//majd a public
public HullaTimer(playerid, hullaid)
{
if(DialogHulla[playerid] == 1)
{
new string[256];
format(string, sizeof(string), \"Név:%s\", HullaInfo[hullaid][hnev]);
ShowPlayerDialog(playerid, DIALOG_HULLA3, 0, \"Eredmény\", string, \"Redben\", \"\");
ClearAnimations(playerid);
DialogHulla[playerid] = 0;
}
return 1;
}