Run time error 4: "Array index out of bounds"
#1

[15:59:59] [debug] Run time error 4: "Array index out of bounds"
[15:59:59] [debug] Attempted to read/write array element at negative index -1
[15:59:59] [debug] AMX backtrace:
[15:59:59] [debug] #0 000fa8b4 in public Spawn (0) from kopie.amx
Код:
forward Spawn(playerid);
public Spawn(playerid)
{
    if(GSkin[PGang[playerid]][GangLvl[playerid]-1] > 0)
	{
 		SetPlayerSkin(playerid, GSkin[PGang[playerid]][GangLvl[playerid]-1]);
	}
	if(GSpawnX[PGang[playerid]] != 0.0 && GSpawnY[PGang[playerid]] != 0.0 && GSpawnZ[PGang[playerid]] != 0.0)
	{
		SetPlayerPos(playerid, GSpawnX[PGang[playerid]], GSpawnY[PGang[playerid]], GSpawnZ[PGang[playerid]]);
	}
	new hex[MAX_PLAYERS];
	hex[playerid] = HexToInt(GColor[PGang[playerid]]);
	SetPlayerColor(playerid, hex[playerid]);
}
Reply
#2

Код:
[16:45:47] [debug] Server crashed while executing kopie.amx
[16:45:47] [debug] AMX backtrace:
[16:45:47] [debug] #0 00000004 in public OnPlayerSpawn (0) from kopie.amx
[16:45:47] [debug] Native backtrace:
[16:45:47] [debug] #0 e53d8180 in _Z13GetStackTraceRSt6vectorI10StackFrameSaIS0_EEPv () from plugins/crashdetect.so
[16:45:47] [debug] #1 e53d0064 in _ZN11CrashDetect20PrintNativeBacktraceERSoRKN2os7ContextE () from plugins/crashdetect.so
[16:45:47] [debug] #2 e53d0d64 in _ZN11CrashDetect20PrintNativeBacktraceERKN2os7ContextE () from plugins/crashdetect.so
[16:45:47] [debug] #3 e53d2cdb in _ZN11CrashDetect7OnCrashERKN2os7ContextE () from plugins/crashdetect.so
[16:45:47] [debug] #4 e53d74d5 in ?? () from plugins/crashdetect.so
[16:45:47] [debug] #5 e57b8410 in __kernel_rt_sigreturn () from linux-gate.so.1
[16:45:47] [debug] Registers:
[16:45:47] [debug] EAX: 00000000 EBX: 09ebd120 ECX: e398b35c EDX: 0062eae4
[16:45:47] [debug] ESI: e3890b94 EDI: e3890b8c EBP: f13387cc ESP: f13385e0
[16:45:47] [debug] EIP: 00000000 EFLAGS: 00010282
[16:45:47] [debug] Stack:
[16:45:47] [debug] ESP+00000000: 09ebd120 0000007d f133863c e3fb9e10
[16:45:47] [debug] ESP+00000020: e398b35c 0062eae4 0062aae8 004421fc
[16:45:47] [debug] ESP+00000040: 000fa7d0 f1338660 00000000 e5795ff0
[16:45:47] [debug] ESP+00000060: f13386b8 00000001 09ebd120 e53fcff4
[16:45:47] [debug] ESP+00000080: 09ebd120 f13387cc 00000036 00000000
[16:45:47] [debug] ESP+000000a0: 00000000 00000000 f133869c e53106f4
[16:45:47] [debug] ESP+000000c0: e53b77d4 00000001 f1338778 e5310a92
[16:45:47] [debug] ESP+000000e0: 00000000 00000000 00000036 0a264bc8
[16:45:47] [debug] ESP+00000100: 00000004 00000000 00000008 0809571b
[16:45:47] [debug] ESP+00000120: f1338750 e388fcf3 e53a05f8 00000003
[16:45:47] [debug] ESP+00000140: 09ebd120 0a111308 00000036 e53d6384
[16:45:47] [debug] ESP+00000160: 6c506e4f 72657961 63736944 e53107de
[16:45:47] [debug] ESP+00000180: f1338850 00000001 0031090b e53b77d4
[16:45:47] [debug] ESP+000001a0: 09ebd120 f13387cc 00000036 f13387cc
[16:45:47] [debug] ESP+000001c0: 09e88758 00000000 e388fcf3 09ebd120
[16:45:47] [debug] ESP+000001e0: 09ebd120 f13387cc 00000036 00000001
[16:45:47] [debug] ESP+00000200: 09ebd120 00000000 e2e0f663 000000f0
[16:45:47] [debug] ESP+00000220: f1338850 09de9875 f1338988 08071d02
[16:45:47] [debug] ESP+00000240: 00000000 00000002 0000002d 34340000
[16:45:47] [debug] ESP+00000260: 000009de e57da000 00000000 e57c7dd6
[16:45:47] [debug] ESP+00000280: f1338900 e57d9d20 f1338888 e5523e6a
[16:45:47] [debug] ESP+000002a0: 00000001 00000009 f13389a8 e5474afc
[16:45:47] [debug] ESP+000002c0: 0a0aae08 00000000 00011818 000018d8
[16:45:47] [debug] ESP+000002e0: 000018d8 00000013 00000015 09ddf9e0
[16:45:47] [debug] ESP+00000300: 0a0aae08 f133891c 09ebda78 e53d648c
[16:45:47] [debug] ESP+00000320: 09ebda78 0a0aae08 f133899c e55aa000
[16:45:47] [debug] ESP+00000340: 0a5a83d0 f1338a94 e53d63d9 e5473e85
[16:45:47] [debug] ESP+00000360: 09de9e42 f1338978 f1338988 0806f8b9
[16:45:47] [debug] ESP+00000380: 00000015 00011824 0000d828 09de9e2a
[16:45:47] [debug] ESP+000003a0: 09de9074 09de9070 f13389b8 08071e32
[16:45:47] [debug] ESP+000003c0: 0000f663 00000001 0a0aae08 00000008
[16:45:47] [debug] ESP+000003e0: 09de9074 00000008 00000009 f1338a20
[16:45:47] [debug] Loaded modules:
[16:45:47] [debug] 00000000 - 00187f43 sampsvr-port_28
[16:45:47] [debug] e57ba000 - e57ba50c linux-gate.so.1
[16:45:47] [debug] e57a8000 - e57aa81b /lib/i386-linux-gnu/i686/cmov/libdl.so.2
[16:45:47] [debug] e578c000 - e57a6d2b /lib/i386-linux-gnu/i686/cmov/libpthread.so.0
[16:45:47] [debug] e5611000 - e5794bb3 /usr/lib32/libstdc++.so.6
[16:45:47] [debug] e55cb000 - e560fb43 /lib/i386-linux-gnu/i686/cmov/libm.so.6
[16:45:47] [debug] e55ae000 - e55ca3c4 /lib/i386-linux-gnu/libgcc_s.so.1
[16:45:47] [debug] e5401000 - e55b622f /lib/i386-linux-gnu/i686/cmov/libc.so.6
[16:45:47] [debug] e57b9000 - e57d9d6c /lib/ld-linux.so.2
[16:45:47] [debug] e53ba000 - e53fcac4 plugins/crashdetect.so
[16:45:47] [debug] e52e4000 - e53ba7f0 plugins/streamer.so
[16:45:47] [debug] e52d2000 - e52d909f /lib/i386-linux-gnu/i686/cmov/librt.so.1
[16:45:47] [debug] e524e000 - e52d2561 plugins/audio.so
[16:45:47] [debug] e5241000 - e524c790 plugins/sscanf.so
[16:45:47] [debug] e5235000 - e523e918 plugins/whirlpool.so
[16:45:47] [debug] e5228000 - e52333ef /lib/i386-linux-gnu/i686/cmov/libnss_files.so.2
[16:45:47] [debug] e57ad000 - e57b197b /lib/i386-linux-gnu/i686/cmov/libnss_dns.so.2
[16:45:47] [debug] e51b3000 - e51cb2fb /lib/i386-linux-gnu/i686/cmov/libresolv.so.2
Reply
#3

show all the onplayerspawn.
Reply
#4

https://sampwiki.blast.hk/wiki/Scripting_Basics
Reply
#5

Get out v1k1nG...

I'm wondering if you've been setting PGang to -1 when they aren't in the gangs...
Reply
#6

Wat, ain't writing bad values into arrays basics? -.-
Reply
#7

Quote:
Originally Posted by v1k1nG
Посмотреть сообщение
Wat, ain't writing bad values into arrays basics? -.-
Posting up a link to a whole document on'Scripting Basics', when you're referring to a minuscule segment, without even saying what the fuck you mean, is a real dick move even for a person who's been here less than 24 hours.

Honestly, the OP is probably better off without your 'help'.
Reply
#8

Who tells you that I am new here. Aand btw in that case this ain't the way to help new members, you know. To me that is lack of basics, and the compiler says it clearly: Attempted to read/write array element at negative index -1. So basically is your post
Quote:

I'm wondering if you've been setting PGang to -1 when they aren't in the gangs...

kinda useless, as the compiler already told him that.
No need to go berserk mane.
Reply
#9

Quote:
Originally Posted by v1k1nG
Посмотреть сообщение
Who tells you that I am new here.
I know you aren't hence why I mentioned it, but with such a blatant new account it's obvious you aren't capable of posting on your main account, or, you simply don't have the balls to.

Quote:
Originally Posted by v1k1nG
Посмотреть сообщение
Aand btw in that case this ain't the way to help new members, you know.
He's not as new as your account, so that point is moot. Don't try draw him into your argument, as he got more information from me than what you gave...

Quote:
Originally Posted by v1k1nG
Посмотреть сообщение
To me that is lack of basics, and the compiler says it clearly: Attempted to read/write array element at negative index -1.
It says that, but it doesn't actually say WHAT variable OOBed...

Quote:
Originally Posted by v1k1nG
Посмотреть сообщение
So basically is your post
kinda useless, as the compiler already told him that.
It's not as it suggests where to look at, and questions the error... Your post of a simple wiki page, is plain spam.

Quote:
Originally Posted by v1k1nG
Посмотреть сообщение
No need to go berserk mane.
'berserk' lol.
Reply
#10

1) Hu3hu3 I am not ban evading if that's what you mean. Simply I forgot my password and when trying to reset it, I didn't receive any e-mail. Since reputation doesn't matter, I made a new one. Talking about balls on a forum, lol.

2) Nah, you just stated an hypothesis

3) You didn't aswell

4) And you going berkerk on me isn't plain spam?

5) xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)