GTA Közösség - A magyar GTA fórum

San Andreas Multiplayer (SA-MP) => SA-MP: Szerverfejlesztés => Segítségkérés => A témát indította: skyLine - 2012. október 06. - 22:00:05

Cím: Run time error 4: "Array index out of bounds"
Írta: skyLine - 2012. október 06. - 22:00:05
Sziasztok
Életemben nem láttam ilyet.


[20:33:47] Number of vehicle models: x
[20:33:48] [gamemodes/afterlife.amx]: During execution of vitals:
[20:33:48] [gamemodes/afterlife.amx]: Run time error 4: \"Array index out of bounds\"
[20:33:49] [gamemodes/afterlife.amx]: During execution of vitals:
[20:33:49] [gamemodes/afterlife.amx]: Run time error 4: \"Array index out of bounds\"
[20:33:50] [gamemodes/afterlife.amx]: During execution of vitals:
[20:33:50] [gamemodes/afterlife.amx]: Run time error 4: \"Array index out of bounds\"
[20:33:51] [gamemodes/afterlife.amx]: During execution of vitals:
[20:33:51] [gamemodes/afterlife.amx]: Run time error 4: \"Array index out of bounds\"
[20:33:52] [gamemodes/afterlife.amx]: During execution of vitals:
[20:33:52] [gamemodes/afterlife.amx]: Run time error 4: \"Array index out of bounds\"
[20:33:53] [gamemodes/afterlife.amx]: During execution of vitals:
[20:33:53] [gamemodes/afterlife.amx]: Run time error 4: \"Array index out of bounds\"

 
Kicrashel a szerver, ha hoston van. Házilag rendesen mûködik...
Cím: Run time error 4: "Array index out of bounds"
Írta: Benceee - 2012. október 06. - 22:13:52
Minek nyitottál újat?
http://sampforum.hu/index.php?topic=32827.msg348968#msg348968
Cím: Run time error 4: "Array index out of bounds"
Írta: hegdavid95 - 2012. október 06. - 23:39:38
Array index out of bounds = A tömbben olyan cella azonosítót használsz ami nagyobb mint a tömb mérete
pl:
new asd[4];
asd[4] = 0;
a tömbök celláit 0 tól n-1 ig lehet számozni.
Cím: Run time error 4: "Array index out of bounds"
Írta: skyLine - 2012. október 07. - 08:34:03
Idézetet írta: hegdavid95 date=1349559578\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"28347\" data-ipsquote-contentclass=\"forums_Topic
Array index out of bounds = A tömbben olyan cella azonosítót használsz ami nagyobb mint a tömb mérete
pl:
new asd[4];
asd[4] = 0;
a tömbök celláit 0 tól n-1 ig lehet számozni.
 
Ez konkrét dolgot annyira nem árult el nekem.
Ha megnézed
[gamemodes/afterlife.amx]

 
60000 sorból elég nehéz kiválogatni, hogy hol van nagyobb cella.
Cím: Run time error 4: "Array index out of bounds"
Írta: attila91 - 2012. október 07. - 10:14:55
Erre fele keresgélj ...
public vitals()
Cím: Run time error 4: "Array index out of bounds"
Írta: skyLine - 2012. október 07. - 12:29:34
Idézetet írta: attila91 date=1349597695\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"28347\" data-ipsquote-contentclass=\"forums_Topic
Erre fele keresgélj ...
public vitals()

 

Stringet állítgatom ide oda, de nem haladok egyrõl a kettõre.
 
public vitals()
{
    for(new i = 0; i <= MAX_PLAYERS; i++)
    {
new string[255];
new Float:qHealth, Float:qArmour, Float:Ehseg1, Float:Szomjusag1, Float:Wc1, Float:Szint1;
GetPlayerHealth(i,qHealth);
GetPlayerArmour(i,qArmour);
Ehseg1 = PlayerInfo[eseg];
Szomjusag1 = PlayerInfo[szomjas];
Wc1 = PlayerInfo[szukseg];
Szint1 = PlayerInfo[pLevel];
format(string, sizeof(string), \"%.0f%\", qHealth);
TextDrawSetString(Health, string);
format(string, sizeof(string), \"%.0f%\", qArmour);
TextDrawSetString(Armour, string);
format(string, sizeof(string), \"%.0f%\", Ehseg1);
TextDrawSetString(Ehseg, string);
format(string, sizeof(string), \"%.0f%\", Szomjusag1);
TextDrawSetString(Szomjusag, string);
format(string, sizeof(string), \"%.0f%\", Wc1);
TextDrawSetString(Wc, string);
format(string, sizeof(string), \"%.0f\", Szint1);
TextDrawSetString(Szint, string);
}
}
Cím: Run time error 4: "Array index out of bounds"
Írta: attila91 - 2012. október 07. - 13:12:42
for(new i = 0; i <= MAX_PLAYERS; i++)

 Helyett
for(new i = 0; i <MAX_PLAYERS;i++)

 Igy jólesz.  :whistle:
Cím: Run time error 4: "Array index out of bounds"
Írta: skyLine - 2012. október 07. - 13:28:20
Idézetet írta: attila91 date=1349608362\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"28347\" data-ipsquote-contentclass=\"forums_Topic

for(new i = 0; i <= MAX_PLAYERS; i++)

 Helyett
for(new i = 0; i <MAX_PLAYERS;i++)

 Igy jólesz.  :whistle:
 
Drága testvérem téged Isten küldött! Meghívlak egy sörre!