Hitno pomoc

JackScript_ Započeo JackScript_
pre 5 godina
466
pregleda
6
postova
JackScript_
Wheel Man
pre 5 godina
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:

CMD:bojatd(playerid, params[])
{
    new stringic;
    if(sscanf(params, "s", stringic)) return KORISCENJE(playerid, "/bojatd [crvena-default-zuta-narandzasta-roza]");
    if(strcmp(stringic, "crvena", true) == 0)
    {
        TextDrawColor(TDEditor_TD, 0xDB1605FF);
        TextDrawColor(TDEditor_TD, 0xDB1605FF);
        TextDrawColor(TDEditor_TD, 0xDB1605FF);
        TextDrawColor(TDEditor_TD, 0xDB1605FF);
        TextDrawColor(TDEditor_TD, 0xDB1605FF);
        TextDrawColor(TDEditor_TD, 0xDB1605FF);
        TextDrawColor(TDEditor_TD, 0xDB1605FF);
        TextDrawColor(TDEditor_TD, 0xDB1605FF);
        TextDrawColor(TDEditor_TD, 0xDB1605FF);
        TextDrawColor(TDEditor_TD, 0xDB1605FF);
        TextDrawColor(TDEditor_TD, 0xDB1605FF);
        TextDrawColor(ObavestenjeTD, 0xDB1605FF);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,ObavestenjeTD);
    }
    if(strcmp(stringic, "default", true) == 0)
    {
        TextDrawColor(TDEditor_TD, 7596799);
        TextDrawColor(TDEditor_TD, 7596799);
        TextDrawColor(TDEditor_TD, 7596799);
        TextDrawColor(TDEditor_TD, 7596799);
        TextDrawColor(TDEditor_TD, 7596799);
        TextDrawColor(TDEditor_TD, 7596799);
        TextDrawColor(TDEditor_TD, 0xFFFFFFFF);
        TextDrawColor(TDEditor_TD, 7596799);
        TextDrawColor(TDEditor_TD, 7596799);
        TextDrawColor(TDEditor_TD, 7596799);
        TextDrawColor(TDEditor_TD, 7596799);
        TextDrawColor(ObavestenjeTD, 7596799);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,ObavestenjeTD);
    }
    if(strcmp(stringic, "zuta", true) == 0)
    {
        TextDrawColor(TDEditor_TD, 0xFFFF00AA);
        TextDrawColor(TDEditor_TD, 0xFFFF00AA);
        TextDrawColor(TDEditor_TD, 0xFFFF00AA);
        TextDrawColor(TDEditor_TD, 0xFFFF00AA);
        TextDrawColor(TDEditor_TD, 0xFFFF00AA);
        TextDrawColor(TDEditor_TD, 0xFFFF00AA);
        TextDrawColor(TDEditor_TD, 0xFFFF00AA);
        TextDrawColor(TDEditor_TD, 0xFFFF00AA);
        TextDrawColor(TDEditor_TD, 0xFFFF00AA);
        TextDrawColor(TDEditor_TD, 0xFFFF00AA);
        TextDrawColor(TDEditor_TD, 0xFFFF00AA);
        TextDrawColor(ObavestenjeTD, 0xFFFF00AA);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,ObavestenjeTD);
    }
    if(strcmp(stringic, "narandzasta", true) == 0)
    {
        TextDrawColor(TDEditor_TD, 0xFFAF00FF);
        TextDrawColor(TDEditor_TD, 0xFFAF00FF);
        TextDrawColor(TDEditor_TD, 0xFFAF00FF);
        TextDrawColor(TDEditor_TD, 0xFFAF00FF);
        TextDrawColor(TDEditor_TD, 0xFFAF00FF);
        TextDrawColor(TDEditor_TD, 0xFFAF00FF);
        TextDrawColor(TDEditor_TD, 0xFFAF00FF);
        TextDrawColor(TDEditor_TD, 0xFFAF00FF);
        TextDrawColor(TDEditor_TD, 0xFFAF00FF);
        TextDrawColor(TDEditor_TD, 0xFFAF00FF);
        TextDrawColor(TDEditor_TD, 0xFFAF00FF);
        TextDrawColor(ObavestenjeTD, 0xFFAF00FF);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,ObavestenjeTD);
    }
    if(strcmp(stringic, "roza", true) == 0)
    {
        TextDrawColor(TDEditor_TD, 0xDF0172FF);
        TextDrawColor(TDEditor_TD, 0xDF0172FF);
        TextDrawColor(TDEditor_TD, 0xDF0172FF);
        TextDrawColor(TDEditor_TD, 0xDF0172FF);
        TextDrawColor(TDEditor_TD, 0xDF0172FF);
        TextDrawColor(TDEditor_TD, 0xDF0172FF);
        TextDrawColor(TDEditor_TD, 0xDF0172FF);
        TextDrawColor(TDEditor_TD, 0xDF0172FF);
        TextDrawColor(TDEditor_TD, 0xDF0172FF);
        TextDrawColor(TDEditor_TD, 0xDF0172FF);
        TextDrawColor(TDEditor_TD, 0xDF0172FF);
        TextDrawColor(ObavestenjeTD, 0xDF0172FF);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,TDEditor_TD);
        TextDrawShowForPlayer(playerid,ObavestenjeTD);
    }
    SendClientMessage(playerid,-1,"{37A4DB} {FFFFFF}Uspesno ste promenili boju TD-ova.");
    return 1;
}

Debug iz server_loga: //
Slika/video ingame problema: Nije in game
Daya
Enforcer
pre 5 godina
Pošalji new od "TDEditor_TD"
JackScript_
Wheel Man
pre 5 godina
Richter wrote on July 2, 2020, 7:39 pm:
Pošalji new od "TDEditor_TD"

new Text:TDEditor_TD;
Daya
Enforcer
pre 5 godina
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, 0xDB1605FF);" i zbog toga dobivaš errore.

Ne znam da li razumiješ, ne znam kako objasnit to xd
Grebovic_Danijel
Godfather
pre 5 godina
Obrisi ovu liniju svugde, jer array kad praviš brojiš i nulu znaci imas 37 i ne možeš preko toga

TextDrawShowForPlayer(playerid,TDEditor_TD);
JackScript_
Wheel Man
pre 5 godina
Shvatio,hvala
LOCK

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava