Posts: 55
Threads: 2
Joined: Sep 2012
Reputation:
0
Here goes ...Right after I updated my game mode from 0.3z to 0.3.7 and compiled with all the latest plugins and inc's I get this continuous spam > [debug] Run time error 4: "Array index out of bounds" [debug] Accessing element at index 48 past array upper bound 47. [debug] AMX backtrace:[debug] #0 0003084c in public WantedColor () at C:\Users\Robert\Desktop\SA-MP0.3.7\gamemodes\MWCNR.pwn:1707. I dont get it cuz this GM worked seamlessly on 0.3z.(Facepalm). The code that [debug] AMX backtrace points to is> public WantedColor()
{
for (new i; i < MAX_PLAYERS; i++ && gTeam[i] == TEAM_CIV)
{
switch(GetPlayerWantedLevel(i))
{
case 0:
{
SetPlayerColor(i,COLOR_WHITE);
}
case 1 .. 3:
{
SetPlayerColor(i,yellow);
}
case 4 .. 10:
{
SetPlayerColor(i,red);
}
}
}
}
Any help would be greatly appreciated .Thanks.
Posts: 55
Threads: 2
Joined: Sep 2012
Reputation:
0
12.05.2015, 00:28
(
Последний раз редактировалось JJohnson1; 12.05.2015 в 00:30.
Причина: additional info
)
Thanx Emmet_ thats how it looks in my script too just didn't come out right for the post ofc. Any other ideas ?
Posts: 3,324
Threads: 96
Joined: Sep 2013
This would not have changed between 0.3z and 0.3.7, it is an error in your loop.
1. Try Emmet's code.
2. Read Pottus's comment. Note: You should never change anything in the default server includes, you can always just use undef to un define things (i.e. BEFORE INCLUDING OTHER INCLUDES).
Posts: 55
Threads: 2
Joined: Sep 2012
Reputation:
0
Ok i replaced code that was there with EMMET_'s now i get this [21:02:40] [connection] **.**.**.***:61823 requests connection cookie.
[21:02:41] Incoming connection: **.**.**.***:61823 id: 0
[21:02:41] [join] JJohnson1 has joined the server (0:**.**.**.***)
[21:02:41] [debug] Server crashed while executing MWCNR.amx
[21:02:41] [debug] AMX backtrace:
[21:02:41] [debug] #0 native fwrite () from samp-server.exe
[21:02:41] [debug] #1 0002edd0 in public JoinsLog (string[]=@00153a80 "JJohnson1 has joined the server with the ip **.**.**.***") at C:\Users\Robert\Desktop\SA-MP0.3.7\gamemodes\MWCNR.pwn:1540
[21:02:41] [debug] #2 0005ed60 in public S@@_OnPlayerConnect (playerid=0) at C:\Users\Robert\Desktop\SA-MP0.3.7\gamemodes\MWCNR.pwn:5259
[21:02:41] [debug] #3 native CallLocalFunction () from samp-server.exe
[21:02:41] [debug] #4 00007928 in public SSCANF_OnPlayerConnect (playerid=0) at C:\Users\Robert\Desktop\SA-MP0.3.7\pawno\include\streamer.inc:342
[21:02:41] [debug] #5 00000bd4 in public OnPlayerConnect (playerid=0) at C:\Users\Robert\Desktop\SA-MP0.3.7\pawno\include\sscanf2.inc:205
[21:02:42] [debug] Native backtrace:
[21:02:42] [debug] #0 77046b90 in ?? () from C:\Windows\SYSTEM32\ntdll.dll
[21:02:42] [debug] #1 004972e0 in ?? () from samp-server.exe
[21:02:42] [debug] #2 0040534e in ?? () from samp-server.exe
That's a completely unrelated error and it seems that it's coming from the "JoinsLog" function. Post it here.