Ошибка warning 203 symbol is never used

Уверен вам пригодится :P

[Waring]
%s- переменная

Переменная — это хранилище данных, куда мы можем записывать
различные данные для их последующего вызова. Тоесть действия с переменными предельно просты: запись информации,вывод и
использование информации. Если присмотрется ближе, то список можно пополнить еще одним пунктом — объявление переменной.
Каждая переменная имеет свое название, чтобы компилятор мог отличить друг от друга переменные, название мы задаем при
объявлении. Оператор объявления переменной — new

1)
PHP код:

warning 219: local variable "%s" shadows a variable at a preceding level  

Это значит что переменная дважды объявлена.
Пример:
PHP код:

new neka;
new neka

;
Что же нам делать, а вот что:
1) мы можем одну из них удалить;
2) можем изменить;

Но не стоит забывать что при изменении переменной нам нужно заменить все что её касается
вот пример правильного изменения:
PHP код:

 new neka1;
    neka1 = CreatePickup(1239, 2, 1380.3220,-1771.3235,13.5469); 

2)
PHP код:

warning 217: loose indentation

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

PHP код:

stock LSNews(color,const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++){
if(IsPlayerConnected(i)){
if(!lNews[i]){
SendClientMessage(i, color, string);}}}}

пример правильного табулирования

PHP код:

stock LSNews(color,const string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(!lNews[i])
            {
                SendClientMessage(i, color, string);
            }
        }
    }
}  

Что же делать? ответ прост
1) мы можем делать все вручную
2) можем поставить

#pragma tabsize 0

3) можем с помощи notepad++ все исправить (на форуме есть урок)

pragma tabsize — Он просто маскирует эти warning и не более

3)
PHP код:

warning 235: public function lacks forward declaration %s

Это означает что у функции нету forward
Пример:
Вы создали паблик
PHP код:

public lol()

И увас появляется этот варинг что же делать?
ответ прост
добавляем forward
PHP код:

forward lol();
public lol()  

если вы не хотите каждый раз писать forward то можно сделать так:
PHP код:

#define public:%1(%2) forward %1(%2);
public %1(%2) 

и тогда новые паблики мы пишем так
PHP код:

public:lol()

4)
PHP код:

warning 216: nested comment ;

Вот так это выглядит
PHP код:

/*case 458: //Fire&lvl  
исправление 
PHP код:
case 458: //Fire&lvl 

5)
PHP код:

warning 213: tag mismatch 

Это означает не совпадения аргументов
вот допустим самый простой случай:

PHP код:

#define CreateObject CreateDynamicObject
#define MoveObject MoveDynamicObject

решение простое

PHP код:

#define CreateObject, CreateDynamicObject
#define MoveObject,  MoveDynamicObject  

6)
PHP код:

warning 201: redefinition of constant/macro

Это означает что в дефайнах(define)
Пример:
PHP код:

#define OnPlayerEnterRaceCheckpoint
#define OnPlayerEnterRaceCheckpoint

Решение одну из двух удалить!
7)

PHP код:

warning 200: symbol "%s" is truncated to 31 characters

Это обозначает что мы при создании переменной ввели больше 31 символа
Пример:
PHP код:

new sssssssssssssssssssssssssssssss; 

Решение:
Просто сменить название или укоротить !
8)

PHP код:

warning 202: number of arguments does not match definition

Это значит что у нас не совпадают аргументы
Возьмем самый простой пример:
PHP код:

Create3DTextLabel(" ТУт типо текст .",0xFFA500FF,.0120,456.2717,35.1719,20.0); 

Наша ошибка содержится здесь:
PHP код:

-2041.0120,456.2717,35.1719,20.0  
-2041.0120,456.2717,35.1719--------- это на ша координата (она нас не интересует)
20.0--------вот наша ошибка (20----это расстояние с которого наш текст будет виден)
а вот 0 это у нас testLOS- линия видимости 

решение простое:
Нам 0 нужно заменить на 1
PHP код:

Create3DTextLabel(" ТУт типо текст .",0xFFA500FF,1111.1111,111.1111,11.1111,20.1);

9)

PHP код:

warning 203: symbol is never used: %s

Это означает что данный символ нигде не используется
Пример :
Создадим допустим переменную

new respon;

И тут у нас возникает
PHP код:

(1578) warning 203: symbol is never used: "respon"

Что же делать?
Ответ прост:
найти эту переменную и удалить

10)
PHP код:

warning 204: symbol is assigned a value that is never used %s

Это значит что создали переменную и массив а он негде не используется
Пример:
PHP код:

new blabal[15]; 

Решения: просто удалить

11)
PHP код:

warning 209: function "%s" should return a value 

Это значит что наша функция не возвращается(простыми словами нету return 1; или return 0
пример:

PHP код:

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) 
{ 
   if (newkeys == 1024) 
   { 
   OnPlayerCommandText(playerid,"/Blablabal"); 
   return 1; <========Вот наш return  ДО
   } 
}  

Решения:
PHP код:

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
   if (newkeys == 1024)
   {
   OnPlayerCommandText(playerid,"/Blablabal");
   }
   return 1; <========Вот наш return ПОСЛЕ
}  

[Error]

1)
PHP код:

error 040: duplicate "case" label (value 28) 

это означает что case стаким значением повторяется
Решение этой проблемы простое
PHP код:

case 28:
case 28: 

нам нужно цифру 28 изменит на другую (в той строчке на которую жалуется )

2)
PHP код:

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

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

new JoinPed[131][1] = {

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

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

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

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

3)
PHP код:

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

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

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

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

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

4)
PHP код:

error 001: expected token: ",", but found ";"

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

PHP код:

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;
}  

смотрим на
PHP код:

ProdyktsInfo[idx][prZamProd];

и вим что мы пропустили )
и так оно выглядит
PHP код:

ProdyktsInfo[idx][prZamProd]);

PHP код:

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;
}  

5)

PHP код:

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

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

 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 как и последующий диалог !

PHP код:

case 7504:  <------------------- вот так это выглядит
    { 
        if(response) 
        { 
              SetCameraBehindPlayer(playerid); TogglePlayerControllable(playerid, 1); 
              SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]); 
              ClothesRun[playerid] = 0; 
            return 1; 
        }  

6)
PHP код:

error 004: function "%s" is not implemented 

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

7)
PHP код:

error 017: undefined symbol %s

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

error 017: undefined symbol "lol"

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

new lol;

Ошибка: error 001: expected token: «;», but found «бла-бла»

Решение: Идём на строку выше той, что указана в ошибке и ставим в конце ; (точку с запятой).

Ошибка: error 021: symbol already defined: «бла-бла» или warning 219: local variable «бла-бла» shadows a variable at a preceding level

Решение: Ошибка появляется, если вы несколько раз создали одну и ту же переменную,stock,public.Для решения вам просто требуется удалить дубликат.

Ошибка: error 024: «break» or «continue» is out of context

Решение: break,continue используется только в цикле (for), данная ошибка появляется, если вы использовали их не в цикле. Для решения вам нужно просто заменить их.

Ошибка: error 032: array index out of bounds (variable «cartek»)

Решение: Ошибка появляется, если у вас превышен индекс массива. Для решение вам просто надо увеличить ‘число’ в создании массива.

Ошибка: error 040: duplicate «case» label (value %d)

Решение: Ошибка появляется, если вы два раза используете case с одним и тем же параметром.

 

Ошибка: fatal error 100: cannot read from file: «бла-бла»

Решение: Ошибка появляется, если вы подключили инклуд и не добавили в папку pawno/include. Для решения вам просто надо добавить в папку данный инклуд.

Ошибка: warning 203: symbol is never used: «бла-бла»

Решение: Ошибка появляется, если созданная переменная нигде не используется. Для решения вам просто требуются ещё удалить.

Ошибка: warning 209: function «бла-бла» should return a value

Решение: Для решения проблемы в данной функции/команде вам следует добавить в конец return true/return false.

Ошибка: warning 217: loose indentation

Решение: Для решения проблемы выровняйте строки.

Ошибка: warning 235: public function lacks forward declaration (symbol «бла-бла»)

Решение: Ошибка появляется, если вы создали public,а forward нет. Для решения вам просто надо создать forward к public’y.

По мере возможности тема будет дополняться

C:UsersÐîìàDesktopGREAT RPGREAT RPgamemodesG-RP.pwn(19074) : warning 203: symbol is never used: "log"
C:UsersÐîìàDesktopGREAT RPGREAT RPgamemodesG-RP.pwn(28158) : warning 203: symbol is never used: "AliansPick"
C:UsersÐîìàDesktopGREAT RPGREAT RPgamemodesG-RP.pwn(28158) : warning 203: symbol is never used: "ArmyPickMet"
C:UsersÐîìàDesktopGREAT RPGREAT RPgamemodesG-RP.pwn(28158) : warning 203: symbol is never used: "EatPickup"
C:UsersÐîìàDesktopGREAT RPGREAT RPgamemodesG-RP.pwn(28158) : warning 203: symbol is never used: "FLAT"
C:UsersÐîìàDesktopGREAT RPGREAT RPgamemodesG-RP.pwn(6033) : warning 204: symbol is assigned a value that is never used: "FinePick"
C:UsersÐîìàDesktopGREAT RPGREAT RPgamemodesG-RP.pwn(6033 -- 28158) : warning 203: symbol is never used: "FlatIcon"
C:UsersÐîìàDesktopGREAT RPGREAT RPgamemodesG-RP.pwn(6033 -- 28158) : warning 203: symbol is never used: "FlatsInt"
C:UsersÐîìàDesktopGREAT RPGREAT RPgamemodesG-RP.pwn(6033 -- 28158) : warning 203: symbol is never used: "GatePOS"
C:UsersÐîìàDesktopGREAT RPGREAT RPgamemodesG-RP.pwn(6033 -- 28158) : warning 203: symbol is never used: "JobDrovosek"
C:UsersÐîìàDesktopGREAT RPGREAT RPgamemodesG-RP.pwn(6033 -- 28158) : warning 203: symbol is never used: "LCNPickup"
C:UsersÐîìàDesktopGREAT RPGREAT RPgamemodesG-RP.pwn(6033 -- 28158) : warning 203: symbol is never used: "LIFTTEXT"
C:UsersÐîìàDesktopGREAT RPGREAT RPgamemodesG-RP.pwn(6111) : warning 204: symbol is assigned a value that is never used: "PASSPORT"
C:UsersÐîìàDesktopGREAT RPGREAT RPgamemodesG-RP.pwn(6111 -- 28158) : warning 203: symbol is never used: "SHPICK"
C:UsersÐîìàDesktopGREAT RPGREAT RPgamemodesG-RP.pwn(6111 -- 28158) : warning 203: symbol is never used: "SinPick"
C:UsersÐîìàDesktopGREAT RPGREAT RPgamemodesG-RP.pwn(6111 -- 28158) : warning 203: symbol is never used: "TrailerPick"
C:UsersÐîìàDesktopGREAT RPGREAT RPgamemodesG-RP.pwn(6111 -- 28158) : warning 203: symbol is never used: "bizstr"
C:UsersÐîìàDesktopGREAT RPGREAT RPgamemodesG-RP.pwn(6111 -- 28158) : warning 203: symbol is never used: "minecars"
C:UsersÐîìàDesktopGREAT RPGREAT RPgamemodesG-RP.pwn(6111 -- 28158) : warning 203: symbol is never used: "parkingpick"

Дело в том что этих строк нету в моде

YSI_NO_HEAP_MALLOC

In almost all cases of issues, the solution is to define YSI_NO_HEAP_MALLOC. So why is this not the default? Simply because many people complained about the alternative. With YSI_NO_HEAP_MALLOC your AMX is much larger because the allocation pool is embedded in the file. But if you are having problems that’s just the price you need to pay.

Issues

I keep running out of memory.

First, ensure you are freeing the memory when you are finished with it. Failure to do this will result in a «memory leak». If you are sure you are doing that, you might need a bigger pool of memory for y_malloc to use. This is done with MALLOC_MEMORY:

#define MALLOC_MEMORY (32768)
#include <YSI_Codingy_malloc>

My mode just stops working after several restarts.

This is a known issue with the heap allocation version of y_malloc. To fix it, use the non-heap version by doing:

#define YSI_NO_HEAP_MALLOC
#include <YSI_Codingy_malloc>

This will make your mode larger (because the allocation pool is now included in the mode), but more stable.

Errors

error 017: undefined symbol "_is_now_DYNAMIC_MEMORY_"

This will occur on:

The error tries to explain the problem. y_malloc can allocate memory from the heap or from global memory. If you are not using YSI_NO_HEAP_MALLOC it will use the heap (obviously), aka. dynamic memory. Because of this, it needs to control how much dynamic memory there is. Thus, instead of using #pragma dynamic, use DYNAMIC_MEMORY:

#define DYNAMIC_MEMORY (65536)
#include <YSI_Codingy_malloc>

warning 203: symbol is never used: "dynamic_is_now_DYNAMIC_MEMORY_"

This happens when you have a variable or function called dynamic that isn’t used. Because of the way y_malloc overrides #pragma dynamic, ALL instances of dynamic are replaced. So this:

Becomes:

MyFunc(dynamic_is_now_DYNAMIC_MEMORY_)
{
}

In most cases this ins’t actually a problem — the variable declaration will be replaced, but so will all the uses, so they will still refer to the correct variable. Note that this only happens without YSI_NO_HEAP_MALLOC.

error 017: undefined symbol "dynamic_is_now_DYNAMIC_MEMORY_"

This is similar to the last warning, but when not all instances of dynamic have been replaced. This only happens when some come before including y_malloc and some come after:

dynamic() // Not replaced.
{
	printf("hi");
}

#include <YSI_Codingy_malloc>

main()
{
	dynamic(); // Replaced.
}

To fix, use YSI_NO_HEAP_MALLOC or move the offending function:

#include <YSI_Codingy_malloc>

dynamic() // Not replaced.
{
	printf("hi");
}

main()
{
	dynamic(); // Replaced.
}

*** YSI Error: y_malloc with JIT requires "#define YSI_NO_HEAP_MALLOC"

Full message:

*** YSI Error: y_malloc with JIT requires "#define YSI_NO_HEAP_MALLOC"
*** YSI Warning: JIT disabled
[jit] Compilation was disabled

The heap allocation method relies on a small bug in the PAWN VM (virtual machine). This bug doesn’t exist in the JIT VM, so that method can’t be used with the JIT plugin. If you compile y_malloc for heap allocation and try use the JIT it can’t work, and will fall back on the original VM. To use JIT, compile with YSI_NO_HEAP_MALLOC:

#define YSI_NO_HEAP_MALLOC
#include <YSI_Codingy_malloc>

From SA-MP Wiki

Jump to: navigation, search

Contents

  • 1 General Pawn Error List
  • 2 Error categories
    • 2.1 Errors
    • 2.2 Fatal errors
    • 2.3 Warnings
  • 3 Common Errors
    • 3.1 001: expected token
    • 3.2 002: only a single statement (or expression) can follow each “case”
    • 3.3 004: function «x» is not implemented
    • 3.4 025: function heading differs from prototype
    • 3.5 035: argument type mismatch (argument x)
    • 3.6 036: empty statement
    • 3.7 046: unknown array size (variable x)
    • 3.8 047: array sizes do not match, or destination array is too small
    • 3.9 055: start of function body without function header
  • 4 Common Fatal Errors
    • 4.1 100: cannot read from file: «<file>»
  • 5 Common Warnings
    • 5.1 202: number of arguments does not match definition
    • 5.2 203: symbol is never used: «symbol»
    • 5.3 204: symbol is assigned a value that is never used: «symbol»
    • 5.4 209: function should return a value
    • 5.5 211: possibly unintended assignment
    • 5.6 213: tag mismatch
    • 5.7 217: loose indentation
    • 5.8 219: local variable «foo» shadows a variable at a preceding level
    • 5.9 225: unreachable code
    • 5.10 235: public function lacks forward declaration (symbol «symbol»)
  • 6 External Links

General Pawn Error List

This pages contains the most common errors and warnings produced by the pawn compiler when creating SA:MP scripts.

When the compiler finds an error in a file, it outputs a message giving, in this order:

  • the name of the file
  • the line number were the compiler detected the error between parentheses, directly behind the filename
  • the error class (error, fatal error or warning)
  • an error number
  • a descriptive error message

For example:

hello.pwn(3) : error 001: expected token: ";", but found "{"

Note: The error may be on the line ABOVE the line that is shown, since the compiler cannot always establish an error before having analyzed the complete expression.

Error categories

Errors are separated into three classes:

Errors

  • Describe situations where the compiler is unable to generate appropriate code.
  • Errors messages are numbered from 1 to 99.

Fatal errors

  • Fatal errors describe errors from which the compiler cannot recover.
  • Parsing is aborted.
  • Fatal error messages are numbered from 100 to 199.

Warnings

  • Warnings are displayed for unintended compiler assumptions and common mistakes.
  • Warning messages are numbered from 200 to 299.

Common Errors

001: expected token

A required token is missing.

Example:

error 001: expected token: ";", but found "return"
main()
{
    print("test") // This line is missing a semi-colon. That is the token it is expecting.
    return 1; // The error states that it found "return", this is this line it is referring to,
    // as it is after the point at which the missing token (in this case the semi-colon) should be.
}

002: only a single statement (or expression) can follow each “case”

Every case in a switch statement can hold exactly one statement.
To put multiple statements in a case, enclose these statements
between braces (which creates a compound statement).

Example:

error 002: only a single statement (or expression) can follow each "case"
main()
{
    switch(x)
    {
        case 0: print("hello"); print("hello");
    }
    return 1;
}

The above code also produces other warnings/errors:

error 002: only a single statement (or expression) can follow each "case"
warning 215: expression has no effect
error 010: invalid function or declaration

Fixed:

main()
{
    switch(x)
    {
        case 0:
        {
            print("hello");
            print("hello");
        }
    }
    return 1;
}

004: function «x» is not implemented

Most often caused by a missing brace in the function above.

025: function heading differs from prototype

This usually happen when new sa-mp version comes with new addition of argument to a function, like OnPlayerGiveDamage from 0.3x to 0.3z. The scripter must add «bodypart» argument to OnPlayerGiveDamage callback on their script.

Caused by either the number of arguments or the argument name is different.

Example:

forward MyFunction(playerid);
 
public MyFunction(player, vehicleid)

Fixed:

forward MyFunction(playerid, vehicleid);
 
public MyFunction(playerid, vehicleid)

035: argument type mismatch (argument x)

An argument passed to a function is of the wrong ‘type’.
For example, passing a string where you should be passing an integer.

Example:

error 035: argument type mismatch (argument 1)
Kick("playerid"); // We are passing a STRING, we should be passing an INTEGER

Fixed:

Kick(playerid);

036: empty statement

Caused by a rogue semicolon (;), usually inadvertently placed behind an if-statement.

046: unknown array size (variable x)

For array assignment, the size of both arrays must be explicitly defined, also if they are passed as function arguments.

Example:

new string[];
string = "hello";

Fixed:

new string[6];
string = "hello";

047: array sizes do not match, or destination array is too small

For array assignment, the arrays on the left and the right side of the
assignment operator must have the same number of dimensions.
In addition:

  • for multi-dimensional arrays, both arrays must have the same size;
  • for single arrays with a single dimension, the array on the left side of the assignment operator must have a size that is equal or bigger than the one on the right side.
new destination[8];
new msg[] = "Hello World!";
 
destination = msg;

In the above code, we try to fit 12 characters in an array that can only support 8. By increasing the array size of the destination, we can solve this. Note that a string also requires a null terminator so the total length of «Hello World!» plus the null terminator is, in fact, 13.

new destination[13];
new msg[] = "Hello World!";
 
destination = msg;

055: start of function body without function header

This error usually indicates an erroneously placed semicolon at the end of the function header.

Common Fatal Errors

100: cannot read from file: «<file>»

The compiler cannot find, or read from, the specified file. Make sure that the file you are trying to include is in the proper directory (default: <server directory>pawnoinclude).

Tip

Image:Light_bulb_icon.png

Multiple copies of pawno can lead to this problem. If this is the case, don’t double click on a .pwn file to open it. Open your editor first, then open the file through the editor.

Common Warnings

202: number of arguments does not match definition

The description of this warning is pretty self-explanatory. You’ve passed either too few or too many parameters to a function. This is usually an indication that the function is used incorrectly. Refer to the documentation to figure out the correct usage of the function.

This usually happen on GetPlayerHealth function with PAWNO function auto completion as it confuses with the NPC GetPlayerHealth function that only has ‘playerid’ argument.

Example:

GetPlayerHealth(playerid);

Fixed:

new Float:health;
GetPlayerHealth(playerid, health);

203: symbol is never used: «symbol»

You have created a variable or a function, but you’re not using it. Delete the variable or function if you don’t intend to use it. This warning is relatively safe to ignore.

The stock keyword will prevent this warning from being shown, as variables/functions with the stock keyword are not compiled unless they are used.

stock SomeFunction()
{
    // Blah
}
 
// There will be no warning if this function is never used

204: symbol is assigned a value that is never used: «symbol»

Similar to the previous warning. You created a variable and assigned it a value, but you’re not using that value anywhere. Use the variable, or delete it. This warning, too, is relatively safe to ignore.

209: function should return a value

You have created a function without a return value

SomeFunction()
{
     // Blah
}

but you used it to assign on variable or function argument,

new result = SomeFunction(); // expected value = 1

Fixed:

SomeFunction()
{
     // Blah
     return 1;
}

211: possibly unintended assignment

The assignment operator (=) was found in an if-statement, instead of the equality operator (==). If the assignment is intended, the expression must be wrapped in parentheses. Example:

if(vehicle = GetPlayerVehicleID(playerid)) // warning
if(vehicle == GetPlayerVehicleID(playerid)) // no warning
if((vehicle = GetPlayerVehicleID(playerid))) // no warning; the value returned by the function will be assigned to the variable and the expression is then evaluated.

213: tag mismatch

A tag mismatch occurs when:

  • Assigning to a tagged variable a value that is untagged or that has a different tag
  • The expressions on either side of a binary operator have different tags
  • In a function call, passing an argument that is untagged or that has a different tag than what the function argument was defined with
  • Indexing an array which requires a tagged index with no tag or a wrong tag name

Usually happen on a new variable created with missing tag on the required function such as Float:, Text3D:, Text:, etc. Example,

Bad:

new health;
GetPlayerHealth(playerid, health);

Good:

new Float:health;
GetPlayerHealth(playerid, health);

217: loose indentation

The compiler will issue this warning if the code indentation is ‘loose’, example:

Good:

if(condition)
{
    action();
    result();
}

Bad:

if(condition)
{
    action();
  result();
}

Indentation means to push (indent) text along from the left of the page (by pressing the TAB key). This is common practice in programming to make code easier to read.
This warning also exists to avoid dangling-else problem.

219: local variable «foo» shadows a variable at a preceding level

A local variable, i.e. a variable that is created within a function or callback, cannot have the same name as a global variable, an enum specifier, a function, or a variable declared higher up in the same function. The compiler cannot tell which variable you’re trying to alter.

It is customary to prefix global variables with ‘g’ (e.g. gTeam). However, global variables should be avoided where possible.

new team[MAX_PLAYERS]; // variable declared in the global scape
 
function(playerid)
{
    new team[MAX_PLAYERS]; // declared in the local scope, shadows the variable in the global scope, warning 219
    team[playerid] = random(5); // which variable are we trying to update here?
}

225: unreachable code

The indicated code will never run, because an instruction before (above) it causes a jump out of the function, out of a loop or elsewhere. Look for return, break, continue and goto instructions above the indicated line. Unreachable code can also be caused by an endless loop above the indicated line.

Example:

CMD:jetpack(playerid, params[])
{
	#pragma unused params
	if(IsPlayerAdmin(playerid))
	{
	    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
	    return 1; // jumps out the command
	}
	else
	{
	    SendClientMessage(playerid, -1, "You are not admin!");
	    return 1; // jumps out the command
	}
	SendClientMessage(playerid, -1, "You typed command /jp"); // this code is not reachable and will not run.
}

Fixed:

CMD:jetpack(playerid, params[])
{
	#pragma unused params
	if(IsPlayerAdmin(playerid))
	{
	    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
	}
	else
	{
	    SendClientMessage(playerid, -1, "You are not admin!");
	}
	SendClientMessage(playerid, -1, "You typed command /jp"); // this code will run.
	return 1; // jumps out the command
}

235: public function lacks forward declaration (symbol «symbol»)

Your public function is missing a forward declaration.

Bad:

public MyFunction()
{
    // blah
}

Good:

forward MyFunction();
 
public MyFunction()
{
    // blah
}

External Links

  • pawn-lang.pdf

  • Ошибка wargaming net error monitor
  • Ошибка w12 на частотнике овен
  • Ошибка wargaming error monitor как исправить
  • Ошибка w12 на частотнике данфос
  • Ошибка war thunder crash report что делать