After 0.3.7 Update >>Lots o' problems :(
#1

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.
Reply
#2

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);
                }
            }
        }
    }
}
Reply
#3

Thanx Emmet_ thats how it looks in my script too just didn't come out right for the post ofc. Any other ideas ?
Reply
#4

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.
Reply
#5

snip
Reply
#6

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.
Reply
#7

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];
Reply
#8

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).
Reply
#9

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
Reply
#10

That's a completely unrelated error and it seems that it's coming from the "JoinsLog" function. Post it here.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)