Szerző Téma: Ez mi?  (Megtekintve 706 alkalommal)

Ez mi?
« Dátum: 2016. Március 06. - 14:01:35 »
0 Show voters
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!)

even

  • Vendég
Ez mi?
« Válasz #1 Dátum: 2016. Március 06. - 14:37:41 »
0 Show voters
HullaTimernél lesz a gond ha jól látom.

Ez mi?
« Válasz #2 Dátum: 2016. Március 06. - 15:00:50 »
0 Show voters
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.

Nem elérhető Kovacs_Richard

  • 1743
  • HRP Fejlesztő
  • Discord: Kovacs_Richard#0321
    • Profil megtekintése
    • Hun Role Play Web
Ez mi?
« Válasz #3 Dátum: 2016. Március 06. - 18:55:39 »
0 Show voters
hány cellája van a tömbnek?
mennyi a hullaid?
 
Run time error 4: \"Array index out of bounds\"[/quote]
tömb index túl megy a határon...tehát van mondjuk egy 200 cellás tömböd és te mondjuk a 300-as cellára hivatkozol ami ugye nincs...
Régóta nem tevékenykedem, mint SA-MP scripter.
HRP Fejlesztő.

Ez mi?
« Válasz #4 Dátum: 2016. Március 07. - 17:18:21 »
0 Show voters
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;
}

Nem elérhető RIP

Ez mi?
« Válasz #5 Dátum: 2016. Március 07. - 17:43:17 »
0 Show voters
Sajnos nem tudom a megoldást rá, viszont felszeretném hívni a figyelmed arra, hogy a 31. sorban van egy elírás mégpedig a fázis szó van elírva \"fázsi\"-ra. (Nem belekötésnek szánom, csak szimplán megelőzők neked egy későbbi munkát ha ez bekerülne egy szerverre) :D

Ez mi?
« Válasz #6 Dátum: 2016. Március 07. - 17:58:32 »
0 Show voters
Elírás, az van bőven még a többi részbe ne aggódj :D . De köszönöm, hogy szóltál!

Dupla hozzászólás automatikusan összefûzve. ( 2016. Március 07. - 21:43:03 )

1 óra szenvedés után egyik ismerősömmel jár jöttünk a titok nyitjára!
Mindenkinek köszönöm a segítséget!
« Utoljára szerkesztve: 2016. Március 07. - 21:43:03 írta Zsifon »

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal