Need Help
#1

Код:
[debug] Run time error 4: "Array index out of bounds"
[debug]  Attempted to read/write array element at index 1 in array of size 1
[debug] AMX backtrace:
[debug] #0 0013ea34 in ?? (1) from ortek-gm.amx
[debug] #1 00136174 in public ac_OnPlayerConnect (1) from ortek-gm.amx
[debug] #2 000395bc in public SSCANF_OnPlayerConnect (1) from ortek-gm.amx
[debug] #3 000260e8 in public ATT_OnPlayerConnect (1) from ortek-gm.amx
[debug] #4 0001e2dc in public Itter_OnPlayerConnect (1) from ortek-gm.amx
[debug] #5 00008c9c in public FIXES_OnPlayerConnect (1) from ortek-gm.amx
[debug] #6 00001338 in public OnPlayerConnect (1) from ortek-gm.amx
[debug] Run time error 4: "Array index out of bounds"
[debug]  Attempted to read/write array element at index 1 in array of size 1
[debug] AMX backtrace:
[debug] #0 00279d88 in public GizleHizGostergesi (1) from ortek-gm.amx
[debug] #1 0012bcf0 in public ac_OnPlayerStateChange (1, 9, 0) from ortek-gm.amx
[debug] #2 0004d138 in public FIXES_OnPlayerStateChange (1, 9, 0) from ortek-gm.amx
[debug] #3 000044c0 in public OnPlayerStateChange (1, 9, 0) from ortek-gm.amx
Help please.
Reply
#2

Show "GizleHizGostergesi" function code.
Reply
#3

Quote:
Originally Posted by Misiur
Посмотреть сообщение
Show "GizleHizGostergesi" function code.
Код:
forward GizleHizGostergesi(playerid);
public GizleHizGostergesi(playerid)
{
        for(new i = 0; i < 16; i++) TextDrawDestroy(HizGostergesiTD[playerid][i]);
		return 1;
}
Reply
#4

Ok, now show definition of "HizGostergesiTD"
Reply
#5

Quote:
Originally Posted by Misiur
Посмотреть сообщение
Ok, now show definition of "HizGostergesiTD"
Код:
new Text:HizGostergesiTD[][16] = {Text:INVALID_TEXT_DRAW};
Reply
#6

You created an array of shape [1][16] and you are accessing it at "playerid" index - so it fails right after index 0. If you need an array for all players, use MAX_PLAYERS:
pawn Код:
new Text:HizGostergesiTD[MAX_PLAYERS][16]
Also, your initialization won't work correctly, as 2d/nested initialization is not supported. You have to do it by hand:
pawn Код:
#define PLAYER_TDS 16
new Text:HizGostergesiTD[MAX_PLAYERS][PLAYER_TDS];

main () {
    for (new i = 0; i < sizeof(HizGostergesiTD); ++i) {
        for (new j = 0; j != PLAYER_TDS; ++j) {
            HizGostergesiTD[i][j] = INVALID_TEXT_DRAW;
        }
    }
}
Unless you use Zeex's compiler
pawn Код:
new Text:HizGostergesiTD[MAX_PLAYERS][16] = {{Text:INVALID_TEXT_DRAW, ...}, ...};
Reply
#7

Quote:
Originally Posted by Misiur
Посмотреть сообщение
You created an array of shape [1][16] and you are accessing it at "playerid" index - so it fails right after index 0. If you need an array for all players, use MAX_PLAYERS:
pawn Код:
new Text:HizGostergesiTD[MAX_PLAYERS][16]
Also, your initialization won't work correctly, as 2d/nested initialization is not supported. You have to do it by hand:
pawn Код:
#define PLAYER_TDS 16
new Text:HizGostergesiTD[MAX_PLAYERS][PLAYER_TDS];

main () {
    for (new i = 0; i < sizeof(HizGostergesiTD); ++i) {
        for (new j = 0; j != PLAYER_TDS; ++j) {
            HizGostergesiTD[i][j] = INVALID_TEXT_DRAW;
        }
    }
}
Unless you use Zeex's compiler
pawn Код:
new Text:HizGostergesiTD[MAX_PLAYERS][16] = {{Text:INVALID_TEXT_DRAW, ...}, ...};
I used zee's compiler

Код:
C:\Users\Cengizhan\Desktop\SAMP ILE ILGILI\mod\pawno\include\sscanf2.inc(7) : fatal error 111: user error: Please include <a_npc> or <a_samp> first.


Compilation aborted.

Pawn compiler 3.10.2	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#8

Oh, try adding compatibility mode: https://github.com/Zeex/pawn/wiki/Compatibility-mode
I know this error, will take a look on how I fixed it locally
Reply
#9

Quote:
Originally Posted by Misiur
Посмотреть сообщение
Oh, try adding compatibility mode: https://github.com/Zeex/pawn/wiki/Compatibility-mode
I know this error, will take a look on how I fixed it locally
Код:
C:\Users\Cengizhan\Desktop\SAMP ILE ILGILI\Novania Modu\pawno\include\YSI\y_debug.inc(380) : error 017: undefined symbol "Debug_SetState"
C:\Users\Cengizhan\Desktop\SAMP ILE ILGILI\Novania Modu\pawno\include\YSI\y_debug.inc(380) : error 029: invalid expression, assumed zero
C:\Users\Cengizhan\Desktop\SAMP ILE ILGILI\Novania Modu\pawno\include\YSI\y_debug.inc(380) : warning 215: expression has no effect
C:\Users\Cengizhan\Desktop\SAMP ILE ILGILI\Novania Modu\pawno\include\sscanf2.inc(47) : warning 235: public function lacks forward declaration (symbol "OnNPCModeInit")
C:\Users\Cengizhan\Desktop\SAMP ILE ILGILI\Novania Modu\pawno\include\nex-ac.inc(1288) : error 017: undefined symbol "ac_GetSpeed"
C:\Users\Cengizhan\Desktop\SAMP ILE ILGILI\Novania Modu\pawno\include\nex-ac.inc(1288) : warning 215: expression has no effect
C:\Users\Cengizhan\Desktop\SAMP ILE ILGILI\Novania Modu\pawno\include\nex-ac.inc(1288) : warning 215: expression has no effect
C:\Users\Cengizhan\Desktop\SAMP ILE ILGILI\Novania Modu\pawno\include\nex-ac.inc(1288) : warning 215: expression has no effect
C:\Users\Cengizhan\Desktop\SAMP ILE ILGILI\Novania Modu\pawno\include\nex-ac.inc(1288) : error 001: expected token: ";", but found ")"
C:\Users\Cengizhan\Desktop\SAMP ILE ILGILI\Novania Modu\pawno\include\nex-ac.inc(1288) : error 029: invalid expression, assumed zero
C:\Users\Cengizhan\Desktop\SAMP ILE ILGILI\Novania Modu\pawno\include\nex-ac.inc(1288) : fatal error 107: too many error messages on one line

Compilation aborted.

Pawn compiler 3.10.2	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
Reply
#10

Damn. I think you should go back to standard compiler and just initialize manually as I've showed you previously. You need some knowledge to fix these errors (as they'll pop up often with different includes - for example I don't think YSI 3 was ever tested with this compiler).
Sorry for confusion
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)