After 0.3.7 Update >>Lots o' problems :( -
JJohnson1 - 12.05.2015
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.
Re: After 0.3.7 Update >>Lots o' problems :( - Emmet_ - 12.05.2015
pawn Код:
public WantedColor()
{
for (new i; i < MAX_PLAYERS; i++)
{
if(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);
}
}
}
}
}
Re: After 0.3.7 Update >>Lots o' problems :( -
JJohnson1 - 12.05.2015
Thanx Emmet_ thats how it looks in my script too just didn't come out right for the post ofc. Any other ideas ?
Re: After 0.3.7 Update >>Lots o' problems :( -
Pottus - 12.05.2015
Maybe you edited your SA-MP include before and set MAX_PLAYERS but now it is 500 since you replaced the include files.
Код:
for (new i; i < MAX_PLAYERS; i++ && gTeam[i] == TEAM_CIV)
Verify - MAX_PLAYERS size and gTeam size are the same.
Re: After 0.3.7 Update >>Lots o' problems :( -
Abagail - 12.05.2015
snip
Re: After 0.3.7 Update >>Lots o' problems :( - Emmet_ - 12.05.2015
Quote:
Originally Posted by JJohnson1
Thanx Emmet_ thats how it looks in my script too just didn't come out right for the post ofc. Any other ideas ?
|
I relocated the if() statement because you had it in the wrong place.
Re: After 0.3.7 Update >>Lots o' problems :( -
JJohnson1 - 12.05.2015
Quote:
Originally Posted by Pottus
Maybe you edited your SA-MP include before and set MAX_PLAYERS but now it is 500 since you replaced the include files.
Код:
for (new i; i < MAX_PLAYERS; i++ && gTeam[i] == TEAM_CIV)
Verify - MAX_PLAYERS size and gTeam size are the same.
|
Is this what u meant?
#define MAX_PLAYERS (48)
new gTeam[MAX_PLAYERS];
Re: After 0.3.7 Update >>Lots o' problems :( -
Crayder - 12.05.2015
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).
Re: After 0.3.7 Update >>Lots o' problems :( -
JJohnson1 - 12.05.2015
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
Re: After 0.3.7 Update >>Lots o' problems :( - Emmet_ - 12.05.2015
That's a completely unrelated error and it seems that it's coming from the "JoinsLog" function. Post it here.