[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
forward GizleHizGostergesi(playerid);
public GizleHizGostergesi(playerid)
{
for(new i = 0; i < 16; i++) TextDrawDestroy(HizGostergesiTD[playerid][i]);
return 1;
}
new Text:HizGostergesiTD[][16] = {Text:INVALID_TEXT_DRAW};
new Text:HizGostergesiTD[MAX_PLAYERS][16]
#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;
}
}
}
new Text:HizGostergesiTD[MAX_PLAYERS][16] = {{Text:INVALID_TEXT_DRAW, ...}, ...};
|
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 Код:
pawn Код:
pawn Код:
|
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.
|
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.