Error 032 array index out of bounds variable playerinfo

Помогите пж,после того как добавил систему регистрации из этой темы у меня появились ошибки 32 которые означают превышение индексации массива. вот ...


#1

Пользователь офлайн
 

Отправлено 19 марта 2017 — 13:11

  • Прохожий

Помогите пж,после того как добавил систему регистрации из этой темы у меня появились ошибки 32 которые означают превышение индексации массива. вот что выдаёт компилятор

А вот строки первые.

Кто поможет,поставлю +! Только быстрей надо,а то истекает время аренды.

UP

UP

UP

-1



#2

Отправлено 20 марта 2017 — 15:39

  • Эксперт

Зачем ты это делаешь? У тебя уже есть переменная лидера, её и используй.

0



#3

Отправлено 20 марта 2017 — 22:36

  • Прохожий

Просмотр сообщенияSkeif (20 марта 2017 — 15:39) писал:

Зачем ты это делаешь? У тебя уже есть переменная лидера, её и используй.

Ты тупой или да? У меня превышен массив PlaeyrInfo!!!

Сообщение отредактировал sanya00075: 20 марта 2017 — 23:27

0



#4

Отправлено 20 марта 2017 — 23:23

  • Пользователь

Скинь что рядом, или попробуй сделать как коментарий, (// — 2 слэша перед строкой)

0



#5

Отправлено 21 марта 2017 — 16:16

  • Прохожий

Просмотр сообщенияYou_Sity (20 марта 2017 — 23:23) писал:

Скинь что рядом, или попробуй сделать как коментарий, (// — 2 слэша перед строкой)

Не помогло :sad:

Просмотр сообщенияYou_Sity (20 марта 2017 — 23:23) писал:

Скинь что рядом, или попробуй сделать как коментарий, (// — 2 слэша перед строкой)

Вот тебе кусок

0



#6

Отправлено 21 марта 2017 — 16:21

  • Banned

Просмотр сообщенияsanya00075 (20 марта 2017 — 22:36) писал:

Ты тупой или да? У меня превышен массив PlaeyrInfo!!!

Я вижу ты такой тут умный
То делай сам если ты такими словами расскидываешся :evil:



#7

Отправлено 21 марта 2017 — 16:25

  • Прохожий

Просмотр сообщенияIsland (21 марта 2017 — 16:21) писал:

Я вижу ты такой тут умный
То делай сам если ты такими словами расскидываешся :evil:

Он бы читать сначала научился,а потом репку портить новичкам! Он не прочёл и какую-то фигню пишет!

Сообщение отредактировал sanya00075: 21 марта 2017 — 16:26

0



#8

Отправлено 21 марта 2017 — 16:29

  • Banned

Просмотр сообщенияsanya00075 (21 марта 2017 — 16:25) писал:

Он бы читать сначала научился,а потом репку портить новичкам! Он не прочёл и какую-то фигню пишет!

вообщето он всё правельно написал
зачем юзать 2 переменных с 1 и тем ж содержимым когда можно юзать одну



#9

Отправлено 22 марта 2017 — 01:02

  • Прохожий

Просмотр сообщенияIsland (21 марта 2017 — 16:29) писал:

вообщето он всё правельно написал
зачем юзать 2 переменных с 1 и тем ж содержимым когда можно юзать одну

Я нубик прост,распиши пж как надо.

0


  • ← Предыдущая тема
  • Проблемы с компилированием
  • Следующая тема →

  • Вы не можете создать новую тему
  • Тема закрыта


1 человек читают эту тему
0 пользователей, 1 гостей, 0 скрытых пользователей

CMD:pleaders(playerid, params[])
{
    if(PlayerInfo[playerid][pAlcoInvenxua] < 14) return true; //
    new bufer[2048];
    format(bufer, 2048,"ФракцияtЛидерn
    LSPDt%sn
    FBIt%sn
    Армия Авианосецt%sn
    МЧС ЛСt%sn
    LCNt%sn
    Yakuzat%sn
    Мэрияt%sn
    SFPDt%sn
    Ballast%sn
    Vagost%sn
    Russian Mafiat%sn
    Grovet%sn
    Sa Newst%sn
    Aztecast%sn
    Rifat%sn
    Армия Зона 51t%sn
    LVPDt%sn
    Hitmanst%sn
    StreetRacerst%sn
    S.W.A.T.t%sn
    Правительствоt%s",
    PlayerInfo[pLeader][pNames] ? "{00FF00}%s" : "{FF0000}Нету",
    PlayerInfo[pLeader][pNames] ? "{00FF00}%s" : "{FF0000}Нету",
    PlayerInfo[pLeader][pNames] ? "{00FF00}%s" : "{FF0000}Нету",
    PlayerInfo[pLeader][pNames] ? "{00FF00}%s" : "{FF0000}Нету",
    PlayerInfo[pLeader][pNames] ? "{00FF00}%s" : "{FF0000}Нету",
    PlayerInfo[pLeader][pNames] ? "{00FF00}%s" : "{FF0000}Нету",
    PlayerInfo[pLeader][pNames] ? "{00FF00}%s" : "{FF0000}Нету",
    PlayerInfo[pLeader][pNames] ? "{00FF00}%s" : "{FF0000}Нету",
    PlayerInfo[pLeader][pNames] ? "{00FF00}%s" : "{FF0000}Нету",
    PlayerInfo[pLeader][pNames] ? "{00FF00}%s" : "{FF0000}Нету",
    PlayerInfo[pLeader][pNames] ? "{00FF00}%s" : "{FF0000}Нету",
    PlayerInfo[pLeader][pNames] ? "{00FF00}%s" : "{FF0000}Нету",
    PlayerInfo[pLeader][pNames] ? "{00FF00}%s" : "{FF0000}Нету",
    PlayerInfo[pLeader][pNames] ? "{00FF00}%s" : "{FF0000}Нету",
    PlayerInfo[pLeader][pNames] ? "{00FF00}%s" : "{FF0000}Нету",
    PlayerInfo[pLeader][pNames] ? "{00FF00}%s" : "{FF0000}Нету",
    PlayerInfo[pLeader][pNames] ? "{00FF00}%s" : "{FF0000}Нету",
    PlayerInfo[pLeader][pNames] ? "{00FF00}%s" : "{FF0000}Нету",
    PlayerInfo[pLeader][pNames] ? "{00FF00}%s" : "{FF0000}Нету",
    PlayerInfo[pLeader][pNames] ? "{00FF00}%s" : "{FF0000}Нету",
    PlayerInfo[pLeader][pNames] ? "{00FF00}%s" : "{FF0000}Нету");
    ShowPlayerDialog(playerid, 3568, DIALOG_STYLE_TABLIST_HEADERS, "Лидеры", bufer,"Ок", "Отмена");
    return 1;
}

Как исправить Error
Автор: neka

Значение Error можно посмотреть здесь.

error 040: duplicate «case» label (value 28)

Это означает что case стаким значением повторяется. Решение этой проблемы простое — нам нужно цифру 28 изменит на другую (в той строчке на которую жалуется )

error 032: array index out of bounds (variable «JoinPed»)

Это означает что индекс массива превышен (но не всегда, смотрим дальше) Пример:

131 — массив поигравшись с ним я понял что дело не в нем, а в чём же спросите вы? Пример данной ошибки:

Код: Выделить всё

else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, JoinPed[123][0]); SelectCharPlace[playerid] = 3; InviteSkin[playerid] = JoinPed[98][0]; 

как видим — JoinPed[123] сначало с таким значением, а потом JoinPed[98]. Решение простое: JoinPed[123] число в данных скобках должно быть одинаковым. Пример:

Код: Выделить всё

else if(SelectCharPlace[playerid] == 2) { SetPlayerSkin(playerid, JoinPed[123][0]); SelectCharPlace[playerid] = 3; InviteSkin[playerid] = JoinPed[123][0]; 

error 037: invalid string (possibly non-terminated string)

Это означает что строка неправильная, а точнее где то допущена ошибка:

Код: Выделить всё

else if(PlayerInfo[targetid][pRank] == 4) { rangz = "Зам.модера; }

как видим нам после слова «модера» не хватает «. Правим:

Код: Выделить всё

else if(PlayerInfo[targetid][pRank] == 4) { rangz = "Зам.модера"; }

error 001: expected token: «,», but found «;»

Это значит что мы пропустили знак или скобку (в данном примере скобку) Пример:

Код: Выделить всё

public SaveProdykts()
{
    new idx;
    new File: file2;
    while (idx < sizeof(ProdyktsInfo))
    {
        new coordsstring[256];
        format(coordsstring, sizeof(coordsstring), "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%dn",
        ProdyktsInfo[idx][prSous],
        ProdyktsInfo[idx][prPizza],
        ProdyktsInfo[idx][prMilk],
        ProdyktsInfo[idx][prJuice],
        ProdyktsInfo[idx][prSpirt],
        ProdyktsInfo[idx][prChicken],
        ProdyktsInfo[idx][prKolbasa],
        ProdyktsInfo[idx][prFish],
        ProdyktsInfo[idx][prIceCream],
        ProdyktsInfo[idx][prChips],
        ProdyktsInfo[idx][prZamProd];
        if(idx == 0)
        {
            file2 = fopen("[prodykts]/prodykts.cfg", io_write);
        }
        else
        
{
            file2 = fopen("[prodykts]/prodykts.cfg", io_append);
        }
        fwrite(file2, coordsstring);
        idx++;
        fclose(file2);
    }
    return 1;
}

смотрим на:

и вим что мы ппропустили )

Правим:

И в итоге:

Код: Выделить всё

public SaveProdykts()
{
    new idx;
    new File: file2;
    while (idx < sizeof(ProdyktsInfo))
    {
        new coordsstring[256];
        format(coordsstring, sizeof(coordsstring), "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%dn",
        ProdyktsInfo[idx][prSous],
        ProdyktsInfo[idx][prPizza],
        ProdyktsInfo[idx][prMilk],
        ProdyktsInfo[idx][prJuice],
        ProdyktsInfo[idx][prSpirt],
        ProdyktsInfo[idx][prChicken],
        ProdyktsInfo[idx][prKolbasa],
        ProdyktsInfo[idx][prFish],
        ProdyktsInfo[idx][prIceCream],
        ProdyktsInfo[idx][prChips],
        ProdyktsInfo[idx][prZamProd]);< ----------- И вот наша скобка 
        if
(idx == 0)
        {
            file2 = fopen("[prodykts]/prodykts.cfg", io_write);
        }
        else
        
{
            file2 = fopen("[prodykts]/prodykts.cfg", io_append);
        }
        fwrite(file2, coordsstring);
        idx++;
        fclose(file2);
    }
    return 1;

error 002: only a single statement (or expression) can follow each «case»

Это означает что у вас после «case» идет if(dialogid == ). Пример:

Код: Выделить всё

  case 7507: 
    
{ 
        if
(response) ClothesSex[playerid] = 1; 
        else ClothesSex
[playerid] = 2; 
        ShowPlayerDialog
(playerid,7504,2,"??????? ??????","{A0B0D0}?????????? ?????? {7CC000}300$n{A0B0D0}??????? ?????? {7CC000}300$n{A0B0D0}???????????? ?????? {7CC000}300$n{A0B0D0}?????","???????","?????"); 
        return 1
; 
    
} 
if(dialogid == 7504)  <------------------- вот наша и ошибка 
    
{ 
        if
(response) 
        
{ 
              SetCameraBehindPlayer
(playerid); TogglePlayerControllable(playerid, 1); 
              SetPlayerSkin
(playerid, PlayerInfo[playerid][pModel]); 
              ClothesRun
[playerid] = 0; 
            return 1
; 
        
}

Решение простое: if(dialogid == 7504) это нам нужно заменить на case как и последующий диалог !

Код: Выделить всё

case 7504:  <------------------- вот так это выглядит
    

        if(
response
        { 
              
SetCameraBehindPlayer(playerid); TogglePlayerControllable(playerid1); 
              
SetPlayerSkin(playeridPlayerInfo[playerid][pModel]); 
              
ClothesRun[playerid] = 0
            return 
1
        }  

error 004: function «%s» is not implemented

Это означает что мы пропустили скобку. Мой совет:

  • проверить весь код в ручную
  • на форуме был урок как найти не по ставленую скобку
  • Можно воспользоватся notepad++ там показы линии открытых скобок и тогда можно найти эту скобку

error 017: undefined symbol %s

Это означает что мы не поставили переменную new. Пример:

Решение — ко всем new добавим:

  • #2

@Misha_Petruk, например, Вы объявляете массив на 10 ячеек, а используете 11. Вот у Вас и появляется такая ошибка… Либо увеличивайте размер массива, либо пересматривайте где именно произошел выход за его пределы, пытаясь исправить ситуацию. 

Doberman


  • #3

if(GetPlayerDistanceFromPoint(playerid, VehicleInfo[v][vPosx], VehicleInfo[v][vPosy], VehicleInfo[v][vPosz]) &gt; 50.0)
на

Код:

if(GetPlayerDistanceFromPoint(playerid, VehicleInfo[v][vPosx], VehicleInfo[v][vPosy], VehicleInfo[v][vPosz]) =&gt; 50.0)

Misha_Petruk


  • #4

if(GetPlayerDistanceFromPoint(playerid, VehicleInfo[v][vPosx], VehicleInfo[v][vPosy], VehicleInfo[v][vPosz]) =&gt; 50.0)

Так 5 error

Код:

Gamer.pwn(58842) : error 001: expected token: ";", but found ")"
Gamer.pwn(58842) : fatal error 107: too many error messages on one line
Gamer.pwn(58842) : error 032: array index out of bounds (variable "VehicleInfo")
Gamer.pwn(58842) : error 029: invalid expression, assumed zero
Gamer.pwn(12475) : error 032: array index out of bounds (variable "VehicleInfo")

Последнее редактирование модератором: 14.02.2017

Basis

Basis

chto tut doljno bit`!?


  • #5

@Misha_Petruk,покажи свой енум VehicleInfo и поставь обратно строчку которую тебе посоветовали поменять…..тут дело не в знаке+знаки должны идти «&gt;=» или «&lt;=» или «+=» или «-=»

Doberman


  • #6

Выход за пределы массива как-раз таки из-за некорректного знака может происходить…

MAX_VEHICLES — не задано ли где-нибудь число константе?

Последнее редактирование модератором: 14.02.2017

Misha_Petruk


  • #7

Вотenum pVehInfo
{
        pEngineStatus,
        pLightsStatus,
        pBonnetStatus,
        pBootStatus,
};
new VehicleInfo[MAX_VEHICLES][pVehInfo];
Строчку поменял обратно

Basis

Basis

chto tut doljno bit`!?


  • #8

@Misha_Petruk,не вижу тут координат vPosx и т.д. добавь их

enum pVehInfo
{
        pEngineStatus,
        pLightsStatus,
        pBonnetStatus,
        pBootStatus,
vPosx,
vPosy,
vPosz,
};
new VehicleInfo[MAX_VEHICLES][pVehInfo];
вот так

Doberman


  • #9

#define MAX_VEHICLES поищи и в том числе в инклудах

Misha_Petruk


  • #10

@Basis,Все сохранилось без ошибок но есть

варнинги

и пропала регистрация авторизация

Код:

Gamer.pwn(2884) : warning 213: tag mismatch
Gamer.pwn(2885) : warning 213: tag mismatch
Gamer.pwn(2887) : warning 213: tag mismatch
Gamer.pwn(2888) : warning 213: tag mismatch
Gamer.pwn(2890) : warning 213: tag mismatch
Gamer.pwn(2891) : warning 213: tag mismatch
Gamer.pwn(3785) : warning 202: number of arguments does not match definition
Gamer.pwn(5546) : warning 213: tag mismatch
Gamer.pwn(5549) : warning 213: tag mismatch
Gamer.pwn(5551) : warning 213: tag mismatch
Gamer.pwn(5554) : warning 213: tag mismatch
Gamer.pwn(5560) : warning 213: tag mismatch
Gamer.pwn(5563) : warning 213: tag mismatch
Gamer.pwn(5565) : warning 213: tag mismatch
Gamer.pwn(5568) : warning 213: tag mismatch
Gamer.pwn(5574) : warning 213: tag mismatch
Gamer.pwn(5577) : warning 213: tag mismatch
Gamer.pwn(5579) : warning 213: tag mismatch
Gamer.pwn(5582) : warning 213: tag mismatch

Дополнение к сообщению:

Есть только в инклудах в моде нету

Последнее редактирование модератором: 14.02.2017

Doberman


  • #11

Убери из инклуда и перекомпилируй

Posts: 28
Threads: 6
Joined: Oct 2016

Reputation:

0

Код HTML:

(2070) : error 032: array index out of bounds (variable "PlayerInfo")

^ ERROR

Код HTML:

new PlayerInfo[MAX_PLAYERS][pInfo];

What is wrong?

Posts: 122
Threads: 25
Joined: Aug 2016

Reputation:

0

Posts: 582
Threads: 18
Joined: Jul 2010

Reputation:

0

Must be something wrong in your pInfo enum. Show us your pInfo enum.

Posts: 118
Threads: 10
Joined: May 2013

I think that means you are trying to use an Index in PlayerInfo array that doesnt exist

For example you have:

#define MAX_PLAYERS 50

new PlayerInfo[MAX_PLAYERS][pInfo];

And SOMWHERE you are doing this:

PlayerInfo[51][money] = 1000;

or

PlayerInfo[65535][money] = 1000;
In this case, 65535 = INVALID_PLAYER_ID

Posts: 28
Threads: 6
Joined: Oct 2016

Reputation:

0

THAT IS CMD:

Код HTML:

CMD:asetleader(playerid, params[])
{
	new
	id, pID, string[128];
    if(PlayerInfo[playerid][pAdmin] < 8) return SCM(playerid, COLOR_GREY,"Nu esti autorizat pentru aceasta comanda.");
    if(sscanf(params, "du", id, pID)) return SendClientMessage(playerid, COLOR_GREY, "[Usage:] /asetleader [factionID] [playerid/partofname]");
    if(!IsPlayerConnected(pID)) return SCM(playerid, COLOR_LIGHTRED,"Acest jucator nu este conectat");
	if(id < 1 || id > 10 ) return SCM(playerid, COLOR_LIGHTRED, "ID Factiune Invalid.");

	FactionInfo[id][fLeader] = GetName(pID);
	PlayerInfo[pID][fRank] = 7;
	PlayerInfo[pID][pFaction] = id;
	FactionInfo[id][fMembers] += 1;
 	new file4[40];
 	format(file4, sizeof(file4), FPATH, id);
 	new INI:File = INI_Open(file4);
 	INI_SetTag(File,"data");
 	INI_WriteString(File,"Leader", FactionInfo[id][fLeader]);
 	INI_WriteInt(File,"Members", FactionInfo[id][fMembers]);
 	INI_Close(File);
	format(string, sizeof(string), "LEADER: L-ai pus pe  %s lider la factiunea %s.", GetName(pID), FactionInfo[id][fName]);
	SendClientMessage(playerid, COLOR_WHITE, string);
    return 1;
}

AND THAT IS ERROR LINE:

Код HTML:

	PlayerInfo[playerid][fRank] = 7;

And pInfos

Код HTML:

enum pInfo
{
    pPass,
    pCash,
	pKills,
	pDeaths,
    pAdmin,
    pSex,
    pAge,
   	Float:pPos_x,
	Float:pPos_y,
	Float:pPos_z,
	pSkin,
	pFaction,

}

Posts: 178
Threads: 7
Joined: Oct 2011

Reputation:

0

fRank is not part of pInfo(Enum)..

The reason for the error is:>
PlayerInfo[pID][fRank] = 7;

Either make a pRank inside pInfo and change accordingly.. Or edit the mistake..

Posts: 28
Threads: 6
Joined: Oct 2016

Reputation:

0

Quote:

Originally Posted by Mic_H
Посмотреть сообщение

fRank is not part of pInfo(Enum)..

The reason for the error is:>
PlayerInfo[pID][fRank] = 7;

Either make a pRank inside pInfo and change accordingly.. Or edit the mistake..

Thank you very much man!

Posts: 28
Threads: 6
Joined: Oct 2016

Reputation:

0

Автор: minimiller
Перевод и редактирование: DJ_WEST

Список ошибок:

Код: Выделить всё

/*001*/  "expected token: "%s", but found "%s"n",
/*002*/  "only a single statement (or expression) can follow each "case"n",
/*003*/  "declaration of a local variable must appear in a compound blockn",
/*004*/  "function "%s" is not implementedn",
/*005*/  "function may not have argumentsn",
/*006*/  "must be assigned to an arrayn",
/*007*/  "operator cannot be redefinedn",
/*008*/  "must be a constant expression; assumed zeron",
/*009*/  "invalid array size (negative or zero)n",
/*010*/  "invalid function or declarationn",
/*011*/  "invalid outside functionsn",
/*012*/  "invalid function call, not a valid addressn",
/*013*/  "no entry point (no public functions)n",
/*014*/  "invalid statement; not in switchn",
/*015*/  ""default" case must be the last case in switch statementn",
/*016*/  "multiple defaults in "switch"n",
/*017*/  "undefined symbol "%s"n",
/*018*/  "initialization data exceeds declared sizen",
/*019*/  "not a label: "%s"n",
/*020*/  "invalid symbol name "%s"n",
/*021*/  "symbol already defined: "%s"n",
/*022*/  "must be lvalue (non-constant)n",
/*023*/  "array assignment must be simple assignmentn",
/*024*/  ""break" or "continue" is out of contextn",
/*025*/  "function heading differs from prototypen",
/*026*/  "no matching "#if..."n",
/*027*/  "invalid character constantn",
/*028*/  "invalid subscript (not an array or too many subscripts): "%s"n",
/*029*/  "invalid expression, assumed zeron",
/*030*/  "compound statement not closed at the end of filen",
/*031*/  "unknown directiven",
/*032*/  "array index out of bounds (variable "%s")n",
/*033*/  "array must be indexed (variable "%s")n",
/*034*/  "argument does not have a default value (argument %d)n",
/*035*/  "argument type mismatch (argument %d)n",
/*036*/  "empty statementn",
/*037*/  "invalid string (possibly non-terminated string)n",
/*038*/  "extra characters on linen",
/*039*/  "constant symbol has no sizen",
/*040*/  "duplicate "case" label (value %d)n",
/*041*/  "invalid ellipsis, array size is not knownn",
/*042*/  "invalid combination of class specifiersn",
/*043*/  "character constant exceeds range for packed stringn",
/*044*/  "positional parameters must precede all named parametersn",
/*045*/  "too many function argumentsn",
/*046*/  "unknown array size (variable "%s")n",
/*047*/  "array sizes do not match, or destination array is too smalln",
/*048*/  "array dimensions do not matchn",
/*049*/  "invalid line continuationn",
/*050*/  "invalid rangen",
/*051*/  "invalid subscript, use "[ ]" operators on major dimensionsn",
/*052*/  "multi-dimensional arrays must be fully initializedn",
/*053*/  "exceeding maximum number of dimensionsn",
/*054*/  "unmatched closing bracen",
/*055*/  "start of function body without function headern",
/*056*/  "arrays, local variables and function arguments cannot be public (variable "%s")n",
/*057*/  "unfinished expression before compiler directiven",
/*058*/  "duplicate argument; same argument is passed twicen",
/*059*/  "function argument may not have a default value (variable "%s")n",
/*060*/  "multiple "#else" directives between "#if ... #endif"n",
/*061*/  ""#elseif" directive follows an "#else" directiven",
/*062*/  "number of operands does not fit the operatorn",
/*063*/  "function result tag of operator "%s" must be "%s"n",
/*064*/  "cannot change predefined operatorsn",
/*065*/  "function argument may only have a single tag (argument %d)n",
/*066*/  "function argument may not be a reference argument or an array (argument "%s")n",
/*067*/  "variable cannot be both a reference and an array (variable "%s")n",
/*068*/  "invalid rational number precision in #pragman",
/*069*/  "rational number format already definedn",
/*070*/  "rational number support was not enabledn",
/*071*/  "user-defined operator must be declared before use (function "%s")n",
/*072*/  ""sizeof" operator is invalid on "function" symbolsn",
/*073*/  "function argument must be an array (argument "%s")n",
/*074*/  "#define pattern must start with an alphabetic charactern",
/*075*/  "input line too long (after substitutions)n",
/*076*/  "syntax error in the expression, or invalid function calln",
/*077*/  "malformed UTF-8 encoding, or corrupted file: %sn",
/*078*/  "function uses both "return" and "return <value>"n",
/*079*/  "inconsistent return types (array & non-array)n",
/*080*/  "unknown symbol, or not a constant symbol (symbol "%s")n",
/*081*/  "cannot take a tag as a default value for an indexed array parameter (symbol "%s")n",
/*082*/  "user-defined operators and native functions may not have statesn",
/*083*/  "a function may only belong to a single automaton (symbol "%s")n",
/*084*/  "state conflict: one of the states is already assigned to another implementation (symbol "%s")n",
/*085*/  "no states are defined for function "%s"n",
/*086*/  "unknown automaton "%s"n",
/*087*/  "unknown state "%s" for automaton "%s"n",
/*088*/  "number of arguments does not match definitionn"

Разбор ошибок
Рассмотрим пример нахождения и самостоятельного решения ошибок при компиляции.
Допустим у нас есть ошибка:

C:AMXXexample.sma(107) : error 035: argument type mismatch (argument 2)

Теперь давайте попытаемся разобрать эту ошибку по частям:
1) C:AMXXexample.sma — это директория, где находится исходник (.sma) нашего плагина.
2) (107) — это номер строки, в которой есть ошибка. Большинство современных редакторов текста имеют панель с пронумерованными строками (Notepad++, AMXX-Studio и другие).
3) error 035 — это код ошибки (список ошибок указан выше).
4) argument type mismatch — это описание ошибки с кодом, указанным до этого. В данном случае нам говорится, что «аргумент имеет неверный тип».
5) (argument 2) — это более подробное описание ошибки. В данном случае нам указывается, что ошибка во 2 аргументе.

Итого, получаем: в файле example.sma, который находится в директории C:AMXX, в строке под номером 107 есть ошибка с кодом 035, которая означает, что аргумент 2 имеет неверный тип данных.

Решение ошибок
Теперь попытаемся исправить нашу ошибку. Идем в строку под номером 107 и видим следующий код:

Код: Выделить всё

client_print
(0, "Welcome to the server!")
 

Идем на Вы должны зарегистрироваться, чтобы видеть ссылки.

и читаем описание функции:

client_print — Sends a message to a player.

Syntax:
client_print ( index, type, const message[], … )

id is a player index from 1 to 32. If 0, the message will be sent to all players.

The type is one of three types:
print_chat — chat text
print_console — console message
print_notify — console in dev mode
print_center — center say

Смотрим синтаксис команды client_print и видим, что первый аргумент index — это номер игрока (id), который может быть от 1 до 32, если же он 0, то сообщение будет отсылаться всем игрокам на сервере. Второй аргумент type — это тип сообщения, который может быть:

print_chat — текст в чат
print_console — текст в консоль
print_notify — текст в консоль в режиме разработчика
print_center — текст по центру

Третий аргумент message — это и есть текст нашего сообщения. Теперь вернемся, к нашему, коду. Мы видим, что у нас нет второго аргумента (тип сообщения), а сразу идет текст сообщения, исправляем на:

client_print(0, print_center, «Welcome to the server!»)

Теперь компиляция прошла успешно.

Описание ошибок:
error 001: expected token: «X», but found «Y»
Ошибка означает, что не найден X, когда найден Y. Наиболее часто возникает, когда забывают поставить недостающие знаки ; { } ( ).
Пример ошибки:

Код: Выделить всё

public Function
(id)
{
    if (is_user_bot(id)
    return PLUGIN_HANDLED// код
    
    return PLUGIN_CONTINUE
}
 

error 017: undefined symbol «X»
Ошибка означает, что X — неизвестный сивол/команда/переменная/функция. Поэтому такую функцию или переменную нужно объявить перед использованием. Например, функция is_user_hacker не существует.
Пример ошибки:

Код: Выделить всё

public Function
(id)
{
    if (is_user_hacker(id))
    return PLUGIN_HANDLED// код
    
    return PLUGIN_CONTINUE
}
 

error 032: array index out of bounds (variable X)
Ошибка означает, что в мы вышли за предел размера массива X.
Пример ошибки:

Код: Выделить всё

new s_Name
[32]
s_Name[33] = "*"
 

error 033: array must be indexed (variable X)
Ошибка означает, что массив должен быть проиндексирован. Например, мы не указали размер массива при его объявлении.
Пример ошибки:

Код: Выделить всё

new s_String 
= "My string"
 

error 035: argument type mismatch (argument X)
Ошибка означает, что аргумент X имеет неверный тип данных. Например, когда вместо целочисленного аргумента передаем строку.
Пример ошибки:

Код: Выделить всё

public Function1
(id)
{
    Function2(id, "10")
}
public Function2(id, count)
{
    // код
}
 

error 040: duplicate «case» label (value X)
Ошибка означает, что имеется дубль оператора case со значением X.
Пример ошибки:

Код: Выделить всё

public Function
(id)
{
    switch(count)
    {
        case 1: count += 1
    case 2
: count += 2
    case 2
: count += 3
    
}
}
 

error 075: input line too long (after substitutions)
Ошибка означает, что указанная строка слишком длинная. Например, около 500 символов.
Пример ошибки:

Код: Выделить всё

public Function
(id)
{
    server_print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")
}
 

error 078: function uses both «return» and «return <value>»
Ошибка означает, что функция использует, как return, так и return <значение>.
Пример ошибки:

Код: Выделить всё

public Function
(id)
{
    if (is_user_alive(id))    
        return

        return PLUGIN_HANDLED

}
 

error 088: number of arguments does not match definition
Ошибка означает, что количество переданных аргументов не соответсвует количеству объявленных аргументов.
Пример ошибки:

Код: Выделить всё

public Function1
(id)
{
    Function2(id)
}
public Function2(id, count)
{
    // код
}
 

Не пишите мне в ЛС: если вам нужна помощь на бесплатной основе. Любые вопросы на форум.

Содержание

  1. Форум Pawn.Wiki — Воплоти мечту в реальность!: 033. — Форум Pawn.Wiki — Воплоти мечту в реальность!
  2. Форум Pawn.Wiki — Воплоти мечту в реальность!: error 033: array must be indexed — Форум Pawn.Wiki — Воплоти мечту в реальность!
  3. Error 033 array must be indexed variable playerinfo
  4. Решение ошибок при компиляции
  5. Решение ошибок при компиляции
  6. Форум Pawn.Wiki — Воплоти мечту в реальность!: Помогите если не сложно — Форум Pawn.Wiki — Воплоти мечту в реальность!

Форум Pawn.Wiki — Воплоти мечту в реальность!: 033. — Форум Pawn.Wiki — Воплоти мечту в реальность!

  • Pawn скриптинг
  • Первая помощь
  • Проблемы с компилированием
  • Правила форума
  • Просмотр новых публикаций

  • Группа: Активные пользователи
  • Сообщений: 39
  • Регистрация: 02 мая 13

Добрый день ув. пользователи P-W.

В мод добавил проверку национальностей (расс).

Но как не странно у меня 3 ошибки:

  • Группа: Активные пользователи
  • Сообщений: 135
  • Регистрация: 10 декабря 12

Замени свое на это

Сообщение отредактировал Unknown: 09 мая 2013 — 21:43

Источник

Форум Pawn.Wiki — Воплоти мечту в реальность!: error 033: array must be indexed — Форум Pawn.Wiki — Воплоти мечту в реальность!

  • Pawn скриптинг
  • Первая помощь
  • Проблемы с компилированием
  • Правила форума
  • Просмотр новых публикаций

  • Группа: Активные пользователи
  • Сообщений: 56
  • Регистрация: 20 февраля 15

C:UsersДавидDesktopFire Role PlaygamemodesFire-rp.pwn(1519) : error 033: array must be indexed (variable «inputtext»)
C:UsersДавидDesktopFire Role PlaygamemodesFire-rp.pwn(1551) : error 033: array must be indexed (variable «inputtext»)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Строка 1519 и 1551:

1519: if(inputtext == maill)
1551: if(inputtext == code[playerid])

В общем, делаю систему почты. Так вот. Вылезает Error в диалоге.
1519: Если(то что мы ввели == почта которая у нас), то пошла функция
1551: Если то что мы ввели == переменная code[playerid](Код подтверждения чтобы сменить пароль если забыл)

Подскажите, в чём проблема. Компилятор жалуется только на inputtext.

Источник

Error 033 array must be indexed variable playerinfo

[N][E][M][E][C] писал(а): Игнорируй мой аккаунт вообще, одним словом балобол, есть люди на этом форуме, которых можно выслушать и поучиться.. ну уж точно слушать человека с трех летним стажем и с твоими навыками

Решение ошибок при компиляции

Модератор: Chuvi

  • Список форумовAMX Mod XСтатьи / фрагменты кода

Правила форума
1. Запрещено материться и оскорблять других участников форума.
2. Запрещен флуд, оффтоп, дабл постинг во всех разделах форума, кроме раздела «Болтовня».
3. Запрещено взламывать сайт/форум или наносить любой вред проекту.
4. Запрещено рекламировать другие ресурсы.
5. Запрещено создавать темы без информативного названия. Название темы должно отображать ее смысл.

В данном разделе форума разрешено создавать темы, касающие только обучающему материалу по AMX Mod X.

Решение ошибок при компиляции

DJ_WEST » 25 авг 2009, 10:51

Автор: minimiller
Перевод и редактирование: DJ_WEST

Список ошибок:
Код: Выделить всё
/*001*/ «expected token: »%s», but found »%s»n»,
/*002*/ «only a single statement (or expression) can follow each »case»n»,
/*003*/ «declaration of a local variable must appear in a compound blockn»,
/*004*/ «function »%s» is not implementedn»,
/*005*/ «function may not have argumentsn»,
/*006*/ «must be assigned to an arrayn»,
/*007*/ «operator cannot be redefinedn»,
/*008*/ «must be a constant expression; assumed zeron»,
/*009*/ «invalid array size (negative or zero)n»,
/*010*/ «invalid function or declarationn»,
/*011*/ «invalid outside functionsn»,
/*012*/ «invalid function call, not a valid addressn»,
/*013*/ «no entry point (no public functions)n»,
/*014*/ «invalid statement; not in switchn»,
/*015*/ «»default» case must be the last case in switch statementn»,
/*016*/ «multiple defaults in »switch»n»,
/*017*/ «undefined symbol »%s»n»,
/*018*/ «initialization data exceeds declared sizen»,
/*019*/ «not a label: »%s»n»,
/*020*/ «invalid symbol name »%s»n»,
/*021*/ «symbol already defined: »%s»n»,
/*022*/ «must be lvalue (non-constant)n»,
/*023*/ «array assignment must be simple assignmentn»,
/*024*/ «»break» or »continue» is out of contextn»,
/*025*/ «function heading differs from prototypen»,
/*026*/ «no matching »#if. »n»,
/*027*/ «invalid character constantn»,
/*028*/ «invalid subscript (not an array or too many subscripts): »%s»n»,
/*029*/ «invalid expression, assumed zeron»,
/*030*/ «compound statement not closed at the end of filen»,
/*031*/ «unknown directiven»,
/*032*/ «array index out of bounds (variable »%s»)n»,
/*033*/ «array must be indexed (variable »%s»)n»,
/*034*/ «argument does not have a default value (argument %d)n»,
/*035*/ «argument type mismatch (argument %d)n»,
/*036*/ «empty statementn»,
/*037*/ «invalid string (possibly non-terminated string)n»,
/*038*/ «extra characters on linen»,
/*039*/ «constant symbol has no sizen»,
/*040*/ «duplicate »case» label (value %d)n»,
/*041*/ «invalid ellipsis, array size is not knownn»,
/*042*/ «invalid combination of class specifiersn»,
/*043*/ «character constant exceeds range for packed stringn»,
/*044*/ «positional parameters must precede all named parametersn»,
/*045*/ «too many function argumentsn»,
/*046*/ «unknown array size (variable »%s»)n»,
/*047*/ «array sizes do not match, or destination array is too smalln»,
/*048*/ «array dimensions do not matchn»,
/*049*/ «invalid line continuationn»,
/*050*/ «invalid rangen»,
/*051*/ «invalid subscript, use »[ ]» operators on major dimensionsn»,
/*052*/ «multi-dimensional arrays must be fully initializedn»,
/*053*/ «exceeding maximum number of dimensionsn»,
/*054*/ «unmatched closing bracen»,
/*055*/ «start of function body without function headern»,
/*056*/ «arrays, local variables and function arguments cannot be public (variable »%s»)n»,
/*057*/ «unfinished expression before compiler directiven»,
/*058*/ «duplicate argument; same argument is passed twicen»,
/*059*/ «function argument may not have a default value (variable »%s»)n»,
/*060*/ «multiple »#else» directives between »#if . #endif»n»,
/*061*/ «»#elseif» directive follows an »#else» directiven»,
/*062*/ «number of operands does not fit the operatorn»,
/*063*/ «function result tag of operator »%s» must be »%s»n»,
/*064*/ «cannot change predefined operatorsn»,
/*065*/ «function argument may only have a single tag (argument %d)n»,
/*066*/ «function argument may not be a reference argument or an array (argument »%s»)n»,
/*067*/ «variable cannot be both a reference and an array (variable »%s»)n»,
/*068*/ «invalid rational number precision in #pragman»,
/*069*/ «rational number format already definedn»,
/*070*/ «rational number support was not enabledn»,
/*071*/ «user-defined operator must be declared before use (function »%s»)n»,
/*072*/ «»sizeof» operator is invalid on »function» symbolsn»,
/*073*/ «function argument must be an array (argument »%s»)n»,
/*074*/ «#define pattern must start with an alphabetic charactern»,
/*075*/ «input line too long (after substitutions)n»,
/*076*/ «syntax error in the expression, or invalid function calln»,
/*077*/ «malformed UTF-8 encoding, or corrupted file: %sn»,
/*078*/ «function uses both »return» and »return »n»,
/*079*/ «inconsistent return types (array & non-array)n»,
/*080*/ «unknown symbol, or not a constant symbol (symbol »%s»)n»,
/*081*/ «cannot take a tag as a default value for an indexed array parameter (symbol »%s»)n»,
/*082*/ «user-defined operators and native functions may not have statesn»,
/*083*/ «a function may only belong to a single automaton (symbol »%s»)n»,
/*084*/ «state conflict: one of the states is already assigned to another implementation (symbol »%s»)n»,
/*085*/ «no states are defined for function »%s»n»,
/*086*/ «unknown automaton »%s»n»,
/*087*/ «unknown state »%s» for automaton »%s»n»,
/*088*/ «number of arguments does not match definitionn»

Разбор ошибок
Рассмотрим пример нахождения и самостоятельного решения ошибок при компиляции.
Допустим у нас есть ошибка:

Теперь давайте попытаемся разобрать эту ошибку по частям:
1) C:AMXXexample.sma — это директория, где находится исходник (.sma) нашего плагина.
2) (107) — это номер строки, в которой есть ошибка. Большинство современных редакторов текста имеют панель с пронумерованными строками (Notepad++, AMXX-Studio и другие).
3) error 035 — это код ошибки (список ошибок указан выше).
4) argument type mismatch — это описание ошибки с кодом, указанным до этого. В данном случае нам говорится, что «аргумент имеет неверный тип».
5) (argument 2) — это более подробное описание ошибки. В данном случае нам указывается, что ошибка во 2 аргументе.

Итого, получаем: в файле example.sma, который находится в директории C:AMXX, в строке под номером 107 есть ошибка с кодом 035, которая означает, что аргумент 2 имеет неверный тип данных.

Решение ошибок
Теперь попытаемся исправить нашу ошибку. Идем в строку под номером 107 и видим следующий код:
Код: Выделить всё
client_print ( 0 , «Welcome to the server!» )

client_print — Sends a message to a player.

Syntax:
client_print ( index, type, const message [], . )

id is a player index from 1 to 32. If 0, the message will be sent to all players.

The type is one of three types:
print_chat — chat text
print_console — console message
print_notify — console in dev mode
print_center — center say

Теперь компиляция прошла успешно.

Описание ошибок:
error 001: expected token: «X», but found «Y»
Ошибка означает, что не найден X, когда найден Y. Наиболее часто возникает, когда забывают поставить недостающие знаки ; < >( ).
Пример ошибки:
Код: Выделить всё
public Function ( id )
<
if ( is_user_bot ( id )
return PLUGIN_HANDLED

// код

return PLUGIN_CONTINUE
>

error 017: undefined symbol «X»
Ошибка означает, что X — неизвестный сивол/команда/переменная/функция. Поэтому такую функцию или переменную нужно объявить перед использованием. Например, функция is_user_hacker не существует.
Пример ошибки:
Код: Выделить всё
public Function ( id )
<
if ( is_user_hacker ( id ))
return PLUGIN_HANDLED

// код

return PLUGIN_CONTINUE
>

error 032: array index out of bounds (variable X)
Ошибка означает, что в мы вышли за предел размера массива X.
Пример ошибки:
Код: Выделить всё
new s_Name [ 32 ]
s_Name [ 33 ] = «*»

error 033: array must be indexed (variable X)
Ошибка означает, что массив должен быть проиндексирован. Например, мы не указали размер массива при его объявлении.
Пример ошибки:
Код: Выделить всё
new s_String = «My string»

error 035: argument type mismatch (argument X)
Ошибка означает, что аргумент X имеет неверный тип данных. Например, когда вместо целочисленного аргумента передаем строку.
Пример ошибки:
Код: Выделить всё
public Function1 ( id )
<
Function2 ( id , «10» )
>

public Function2 ( id , count )
<
// код
>

error 040: duplicate «case» label (value X)
Ошибка означает, что имеется дубль оператора case со значением X.
Пример ошибки:
Код: Выделить всё
public Function ( id )
<
switch ( count )
<
case 1 : count += 1
case 2 : count += 2
case 2 : count += 3
>
>

error 075: input line too long (after substitutions)
Ошибка означает, что указанная строка слишком длинная. Например, около 500 символов.
Пример ошибки:
Код: Выделить всё
public Function ( id )
<
server_print ( «AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA» )
>

error 078: function uses both «return» and «return »
Ошибка означает, что функция использует, как return, так и return .
Пример ошибки:
Код: Выделить всё
public Function ( id )
<
if ( is_user_alive ( id ))
return

error 088: number of arguments does not match definition
Ошибка означает, что количество переданных аргументов не соответсвует количеству объявленных аргументов.
Пример ошибки:
Код: Выделить всё
public Function1 ( id )
<
Function2 ( id )
>

public Function2 ( id , count )
<
// код
>

Источник

Форум Pawn.Wiki — Воплоти мечту в реальность!: Помогите если не сложно — Форум Pawn.Wiki — Воплоти мечту в реальность!

  • Pawn скриптинг
  • Первая помощь
  • Проблемы с компилированием
  • Правила форума
  • Просмотр новых публикаций
  • (2 Страниц)
  • 1
  • 2
  • >
  • Вы не можете создать новую тему
  • Тема закрыта

  • Группа: Активные пользователи
  • Сообщений: 206
  • Регистрация: 22 мая 12

  • Группа: Пользователи
  • Сообщений: 4
  • Регистрация: 03 июля 12

Сообщение отредактировал NeWeR: 04 августа 2012 — 23:21

  • Группа: Активные пользователи
  • Сообщений: 206
  • Регистрация: 22 мая 12

NeWeR (04 августа 2012 — 23:17) писал:

Сделал и теперь

Если в OnPlayerSpawn пишу SpawnChange то Ошибки такие

Если пишу if(PlayerInfo[playerid]) то так

Сообщение отредактировал Vlad72KPD: 05 августа 2012 — 00:27

Источник

Спойлер

C:UsersGazetaDesktopstelgamemodesstel.pwn(27773) : error 032: array index out of bounds (variable «logotype»)
C:UsersGazetaDesktopstelgamemodesstel.pwn(27774) : error 032: array index out of bounds (variable «logotype»)
C:UsersGazetaDesktopstelgamemodesstel.pwn(27775) : error 032: array index out of bounds (variable «logotype»)
C:UsersGazetaDesktopstelgamemodesstel.pwn(27776) : error 032: array index out of bounds (variable «logotype»)
C:UsersGazetaDesktopstelgamemodesstel.pwn(27777) : error 032: array index out of bounds (variable «logotype»)
C:UsersGazetaDesktopstelgamemodesstel.pwn(27778) : error 032: array index out of bounds (variable «logotype»)
C:UsersGazetaDesktopstelgamemodesstel.pwn(27779) : error 032: array index out of bounds (variable «logotype»)
C:UsersGazetaDesktopstelgamemodesstel.pwn(27780) : error 032: array index out of bounds (variable «logotype»)
C:UsersGazetaDesktopstelgamemodesstel.pwn(27781) : error 032: array index out of bounds (variable «logotype»)
C:UsersGazetaDesktopstelgamemodesstel.pwn(27782) : error 032: array index out of bounds (variable «logotype»)
Pawn compiler 3.2.3664              Copyright (c) 1997-2016, ITB CompuPhase


10 Errors.

Спойлер

    logotype[3] = TextDrawCreate(621.000000, 43.188892, «usebox»);
    TextDrawLetterSize(logotype[3], 0.000000, -0.593210);
    TextDrawTextSize(logotype[3], 543.500000, 0.000000);
    TextDrawAlignment(logotype[3], 1);
    TextDrawColor(logotype[3], 0);
    TextDrawUseBox(logotype[3], true);
    TextDrawBoxColor(logotype[3], 102);
    TextDrawSetShadow(logotype[3], 0);
    TextDrawSetOutline(logotype[3], 0);
    TextDrawFont(logotype[3], 0);

Все, сделал сам, в new logotype сделал 4 а не 3 .

Author

Message

Squirrel of Fortune

Mordekay's Avatar

Join Date: Apr 2006

Location: Germany

Old

01-03-2019

, 04:42

 

error 032: array index out of bounds (variable «color3»)

Reply With Quote

#1


I’m trying to compile the amxx plugin against amxx 1.9 and this is the error message I get:

Code:

AMX Mod X Compiler 1.9.0.5235
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team

Header size:           2800 bytes
Code size:            29328 bytes
Data size:            50832 bytes
Stack/heap size:      16384 bytes
Total requirements:   99344 bytes
Done.
AMX Mod X Compiler 1.9.0.5235
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team

hlstatsx_commands_cstrike.sma(865) : error 032: array index out of bounds (variable "color3")
hlstatsx_commands_cstrike.sma(926) : error 032: array index out of bounds (variable "color3")

2 Errors.
Could not locate output file compiled/hlstatsx_commands_cstrike.amx (compile failed).

How to fix this?

__________________



Last edited by Mordekay; 01-06-2019 at 09:35.

Mordekay is offline

AlliedModders Donor

NomisCZ's Avatar

Join Date: Mar 2014

Location: Czech_Republic

NomisCZ is offline

Squirrel of Fortune

Mordekay's Avatar

Join Date: Apr 2006

Location: Germany

Old

01-03-2019

, 05:56

 

Re: error 032: array index out of bounds (variable «color3»)

Reply With Quote

#3


This section is for everything related to hlxstats, so i’m in the correct section.

__________________


Mordekay is offline

AlliedModders Donor

NomisCZ's Avatar

Join Date: Mar 2014

Location: Czech_Republic

Old

01-04-2019

, 09:40

 

Re: error 032: array index out of bounds (variable «color3»)

Reply With Quote

#4


Maybe there is a problem with array declaration. In Pawn documentation is example:

PHP Code:



new Numbers[4] = {0,1,2,3}
So new color3[0][] = {255255255is probably wrong




Try to rewrite line 862 to:

PHP Code:



new color3[3] = {255255255}; 




and line 865 to:

PHP Code:



set_hudmessage(color3[0], color3[1], color3[2], -1.0verpos06.06.00.50.15, -1




PHP Code:



public hlx_amx_csay(idlevelcid)
{
    if (!
cmd_access(idlevelcid2))
        return 
PLUGIN_HANDLEDstatic message[192]
    
read_args(message191)
    
remove_quotes(message)

        new 

color3[3] = {255255255}
    new 
Float:verpos 0.3

        set_hudmessage

(color3[0], color3[1], color3[2], -1.0verpos06.06.00.50.15, -1)
    
show_hudmessage(0"%s"message)

    return 

PLUGIN_HANDLED





__________________


Last edited by NomisCZ; 01-04-2019 at 09:42.

NomisCZ is offline

Squirrel of Fortune

Mordekay's Avatar

Join Date: Apr 2006

Location: Germany

Old

01-04-2019

, 18:23

 

Re: error 032: array index out of bounds (variable «color3»)

Reply With Quote

#5


Still does not compile:

Code:

AMX Mod X Compiler 1.9.0.5235
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team

hlstatsx_commands_cstrike.sma(926) : error 032: array index out of bounds (variable "color3")

1 Error.
Could not locate output file compiled/hlstatsx_commands_cstrike.amx (compile failed).

__________________


Mordekay is offline

Veteran Member

iceeedr's Avatar

Join Date: Apr 2017

Location: Brazil

Old

01-05-2019

, 20:20

 

Re: error 032: array index out of bounds (variable «color3»)

Reply With Quote

#6


Code:

new color3[0][] = {255, 255, 255}

to

Code:

new color3[3] = {255, 255, 255}

Then on code use color3[0], color3[1], color3[2]

Or if you’re out of patience, change color3 [] [] by, 255, 255, 255 manually.

__________________

Quote:

Originally Posted by fysiks
View Post

Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.

https://iceeedr.com.br/


Last edited by iceeedr; 01-05-2019 at 20:25.

iceeedr is offline

Send a message via Skype™ to iceeedr

Squirrel of Fortune

Mordekay's Avatar

Join Date: Apr 2006

Location: Germany

Old

01-06-2019

, 04:35

 

Re: error 032: array index out of bounds (variable «color3»)

Reply With Quote

#7


Sorry, i’m not out of patience, but i have no idea what you are talking about as i have no idea about scripting at all.
I have replaced the line you posted and tried to compile, it failed. Then i changed the line

Code:

set_hudmessage(color3[0][0], color3[0][1], color3[0][2], -1.0, verpos, 0, 6.0, 6.0, 0.5, 0.15, -1)

to

Code:

set_hudmessage(color3[[0], color3[1], color3[2], -1.0, verpos, 0, 6.0, 6.0, 0.5, 0.15, -1)

which gives me this

Code:

AMX Mod X Compiler 1.9.0.5235
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team

hlstatsx_commands_cstrike.sma(926) : error 032: array index out of bounds (variable "color3")

1 Error.
Could not locate output file compiled/hlstatsx_commands_cstrike.amx (compile failed).

As said: I have no idea about coding, so a complete list of lines and how to change them is needed and greatly appreciated.

__________________


Mordekay is offline

Veteran Member

fysiks's Avatar

Join Date: Sep 2007

Location: Flatland, USA

Old

01-06-2019

, 04:51

 

Re: error 032: array index out of bounds (variable «color3»)

Reply With Quote

#8


The problem seems to be that the original color3 array is declared with a size of zero (i.e. it doesn’t exist) which apparently is fixed by the older compiler.

Since you don’t know about coding, the easiest way to fix this is to go back to the original and change this:

to this:

Note that this part was poorly coded originally and there is a better solution but since you’re unfamiliar with coding this should be the easiest change for you to make and it should function correctly.

P.S. I have not tested with the AMX Mod X 1.9.0 compiler since I’m not using that version.

__________________


Last edited by fysiks; 01-06-2019 at 04:53.

fysiks is offline

Squirrel of Fortune

Mordekay's Avatar

Join Date: Apr 2006

Location: Germany

Old

01-06-2019

, 05:05

 

Re: error 032: array index out of bounds (variable «color3»)

Reply With Quote

#9


If i change it like this in the original .sma I got this:

Code:

AMX Mod X Compiler 1.9.0.5235
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team

hlstatsx_commands_cstrike.sma(862) : error 018: initialization data exceeds declared size
hlstatsx_commands_cstrike.sma(862) : warning 215: expression has no effect
hlstatsx_commands_cstrike.sma(862) : warning 215: expression has no effect
hlstatsx_commands_cstrike.sma(862) : error 001: expected token: ";", but found "}"
hlstatsx_commands_cstrike.sma(862) : warning 209: function "hlx_amx_csay" should return a value
hlstatsx_commands_cstrike.sma(865) : error 021: symbol already defined: "set_hudmessage"
hlstatsx_commands_cstrike.sma(868) : error 010: invalid function or declaration
hlstatsx_commands_cstrike.sma(926) : error 032: array index out of bounds (variable "color3")
hlstatsx_commands_cstrike.sma(865) : warning 203: symbol is never used: "verpos"

5 Errors.
Could not locate output file compiled/hlstatsx_commands_cstrike.amx (compile failed).

__________________



Last edited by Mordekay; 01-06-2019 at 05:12.

Mordekay is offline

AMX Mod X Plugin Approver

HamletEagle's Avatar

Join Date: Sep 2013

Location: Romania

Old

01-06-2019

, 06:35

 

Re: error 032: array index out of bounds (variable «color3»)

Reply With Quote

#10


__________________

HamletEagle is offline

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Error 0308010c digital envelope routines unsupported windows
  • Error 0308010c digital envelope routines unsupported vue
  • Error 0308010c digital envelope routines unsupported react
  • Error 0306 sharp
  • Error 030 compound statement not closed at the end of file

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии