Problem(error/warning): Kada kompajlujem skriptu izbaci mi error:
C:\Documents and Settings\CEL1C.dev\Desktop\gmp\panama.pwn(55420) : error 032: array index out of bounds (variable "TDEditor_TD")
C:\Documents and Settings\CEL1C.dev\Desktop\gmp\panama.pwn(55430) : error 032: array index out of bounds (variable "TDEditor_TD")
C:\Documents and Settings\CEL1C.dev\Desktop\gmp\panama.pwn(55445) : error 032: array index out of bounds (variable "TDEditor_TD")
C:\Documents and Settings\CEL1C.dev\Desktop\gmp\panama.pwn(55455) : error 032: array index out of bounds (variable "TDEditor_TD")
C:\Documents and Settings\CEL1C.dev\Desktop\gmp\panama.pwn(55470) : error 032: array index out of bounds (variable "TDEditor_TD")
C:\Documents and Settings\CEL1C.dev\Desktop\gmp\panama.pwn(55480) : error 032: array index out of bounds (variable "TDEditor_TD")
C:\Documents and Settings\CEL1C.dev\Desktop\gmp\panama.pwn(55495) : error 032: array index out of bounds (variable "TDEditor_TD")
C:\Documents and Settings\CEL1C.dev\Desktop\gmp\panama.pwn(55505) : error 032: array index out of bounds (variable "TDEditor_TD")
C:\Documents and Settings\CEL1C.dev\Desktop\gmp\panama.pwn(55520) : error 032: array index out of bounds (variable "TDEditor_TD")
C:\Documents and Settings\CEL1C.dev\Desktop\gmp\panama.pwn(55530) : error 032: array index out of bounds (variable "TDEditor_TD")
Deo skripte:[pawn]
CMD:bojatd(playerid, params[])
{
new stringic[128];
if(sscanf(params, "s[24]", stringic)) return KORISCENJE(playerid, "/bojatd [crvena-default-zuta-narandzasta-roza]");
if(strcmp(stringic, "crvena", true) == 0)
{
TextDrawColor(TDEditor_TD[1], 0xDB1605FF);
TextDrawColor(TDEditor_TD[17], 0xDB1605FF);
TextDrawColor(TDEditor_TD[19], 0xDB1605FF);
TextDrawColor(TDEditor_TD[25], 0xDB1605FF);
TextDrawColor(TDEditor_TD[27], 0xDB1605FF);
TextDrawColor(TDEditor_TD[31], 0xDB1605FF);
TextDrawColor(TDEditor_TD[33], 0xDB1605FF);
TextDrawColor(TDEditor_TD[35], 0xDB1605FF);
TextDrawColor(TDEditor_TD[36], 0xDB1605FF);
TextDrawColor(TDEditor_TD[37], 0xDB1605FF);
TextDrawColor(TDEditor_TD[38], 0xDB1605FF);
TextDrawColor(ObavestenjeTD[0], 0xDB1605FF);
TextDrawShowForPlayer(playerid,TDEditor_TD[1]);
TextDrawShowForPlayer(playerid,TDEditor_TD[17]);
TextDrawShowForPlayer(playerid,TDEditor_TD[19]);
TextDrawShowForPlayer(playerid,TDEditor_TD[26]);
TextDrawShowForPlayer(playerid,TDEditor_TD[28]);
TextDrawShowForPlayer(playerid,TDEditor_TD[33]);
TextDrawShowForPlayer(playerid,TDEditor_TD[36]);
TextDrawShowForPlayer(playerid,TDEditor_TD[37]);
TextDrawShowForPlayer(playerid,TDEditor_TD[38]);
TextDrawShowForPlayer(playerid,ObavestenjeTD[0]);
}
if(strcmp(stringic, "default", true) == 0)
{
TextDrawColor(TDEditor_TD[1], 7596799);
TextDrawColor(TDEditor_TD[17], 7596799);
TextDrawColor(TDEditor_TD[19], 7596799);
TextDrawColor(TDEditor_TD[25], 7596799);
TextDrawColor(TDEditor_TD[27], 7596799);
TextDrawColor(TDEditor_TD[31], 7596799);
TextDrawColor(TDEditor_TD[33], 0xFFFFFFFF);
TextDrawColor(TDEditor_TD[35], 7596799);
TextDrawColor(TDEditor_TD[36], 7596799);
TextDrawColor(TDEditor_TD[37], 7596799);
TextDrawColor(TDEditor_TD[38], 7596799);
TextDrawColor(ObavestenjeTD[0], 7596799);
TextDrawShowForPlayer(playerid,TDEditor_TD[1]);
TextDrawShowForPlayer(playerid,TDEditor_TD[17]);
TextDrawShowForPlayer(playerid,TDEditor_TD[19]);
TextDrawShowForPlayer(playerid,TDEditor_TD[26]);
TextDrawShowForPlayer(playerid,TDEditor_TD[28]);
TextDrawShowForPlayer(playerid,TDEditor_TD[33]);
TextDrawShowForPlayer(playerid,TDEditor_TD[36]);
TextDrawShowForPlayer(playerid,TDEditor_TD[37]);
TextDrawShowForPlayer(playerid,TDEditor_TD[38]);
TextDrawShowForPlayer(playerid,ObavestenjeTD[0]);
}
if(strcmp(stringic, "zuta", true) == 0)
{
TextDrawColor(TDEditor_TD[1], 0xFFFF00AA);
TextDrawColor(TDEditor_TD[17], 0xFFFF00AA);
TextDrawColor(TDEditor_TD[19], 0xFFFF00AA);
TextDrawColor(TDEditor_TD[25], 0xFFFF00AA);
TextDrawColor(TDEditor_TD[27], 0xFFFF00AA);
TextDrawColor(TDEditor_TD[31], 0xFFFF00AA);
TextDrawColor(TDEditor_TD[33], 0xFFFF00AA);
TextDrawColor(TDEditor_TD[35], 0xFFFF00AA);
TextDrawColor(TDEditor_TD[36], 0xFFFF00AA);
TextDrawColor(TDEditor_TD[37], 0xFFFF00AA);
TextDrawColor(TDEditor_TD[38], 0xFFFF00AA);
TextDrawColor(ObavestenjeTD[0], 0xFFFF00AA);
TextDrawShowForPlayer(playerid,TDEditor_TD[1]);
TextDrawShowForPlayer(playerid,TDEditor_TD[17]);
TextDrawShowForPlayer(playerid,TDEditor_TD[19]);
TextDrawShowForPlayer(playerid,TDEditor_TD[26]);
TextDrawShowForPlayer(playerid,TDEditor_TD[28]);
TextDrawShowForPlayer(playerid,TDEditor_TD[33]);
TextDrawShowForPlayer(playerid,TDEditor_TD[36]);
TextDrawShowForPlayer(playerid,TDEditor_TD[37]);
TextDrawShowForPlayer(playerid,TDEditor_TD[38]);
TextDrawShowForPlayer(playerid,ObavestenjeTD[0]);
}
if(strcmp(stringic, "narandzasta", true) == 0)
{
TextDrawColor(TDEditor_TD[1], 0xFFAF00FF);
TextDrawColor(TDEditor_TD[17], 0xFFAF00FF);
TextDrawColor(TDEditor_TD[19], 0xFFAF00FF);
TextDrawColor(TDEditor_TD[25], 0xFFAF00FF);
TextDrawColor(TDEditor_TD[27], 0xFFAF00FF);
TextDrawColor(TDEditor_TD[31], 0xFFAF00FF);
TextDrawColor(TDEditor_TD[33], 0xFFAF00FF);
TextDrawColor(TDEditor_TD[35], 0xFFAF00FF);
TextDrawColor(TDEditor_TD[36], 0xFFAF00FF);
TextDrawColor(TDEditor_TD[37], 0xFFAF00FF);
TextDrawColor(TDEditor_TD[38], 0xFFAF00FF);
TextDrawColor(ObavestenjeTD[0], 0xFFAF00FF);
TextDrawShowForPlayer(playerid,TDEditor_TD[1]);
TextDrawShowForPlayer(playerid,TDEditor_TD[17]);
TextDrawShowForPlayer(playerid,TDEditor_TD[19]);
TextDrawShowForPlayer(playerid,TDEditor_TD[26]);
TextDrawShowForPlayer(playerid,TDEditor_TD[28]);
TextDrawShowForPlayer(playerid,TDEditor_TD[33]);
TextDrawShowForPlayer(playerid,TDEditor_TD[36]);
TextDrawShowForPlayer(playerid,TDEditor_TD[37]);
TextDrawShowForPlayer(playerid,TDEditor_TD[38]);
TextDrawShowForPlayer(playerid,ObavestenjeTD[0]);
}
if(strcmp(stringic, "roza", true) == 0)
{
TextDrawColor(TDEditor_TD[1], 0xDF0172FF);
TextDrawColor(TDEditor_TD[17], 0xDF0172FF);
TextDrawColor(TDEditor_TD[19], 0xDF0172FF);
TextDrawColor(TDEditor_TD[25], 0xDF0172FF);
TextDrawColor(TDEditor_TD[27], 0xDF0172FF);
TextDrawColor(TDEditor_TD[31], 0xDF0172FF);
TextDrawColor(TDEditor_TD[33], 0xDF0172FF);
TextDrawColor(TDEditor_TD[35], 0xDF0172FF);
TextDrawColor(TDEditor_TD[36], 0xDF0172FF);
TextDrawColor(TDEditor_TD[37], 0xDF0172FF);
TextDrawColor(TDEditor_TD[38], 0xDF0172FF);
TextDrawColor(ObavestenjeTD[0], 0xDF0172FF);
TextDrawShowForPlayer(playerid,TDEditor_TD[1]);
TextDrawShowForPlayer(playerid,TDEditor_TD[17]);
TextDrawShowForPlayer(playerid,TDEditor_TD[19]);
TextDrawShowForPlayer(playerid,TDEditor_TD[26]);
TextDrawShowForPlayer(playerid,TDEditor_TD[28]);
TextDrawShowForPlayer(playerid,TDEditor_TD[33]);
TextDrawShowForPlayer(playerid,TDEditor_TD[36]);
TextDrawShowForPlayer(playerid,TDEditor_TD[37]);
TextDrawShowForPlayer(playerid,TDEditor_TD[38]);
TextDrawShowForPlayer(playerid,ObavestenjeTD[0]);
}
SendClientMessage(playerid,-1,"{37A4DB}[BOJATD] {FFFFFF}Uspesno ste promenili boju TD-ova.");
return 1;
}[/pawn]
Debug iz server_loga: //
Slika/video ingame problema: Nije in game
Pošalji new od "TDEditor_TD"
Citat: Richter poslato Jul 02, 2020, 21:39:19 POSLE PODNE
Pošalji new od "TDEditor_TD"
[pawn]new Text:TDEditor_TD[38];[/pawn]
Imaš 38 elemenata u Array-u, to znači da možeš koristiti 0-37, svaki array počinje s 0, a ti pokušavaš mijenjati 38 koji nije zadan kao npr "TextDrawColor(TDEditor_TD[38], 0xDB1605FF);" i zbog toga dobivaš errore.
Ne znam da li razumiješ, ne znam kako objasnit to xd
Obrisi ovu liniju svugde, jer array kad praviš brojiš i nulu znaci imas 37 i ne možeš preko toga
TextDrawShowForPlayer(playerid,TDEditor_TD[38]);
Shvatio,hvala
LOCK