Error 035 pawn

Список часто встречаемых ошибок в pawno Данная тема содержет наиболее распространенные ошибки и предупреждения в pawno при создании скриптов sa-mp К...

Список часто встречаемых ошибок в pawno

Данная тема содержет наиболее распространенные ошибки и предупреждения в pawno при создании скриптов sa-mp
Когда компилятор находит ошибку в файле, то выводится сообщение, в таком порядке:

  • Имя файла
  • номер строки компилятора были обнаружены ошибки в скобках, непосредственно за именем
  • класс error (ошибка, фатальная ошибка или предупреждение)
  • номер ошибки
  • описание ошибки

Например:

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

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

Категории ошибок

Ошибки разделяются на три класса:

Ошибки (errors)

  • Описание ситуации когда компилятор не может скомпилировать код
  • Ошибки номеруются от 1 до 99

Критические ошибки (Fatal errors)

  • Критические ошибки и описание, от которых компилятор не может восстановиться.
  • Парсинг прерывается (нет отклика программы).
  • Критические ошибки номеруются от 100 до 199.

Предупреждения ( Warings )

  • Предупреждения указывают на возможную причину возникновения багов, вылетов.
  • Предупреждения номеруются от 200 до 299.

Распространенные ошибки

001: expected token (ожидаемый знак)
Обязательный знак отсутствует

Пример:

error 001: expected token: ";", but found "return"
main()
{
    print("test") // тут должна быть точка с запятой ";"
    return 1;
}

002: only a single statement (or expression) can follow each “case” (только одно выражение может быть в одной строке с «case»
В каждом case оператора switch без фигурных скобок может содержаться только один оператор если больше нужно ставить скобки.
Пример:

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

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

Так же могут быть еще и предупреждения и дополнительные ошибки:

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

Вот так это можно исправить:

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

004: function «x» is not implemented (Функция «x» не используется
Часто бывает что в функции выше пропущена скобка.

025: function heading differs from prototype
Это проиходит когда в функции не совпадают аргументы.

К примеру:

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

Исправляем:

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

035: argument type mismatch (argument x) (не совпадение типов аргумента(ов)
К примеру когда в место playerid — integer аргумента стоит «playerid» — string или 0.5 — float

Пример:

error 035: argument type mismatch (argument 1)

Kick("playerid"); // Как видите в место целого числа (integer) стоит строка

Исправляем:

Kick(playerid);

046: unknown array size (variable x)
Не указан размер массива.

Пример:

new string[];
string = "pawno";

Исправляем:

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

047: array sizes do not match, or destination array is too small
Размер массива мал или не совпадает.

  • Многомерные массивы должны иметь одинаковый размер
  • Одномерные массив к которому присваивают(правый должен иметь больше размер чем левый.
new destination[8];
new msg[] = "Hello World!";
 
destination = msg;

В приведенном выше коде размер строки «Hello world!» ровна 12 байт а массив к которому присваиваем имеет размер 8 байт из этого и складывается ошибка.
Если увеличить размер массива destination до 13 байт то ошибка исправится.

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

055: start of function body without function header
Начало тела функции без функции заголовка.

Критические ошибки (FATAL ERRORS)

100: cannot read from file: "<file>"

Компилятор не может найти или прочитать указанный файл, убедитесь что он находится по адресу (<папка с сервером>pawnoinclude).
Пример:

#include <a_sam>

Исправляем:

#include <a_samp>

Совет
Изображение Не нужно открывать ваш код дважды, не нужно тыкать несколько раз на файл. Откройте сначала редактор, потом ваш проект.

Предупреждения( Warnings )

202: number of arguments does not match definition
Описание ошибки довольно понятное, это значит что вы используете слишком мало или слишком много аргументов в функции, обычно это признак того что функция используется не правильно, обратитесь к документации.
Функция GetPlayerHealth согласно официальному источнику wiki.sa-mp.com имеет два аргумента playerid и Float:health ссылка

Пример:

GetPlayerHealth(playerid);

Исправляем:

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

203: symbol is never used: «symbol»
Вы создали переменную или функцию и она ни где не используется тогда ищите в окне компилятора это предупреждение, это не как не влияет на код и не угражает ему, так что если вы удалите переменную или функцию которая не используется, то вы сэкономите память.

Пример:

stock SomeFunction()
{
    // Blah
}

204: symbol is assigned a value that is never used: «symbol»
Это предупреждение аналогично к предыдущему, разница в том что к переменной что то присвоено и оно не как не используется, это безопасно :)

209: function should return a value
Функция ничего не возвращает, вы создали её:

SomeFunction()
{
     // Blah
}

Решили её присвоить к чему нибудь к примеру:

new result = SomeFunction(); // ожидает 1

Вот так исправить

SomeFunction()
{
     // Blah
     return 1;
}

211: possibly unintended assignment
Если вы введете оператор присваивания в условии и оно не будет в круглых скобках то будет предупреждение

if(vehicle = GetPlayerVehicleID(playerid)) // ошибка
if(vehicle == GetPlayerVehicleID(playerid)) // все норм
if((vehicle = GetPlayerVehicleID(playerid))) // все норм, так значение функции присвоится к переменной потом выражение вычесляется { то есть это как if(IsPlayerConnected(playerid)}

213: tag mismatch ( несовпадение тегов)
Это происходит когда:

  • Тип переменной указан не верно или не имеет его
  • Выражения по обе стороны бинарного оператора имеют разные теги
  • В пременную возвращен не верный тип переменной или не имеющий его.
  • Индексирование массива, который требует тегами индекс без тега или неправильное имя тега

Часто это бывает на 3d текстах или тексдравах Text3D, Text

Не правильно:

new health;
GetPlayerHealth(playerid, health);

Правильно:

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

217: loose indentation
Компилятор выдаст ошибку если не соблюдены отступы.

Правильно:

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

Не правильно:

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

Отступы делаются по нажатью кнопки TAB это практика в программировании для удобного чтения кода.

219: local variable «foo» shadows a variable at a preceding level
Локальная переменная в тени глобальной то есть над локальной переменной создана точно такая же глобальная. В практике программирования префиксом глобальной переменной является «g» в начале переменной к примеру

new gPlayerMoney

любыми способами избегайте их.

К примеру:

new team[MAX_PLAYERS]; // объявляем глобальную переменную
 
function(playerid)
{
    new team[MAX_PLAYERS]; // создаем еще одну, и получаем статью 219 кодекса ошибок :D
    team[playerid] = random(5); 
}

Решение:
Просто переименуйте локальную переменную team.

225: unreachable code ( недоступный код )
Это происходит тогда когда вы пишите какой нибудь код после return, после return’а код не выполняется и он считается бесполезным

Пример:

#include <zcmd.inc>

CMD:jetpack(playerid, params[])
{
	#pragma unused params
	if(IsPlayerAdmin(playerid))
	{
	    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
	    return 1; // завершаем процесс
	}
	else
	{
	    SendClientMessage(playerid, -1, "Вы не администратор");
	    return 1; // завершаем процесс
	}
	SendClientMessage(playerid, -1, "Вы ввели команду /jp"); // Этот код не доступен он не будет выполнятся.
}

Решение:

CMD:jetpack(playerid, params[])
{
	#pragma unused params
	if(IsPlayerAdmin(playerid))
	{
	    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
	}
	else
	{
	    SendClientMessage(playerid, -1, "Вы не администратор");
	}
	SendClientMessage(playerid, -1, "Вы ввели команду /jp"); // этот код запустится
	return 1; // завершаем процесс
}

235: public function lacks forward declaration (symbol «symbol»)
Отсутствует forward.

Не правильно:

public MyFunction()
{

}

Правильно:

forward MyFunction();
 
public MyFunction()
{

}

Надеюсь эта статья поможет вам в языке программирования, желаю вам не повторять ошибок дважды и что бы ваш код был быстрым, надежным!
Оставляйте ваши отзывы, ставьте плюсы, пишите недостатки ошибки, недостатки статьи или их недочеты. Удачи в мире PAWNO!

Содержание

  1. Errors List
  2. From SA-MP Wiki
  3. Contents
  4. General Pawn Error List
  5. Error categories
  6. Errors
  7. Fatal errors
  8. Warnings
  9. Common Errors
  10. 001: expected token
  11. 002: only a single statement (or expression) can follow each “case”
  12. 004: function «x» is not implemented
  13. 025: function heading differs from prototype
  14. 035: argument type mismatch (argument x)
  15. 036: empty statement
  16. 046: unknown array size (variable x)
  17. 047: array sizes do not match, or destination array is too small
  18. 055: start of function body without function header
  19. Common Fatal Errors
  20. 100: cannot read from file: » «
  21. Common Warnings
  22. 202: number of arguments does not match definition
  23. 203: symbol is never used: «symbol»
  24. 204: symbol is assigned a value that is never used: «symbol»
  25. 209: function should return a value
  26. 211: possibly unintended assignment
  27. 213: tag mismatch
  28. 217: loose indentation
  29. 219: local variable «foo» shadows a variable at a preceding level
  30. 225: unreachable code
  31. 235: public function lacks forward declaration (symbol «symbol»)
  32. Тема: error 035: argument type mismatch (argument 1)
  33. error 035: argument type mismatch (argument 1)
  34. Форум Pawn.Wiki — Воплоти мечту в реальность!: Все о ошибках и их устранении — Форум Pawn.Wiki — Воплоти мечту в реальность!

Errors List

From SA-MP Wiki

Contents

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

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.

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).

The above code also produces other warnings/errors:

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.

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.

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.

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.

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.

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: » «

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: pawnoinclude).

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.

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.

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

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

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:

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,

217: loose indentation

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

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.

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.

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

Your public function is missing a forward declaration.

Источник

Тема: error 035: argument type mismatch (argument 1)

Опции темы
Поиск по теме

error 035: argument type mismatch (argument 1)

Доброе время суток, возник такой вопрос.
Есть дата:

Получаем ошибку: error 035: argument type mismatch (argument 1).

Когда если написать функцию так:

Все работает нормально, что я не так делаю, или чего-то не понимаю?

И я бы советовал написать макрос для GetName, а не возвращать строку. С возвращением строки ты будешь в два раза больше стэка выделять для строк, в которых отображается несколько ников игроков.

Вероятнее всего схожая проблема с этой темой.

И я бы советовал написать макрос для GetName, а не возвращать строку. С возвращением строки ты будешь в два раза больше стэка выделять для строк, в которых отображается несколько ников игроков.

Источник

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

  • Pawn скриптинг
  • Школа скриптинга
  • Уроки
  • Правила форума
  • Просмотр новых публикаций

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

Список часто встречаемых ошибок в pawno

Данная тема содержет наиболее распространенные ошибки и предупреждения в pawno при создании скриптов sa-mp
Когда компилятор находит ошибку в файле, то выводится сообщение, в таком порядке:

  • Имя файла
  • номер строки компилятора были обнаружены ошибки в скобках, непосредственно за именем
  • класс error (ошибка, фатальная ошибка или предупреждение)
  • номер ошибки
  • описание ошибки

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

Ошибки разделяются на три класса:

Ошибки (errors)

  • Описание ситуации когда компилятор не может скомпилировать код
  • Ошибки номеруются от 1 до 99

Критические ошибки (Fatal errors)

  • Критические ошибки и описание, от которых компилятор не может восстановиться.
  • Парсинг прерывается (нет отклика программы).
  • Критические ошибки номеруются от 100 до 199.

Предупреждения ( Warings )

  • Предупреждения указывают на возможную причину возникновения багов, вылетов.
  • Предупреждения номеруются от 200 до 299.

001: expected token (ожидаемый знак)
Обязательный знак отсутствует

002: only a single statement (or expression) can follow each “case” (только одно выражение может быть в одной строке с «case»
В каждом case оператора switch без фигурных скобок может содержаться только один оператор если больше нужно ставить скобки.
Пример:

Так же могут быть еще и предупреждения и дополнительные ошибки:

Вот так это можно исправить:

004: function «x» is not implemented (Функция «x» не используется
Часто бывает что в функции выше пропущена скобка.

025: function heading differs from prototype
Это проиходит когда в функции не совпадают аргументы.

035: argument type mismatch (argument x) (не совпадение типов аргумента(ов)
К примеру когда в место playerid — integer аргумента стоит «playerid» — string или 0.5 — float

046: unknown array size (variable x)
Не указан размер массива.

047: array sizes do not match, or destination array is too small
Размер массива мал или не совпадает.

  • Многомерные массивы должны иметь одинаковый размер
  • Одномерные массив к которому присваивают(правый должен иметь больше размер чем левый.

В приведенном выше коде размер строки «Hello world!» ровна 12 байт а массив к которому присваиваем имеет размер 8 байт из этого и складывается ошибка.
Если увеличить размер массива destination до 13 байт то ошибка исправится.

055: start of function body without function header
Начало тела функции без функции заголовка.

Критические ошибки (FATAL ERRORS)

Компилятор не может найти или прочитать указанный файл, убедитесь что он находится по адресу ( pawnoinclude).
Пример:

Совет
Не нужно открывать ваш код дважды, не нужно тыкать несколько раз на файл. Откройте сначала редактор, потом ваш проект.

202: number of arguments does not match definition
Описание ошибки довольно понятное, это значит что вы используете слишком мало или слишком много аргументов в функции, обычно это признак того что функция используется не правильно, обратитесь к документации.
Функция GetPlayerHealth согласно официальному источнику wiki.sa-mp.com имеет два аргумента playerid и Float:health ссылка

203: symbol is never used: «symbol»
Вы создали переменную или функцию и она ни где не используется тогда ищите в окне компилятора это предупреждение, это не как не влияет на код и не угражает ему, так что если вы удалите переменную или функцию которая не используется, то вы сэкономите память.

204: symbol is assigned a value that is never used: «symbol»
Это предупреждение аналогично к предыдущему, разница в том что к переменной что то присвоено и оно не как не используется, это безопасно 🙂

209: function should return a value
Функция ничего не возвращает, вы создали её:

Решили её присвоить к чему нибудь к примеру:

Вот так исправить

211: possibly unintended assignment
Если вы введете оператор присваивания в условии и оно не будет в круглых скобках то будет предупреждение

213: tag mismatch ( несовпадение тегов)
Это происходит когда:

  • Тип переменной указан не верно или не имеет его
  • Выражения по обе стороны бинарного оператора имеют разные теги
  • В пременную возвращен не верный тип переменной или не имеющий его.
  • Индексирование массива, который требует тегами индекс без тега или неправильное имя тега

Часто это бывает на 3d текстах или тексдравах Text3D, Text

217: loose indentation
Компилятор выдаст ошибку если не соблюдены отступы.

Отступы делаются по нажатью кнопки TAB это практика в программировании для удобного чтения кода.

219: local variable «foo» shadows a variable at a preceding level
Локальная переменная в тени глобальной то есть над локальной переменной создана точно такая же глобальная. В практике программирования префиксом глобальной переменной является «g» в начале переменной к примеру

любыми способами избегайте их.

Решение:
Просто переименуйте локальную переменную team.

225: unreachable code ( недоступный код )
Это происходит тогда когда вы пишите какой нибудь код после return, после return’а код не выполняется и он считается бесполезным

235: public function lacks forward declaration (symbol «symbol»)
Отсутствует forward.

Надеюсь эта статья поможет вам в языке программирования, желаю вам не повторять ошибок дважды и что бы ваш код был быстрым, надежным!
Оставляйте ваши отзывы, ставьте плюсы, пишите недостатки ошибки, недостатки статьи или их недочеты. Удачи в мире PAWNO!

Источник

stock UpMoney(playerid)
{
      static const Cash[] = "%i";
      new Str_Cash[15];
      format(Str_Cash, sizeof(Str_Cash), Cash, Player[playerid][pMoney]);
      PlayerTextDrawSetString(playerid, MoneyA_TD[playerid], Str_Cash);
      return true;
}
// Ко всем переменным
new Text:Money_TD[1];
new PlayerText:MoneyA_TD[MAX_PLAYERS];

// В OnPlayerConnect
	MoneyA_TD[playerid] = CreatePlayerTextDraw(playerid, 513.3333, 82.1481, "1234567890");
	PlayerTextDrawLetterSize(playerid, MoneyA_TD[playerid], 0.4483, 1.5667);
	PlayerTextDrawTextSize(playerid, MoneyA_TD[playerid], 22.0000, 0.0000);
	PlayerTextDrawAlignment(playerid, MoneyA_TD[playerid], 1);
	PlayerTextDrawColor(playerid, MoneyA_TD[playerid], -1);
	PlayerTextDrawBackgroundColor(playerid, MoneyA_TD[playerid], 255);
	PlayerTextDrawFont(playerid, MoneyA_TD[playerid], 0);
	PlayerTextDrawSetProportional(playerid, MoneyA_TD[playerid], 1);
	PlayerTextDrawSetShadow(playerid, MoneyA_TD[playerid], 0);

// В OnGameModeInit
	Money_TD[0] = TextDrawCreate(460.0000, -54.0666, "lite:money");
	TextDrawTextSize(Money_TD[0], 186.0000, 293.0000);
	TextDrawAlignment(Money_TD[0], 1);
	TextDrawColor(Money_TD[0], -1);
	TextDrawBackgroundColor(Money_TD[0], 255);
	TextDrawFont(Money_TD[0], 4);
	TextDrawSetProportional(Money_TD[0], 0);
	TextDrawSetShadow(Money_TD[0], 0);
public OnPlayerConnect(playerid)
{
	new string[85];
	GetPlayerName(playerid, Player[playerid][pName], MAX_PLAYER_NAME);
	f("SELECT `Level` FROM `Accounts` WHERE `Name` = '%s'", GN(playerid));
	mysql_function_query(ConnectMySQL, string, true, "PlayerRegition","d", playerid);
//	Clear(playerid);

    TextDrawShowForPlayer(playerid, logotip_TD[0]);

// Вставишь сюда код TD, я написал какой код
	
	PlayerTextDrawShow(playerid, MoneyA_TD[playerid]);
    TextDrawShowForPlayer(playerid, Money_TD[0]);
	return true;
}

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
error 001: expected token: "%s", but found "%s" - ожидался символ: "%s", но был найден "%s";
error 002: only a single statement (or expression) can follow each "case" - только одно заявление (или выражение) могут следовать за "case";
error 003: declaration of a local variable must appear in a compound block - объявленная локальная переменная должна использоваться в этом же блоке;
error 004: function "%s" is not implemented - функция %s не реализована;
error 005: function may not have arguments - функция не имеет аргументов;
error 006: must be assigned to an array - должен быть присвоен массив;
error 007: operator cannot be redefined - оператор не может быть установлен еще раз;
error 008: must be a constant expression; assumed zero - должно быть постоянным выражением; равным нулю;
error 009: invalid array size (negative or zero) - неверный размер массива (отрицательный или 0);
error 010: invalid function or declaration - неизвестная функция или декларация;
error 011: invalid outside functions - неверно вне функции;
error 012: invalid function call, not a valid address - неверный вызов функции, неверный адрес;
error 013: no entry point (no public functions) - нет точки входа (не public функция);
error 014: invalid statement; not in switch - неверный оператор; не в switch;
error 015: "default" case must be the last case in switch statement - "default" должен быть последним условием в switch;
error 016: multiple defaults in "switch" - несколько "default" в switch;
error 017: undefined symbol "%s" - неизвестный символ "%s";
error 018: initialization data exceeds declared size - данные массива превышают его размер;
error 019: not a label: %s" - не метка "%s";
error 020: invalid symbol name "%s" - неверное имя символа "%s";
error 021: symbol already defined: %s" - символ уже объявлен: "%s";
error 022: must be lvalue (non-constant) - должно быть левосторонним (нет постоянной);
error 023: array assignment must be simple assignment - назначение массива должно быть простым;
error 024: "break" or "continue" is out of context - "break" или "continue" вне контекста;
error 025: function heading differs from prototype - функция заголовка отличается от прототипа;
error 026: no matching "#if..." - не найдено "#if...";
error 027: invalid character constant - недопустимый символ в постоянной;
error 028: invalid subscript (not an array or too many subscripts): "%s" - неверный индекс (это не массив или слишком много индексов): "%s";
error 029: invalid expression, assumed zero - неверное выражение, нет результата;
error 030: compound statement not closed at the end of file - составной оператор не закрыт в конце файла;
error 031: unknown directive - неизвестная директива;
error 032: array index out of bounds (variable "%s") - индекс массива превышен;
error 033: array must be indexed (variable "%s") - массив должен быть проиндексирован;
error 034: argument does not have a default value (argument %d) - аргумент не имеет начального значения (аргумент %d);
error 035: argument type mismatch (argument %d) - несоответствие типа аргумента (аргумент %d);
error 036: empty statement - пустой оператор;
error 037: invalid string (possibly non-terminated string) - неправильная строка;
error 038: extra characters on line - лишние символы в строке;
error 039: constant symbol has no size - символьная константа не имеет размера;
error 040: duplicate "case" label (value %d) - несколько раз объявлен "case" с одним тем же параметром;
error 041: invalid ellipsis, array size is not known - размер массива неизвестен;
error 042: invalid combination of class specifiers - недопустимое сочетание класса;
error 043: character constant exceeds range for packed string - символьная константа превышает размер строки;
error 044: positional parameters must precede all named parameters - позиционные параметры должны предшествовать всем именованным параметрам;
error 045: too many function arguments - слишком много аргументов у функции;
error 046: unknown array size (variable "%s") - неизвестный размер массива;
error 047: array sizes do not match, or destination array is too small - размеры массива конфликтуют, либо целевой массив слишком маленький;
error 048: array dimensions do not match - размеры массива не совпадают;
error 049: invalid line continuation - неправильное продолжение строки;
error 050: invalid range - неверный диапазон;
error 051: invalid subscript, use "[ ]" operators on major dimensions - неправильный индекс, используйте "[]";
error 052: multi-dimensional arrays must be fully initialized - много-размерные массивы должны быть полностью определены;
error 053: exceeding maximum number of dimensions - превышение максимального числа измерений;
error 054: unmatched closing brace - не найдена закрывающаяся скобка;
error 055: start of function body without function header - начало функции без заголовка;
error 056: arrays, local variables and function arguments cannot be public (variable "%s") - массивы, локальные переменные и аргументы функции не могут быть общедоступными;
error 057: unfinished expression before compiler directive - незавершенное выражение для компилятора;
error 058: duplicate argument; same argument is passed twice - дублирование аргумента; Аргумент передается несколько раз;
error 059: function argument may not have a default value (variable "%s") - аргумент не может иметь значение по-умолчанию;
error 060: multiple "#else" directives between "#if ... #endif" - Несколько "#else" между "#if ... #endif" - несколько "#else" между "#if и #endif";
error 061: "#elseif" directive follows an "#else" directive - "#else" перед "#elseif";
error 062: number of operands does not fit the operator - количество операндов не соответствует оператору;
error 063: function result tag of operator "%s" must be "%s" - Результат функции %s должен быть %s;
error 064: cannot change predefined operators - невозможно изменить уже определенные операторы;
error 065: function argument may only have a single tag (argument %d) - в этой функции может быть только один аргумент;
error 066: function argument may not be a reference argument or an array (argument "%s") - аргумент функции не может быть ссылкой или массивом;
error 067: variable cannot be both a reference and an array (variable "%s") - Переменная не может быть как массив или ссылка;
error 068: invalid rational number precision in #pragma - неверное число в #pragma;
error 069: rational number format already defined - формат рационального числа уже определен;
error 070: rational number support was not enabled - рациональное число не поддерживается;
error 071: user-defined operator must be declared before use (function "%s") - объявленный оператор должен быть перед использованием;
error 072: "sizeof" operator is invalid on "function" symbols - оператор "sizeof" не может быть использован для символов функции;
error 073: function argument must be an array (argument "%s") - аргумент %s должен быть массивом;
error 074: #define %s must start with an alphabetic character - #define должен начинаться с буквы;
error 075: input line too long (after substitutions - введенная строка слишком длинная;
error 076: syntax *error in the expression, or invalid function call - неправильный синтаксис или неправильный вызов функции;
error 077: malformed UTF-8 encoding, or corrupted file: %s - плохая кодировка UTF-8 или плохой файл: %s;
error 078: function uses both "return" and "return <value>" - функция использует "return" и "return <значение>";
error 079: inconsistent return types (array & non-array) - несовместимость типов возвращенных результатов;
error 080: unknown symbol, or not a constant symbol (symbol "%s") - неизвестный или непостоянный символ: %s;
error 081: cannot take a tag as a default value for an indexed array parameter (symbol "%s") - не может принимать тег в качестве значения по умолчанию для параметра индексированного массива;
error 082: user-defined operators and native functions may not have states - созданные функции или операторы не имеют состояния;
error 083: a function may only belong to a single automaton (symbol "%s") - функция может принадлежать только к одной автоматизации;
error 084: state conflict: one of the states is already assigned to another implementation (symbol "%s") - конфликт состояния: одно из состояний уже назначено на другую реализацию;
error 085: no states are defined for function "%s" - нет состояний, определенных для функции "%s";
error 086: unknown automaton "%s" - неизвестная автоматизация "%s";
error 087: unknown state "%s" for automaton "%s" - неизвестное состояние "%s" в автоматизации "%s";
error 088: number of arguments does not match definition - количество аргументов не совпадает с объявленными в функции;

error 001 expected token: «%s», but found «%s» ожидался символ: «%s», но был найден «%s» error 002 only a single statement (or expression) can follow each «case» только одно заявление (или выражение) могут следовать за «case» error 003 declaration of a local variable must appear in a compound block объявленная локальная переменная должна использоваться в этом же блоке error 004 function «%s» is not implemented функция %s не реализована error 005 function may not have arguments функция не имеет аргументов error 006 must be assigned to an array должен быть присвоен массив error 007 operator cannot be redefined оператор не может быть установлен еще раз error 008 must be a constant expression; assumed zero должно быть постоянным выражением; равным нулю error 009 invalid array size (negative or zero) неверный размер массива (отрицательный или 0) error 010 invalid function or declaration неизвестная функция или декларация error 011 invalid outside functions неверно вне функции error 012 invalid function call, not a valid address неверный вызов функции, неверный адрес error 013 no entry point (no public functions) нет точки входа (не public функция) error 014 invalid statement; not in switch неверный оператор; не в switch error 015 default case must be the last case in switch statement default должен быть последним условием в switch error 016 multiple defaults in «switch» несколько «default» в switch error 017 undefined symbol «%s» неизвестный символ «%s» error 018 initialization data exceeds declared size данные массива превышают его размер error 019 not a label: «%s» не метка «%s» error 020 invalid symbol name «%s» неверное имя символа «%s» error 021 symbol already defined: «%s» символ уже объявлен: «%s» error 022 must be lvalue (non-constant) должно быть левосторонним (нет постоянной) error 023 array assignment must be simple assignment назначение массива должно быть простым error 024 break or «continue» is out of context break или «continue» вне контекста error 025 function heading differs from prototype функция заголовка отличается от прототипа error 026 no matching «#if…» не найдено «#if…» error 027 invalid character constant недопустимый символ в постоянной error 028 invalid subscript (not an array or too many subscripts): «%s» неверный индекс (это не массив или слишком много индексов): «%s» error 029 invalid expression, assumed zero неверное выражение, нет результата error 030 compound statement not closed at the end of file составной оператор не закрыт в конце файла error 031 unknown directive неизвестная директива error 032 array index out of bounds (variable «%s») индекс массива превышен error 033 array must be indexed (variable «%s») массив должен быть проиндексирован error 034 argument does not have a default value (argument %d) аргумент не имеет начального значения (аргумент %d) error 035 argument type mismatch (argument %d) несоответствие типа аргумента (аргумент %d) error 036 empty statement пустой оператор error 037 invalid string (possibly non-terminated string) неправильная строка error 038 extra characters on line лишние символы в строке error 039 constant symbol has no size символьная константа не имеет размера error 040 duplicate «case» label (value %d) несколько раз объявлен «case» с одним тем же параметром error 041 invalid ellipsis, array size is not known размер массива неизвестен error 042 invalid combination of class specifiers недопустимое сочетание класса error 043 character constant exceeds range for packed string символьная константа превышает размер строки error 044 positional parameters must precede all named parameters позиционные параметры должны предшествовать всем именованным параметрам error 045 too many function arguments слишком много аргументов у функции error 046 unknown array size (variable «%s») неизвестный размер массива error 047 array sizes do not match, or destination array is too small размеры массива конфликтуют, либо целевой массив слишком маленький error 048 array dimensions do not match размеры массива не совпадают error 049 invalid line continuation неправильное продолжение строки error 050 invalid range неверный диапазон error 051 invalid subscript, use «[ ]» operators on major dimensions неправильный индекс, используйте «[]» error 052 multi-dimensional arrays must be fully initialized много-размерные массивы должны быть полностью определены error 053 exceeding maximum number of dimensions превышение максимального числа измерений error 054 unmatched closing brace не найдена закрывающаяся скобка error 055 start of function body without function header начало функции без заголовка error 056 arrays, local variables and function arguments cannot be public (variable «%s») массивы, локальные переменные и аргументы функции не могут быть общедоступными (переменная «% s») error 057 unfinished expression before compiler directive который недействителен. error 058 duplicate argument; same argument is passed twice дублирование аргумента; аргумент передается несколько раз error 059 function argument may not have a default value (variable «%s») аргумент не может иметь значение по-умолчанию error 060 multiple «#else» directives between «#if … #endif» несколько «#else» между «#if и #endif» error 061 #elseif directive follows an «#else» directive #else перед «#elseif» error 062 number of operands does not fit the operator Количество операторов не соотвествует оператору error 063 function result tag of operator «%s» must be «%s» Результат функции %s должен быть %s error 064 cannot change predefined operators невозможно изменить уже определенные операторы error 065 function argument may only have a single tag (argument %d) в этой функции может быть только один аргумент error 066 function argument may not be a reference argument or an array (argument «%s») аргумент функции не может быть ссылкой или массивом error 067 variable cannot be both a reference and an array (variable «%s») Переменная не может быть как массив или ссылка error 068 invalid rational number precision in #pragma неверное число в #pragma error 069 rational number format already defined формат рационального числа уже определен error 070 rational number support was not enabled рациональное число не поддерживается error 071 user-defined operator must be declared before use (function «%s») объявленный оператор должен быть перед использованием error 072 sizeof operator is invalid on «function» symbols оператор «sizeof» не может быть использован для символов функции error 073 function argument must be an array (argument «%s») аргумент %s должен быть массивом error 074 #define pattern must start with an alphabetic character #define должен начинаться с буквы error 075 input line too long (after substitutions) введенная строка слишком длинная error 076 syntax error in the expression, or invalid function call неправильный синтаксис или неправильный вызов функции error 077 malformed UTF-8 encoding, or corrupted file: %s плохая кодировка UTF-8 или плохой файл: %s error 078 «»}»>function uses both «return» and «return <value>» «»}»>функция использует «return» и «return <значение>» error 079 inconsistent return types (array & non-array) несовместимость типов возвращенных результатов error 080 unknown symbol, or not a constant symbol (symbol «%s») неизвестный или непостоянный символ: %s error 081 cannot take a tag as a default value for an indexed array parameter (symbol «%s») Нельзя взять значение в массив %s error 082 user-defined operators and native functions may not have states созданные функции или операторы не имеют состояния error 083 a function may only belong to a single automaton (symbol «%s») функция может принадлежать только к одной автоматизации error 084 state conflict: one of the states is already assigned to another implementation (symbol «%s») для функции %s уже определенна данная state error 085 no states are defined for function «%s» нет состояний, определенных для функции «%s» error 086 unknown automaton «%s» неизвестная автоматизация «%s» error 087 unknown state «%s» for automaton «%s» неизвестное состояние «%s» в автоматизации «%s» error 088 number of arguments does not match definitionn количество аргументов не совпадает с объявленными в функции

C:UsersАдминистраторDesktopDesctopprovince roleplaygamemodesnew.pwn(1643) : error 035: argument type mismatch (argument 2)
C:UsersАдминистраторDesktopDesctopprovince roleplaygamemodesnew.pwn(1644) : error 035: argument type mismatch (argument 2)
C:UsersАдминистраторDesktopDesctopprovince roleplaygamemodesnew.pwn(1645) : error 035: argument type mismatch (argument 2)
C:UsersАдминистраторDesktopDesctopprovince roleplaygamemodesnew.pwn(1646) : error 035: argument type mismatch (argument 2)
C:UsersАдминистраторDesktopDesctopprovince roleplaygamemodesnew.pwn(1647) : error 035: argument type mismatch (argument 2)
C:UsersАдминистраторDesktopDesctopprovince roleplaygamemodesnew.pwn(1648) : error 035: argument type mismatch (argument 2)
C:UsersАдминистраторDesktopDesctopprovince roleplaygamemodesnew.pwn(1649) : error 035: argument type mismatch (argument 2)
C:UsersАдминистраторDesktopDesctopprovince roleplaygamemodesnew.pwn(1650) : error 035: argument type mismatch (argument 2)
C:UsersАдминистраторDesktopDesctopprovince roleplaygamemodesnew.pwn(1651) : error 035: argument type mismatch (argument 2)
C:UsersАдминистраторDesktopDesctopprovince roleplaygamemodesnew.pwn(1652) : error 035: argument type mismatch (argument 2)
C:UsersАдминистраторDesktopDesctopprovince roleplaygamemodesnew.pwn(1653) : error 035: argument type mismatch (argument 2)
C:UsersАдминистраторDesktopDesctopprovince roleplaygamemodesnew.pwn(1654) : error 035: argument type mismatch (argument 2)
C:UsersАдминистраторDesktopDesctopprovince roleplaygamemodesnew.pwn(1655) : error 035: argument type mismatch (argument 2)
C:UsersАдминистраторDesktopDesctopprovince roleplaygamemodesnew.pwn(1656) : error 035: argument type mismatch (argument 2)
C:UsersАдминистраторDesktopDesctopprovince roleplaygamemodesnew.pwn(1658) : error 035: argument type mismatch (argument 1)
C:UsersАдминистраторDesktopDesctopprovince roleplaygamemodesnew.pwn(1660) : error 035: argument type mismatch (argument 1)
C:UsersАдминистраторDesktopDesctopprovince roleplaygamemodesnew.pwn(1662) : error 035: argument type mismatch (argument 1)
C:UsersАдминистраторDesktopDesctopprovince roleplaygamemodesnew.pwn(1663) : error 001: expected token: «,», but found «]»
C:UsersАдминистраторDesktopDesctopprovince roleplaygamemodesnew.pwn(1663) : error 029: invalid expression, assumed zero
C:UsersАдминистраторDesktopDesctopprovince roleplaygamemodesnew.pwn(1663) : error 029: invalid expression, assumed zero
C:UsersАдминистраторDesktopDesctopprovince roleplaygamemodesnew.pwn(1663) : fatal error 107: too many error messages on one line

Вот строки:

TextDrawShowForPlayer(playerid,menuas0);
TextDrawShowForPlayer(playerid,menuas1);
TextDrawShowForPlayer(playerid,menuas2);
TextDrawShowForPlayer(playerid,menuas3);
TextDrawShowForPlayer(playerid,menuas4);
TextDrawShowForPlayer(playerid,menuas5);
TextDrawShowForPlayer(playerid,menuas6);
TextDrawShowForPlayer(playerid,menuas7);
TextDrawShowForPlayer(playerid,menuas8);
TextDrawShowForPlayer(playerid,menuas9);
TextDrawShowForPlayer(playerid,menuas10);
TextDrawShowForPlayer(playerid,menuas11);
TextDrawShowForPlayer(playerid,menuas12);
TextDrawShowForPlayer(playerid,menuas13);
format(string,256,»Fuel:%s»,TextCar);
TextDrawSetString(menuas7,string);
format(string,256,»Price:%s»,CarAv[AvtoSalon1[playerid]][1]);
TextDrawSetString(menuas6,string);
format(string,256,»ID:%s»,GetPlayerVehicleID(playerid));
TextDrawSetString(menuas9,string);
format(string,256,»MODEL:%s»,GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
TextDrawSetString(menuas9,string);

Код полностью:

 

if(newkeys&amp;16384)//Клавиша 6
{
if(AvtoSalon2[playerid] == 1)
{
DestroyVehicle(GetPlayerVehicleID(playerid));
AvtoSalon1[playerid]++;
if(AvtoSalon1[playerid] &gt; 38) AvtoSalon1[playerid] = 0;
new idcar;
idcar = CreateVehicle(CarAv[AvtoSalon1[playerid]][0], 2352.9795, -1845.4196, 21.4878, 90.0000, 1, 1, 800000);
SetVehicleVirtualWorld(idcar, CarSalon[playerid]);
SetPVarInt(playerid,»Create_Car»,idcar);
PutPlayerInVehicle(playerid, idcar, 0);
if(IsADiesel(idcar)) TextCar = «Disel»;
else if(IsARegular(idcar)) TextCar = «A90»;
else if(IsAPlus(idcar)) TextCar = «A93»;
else if(IsAPremium(idcar)) TextCar = «A95»;
//Menu
TextDrawShowForPlayer(playerid,menuas0);
TextDrawShowForPlayer(playerid,menuas1);
TextDrawShowForPlayer(playerid,menuas2);
TextDrawShowForPlayer(playerid,menuas3);
TextDrawShowForPlayer(playerid,menuas4);
TextDrawShowForPlayer(playerid,menuas5);
TextDrawShowForPlayer(playerid,menuas6);
TextDrawShowForPlayer(playerid,menuas7);
TextDrawShowForPlayer(playerid,menuas8);
TextDrawShowForPlayer(playerid,menuas9);
TextDrawShowForPlayer(playerid,menuas10);
TextDrawShowForPlayer(playerid,menuas11);
TextDrawShowForPlayer(playerid,menuas12);
TextDrawShowForPlayer(playerid,menuas13);
format(string,256,»Fuel:%s»,TextCar);
TextDrawSetString(menuas7,string);
format(string,256,»Price:%s»,CarAv[AvtoSalon1[playerid]][1]);
TextDrawSetString(menuas6,string);
format(string,256,»ID:%s»,GetPlayerVehicleID(playerid));
TextDrawSetString(menuas9,string);
format(string,256,»MODEL:%s»,GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
TextDrawSetString(menuas9,string);
//
//SetPlayerCameraPos(playerid, 2330.4688, -1825.5409, 26.0714);
//SetPlayerCameraLookAt(playerid, 2331.3721, -1825.9742, 25.7214);
SetPlayerCameraPos(playerid, 2344.1479, -1852.7036, 25.0675);
SetPlayerCameraLookAt(playerid, 2344.8452, -1851.9888, 24.7675);
return 1;
}
}

С меня + :)

Kem4ik

Регистрация
15 Фев 2021
Сообщения
143
Лучшие ответы
0
Репутация
2

  • #1

Привет всем кто читает. Мою прошлую тему удалили по причине: «Прочитайте запись», я так понял модераторы данного раздела решили мне сказать что данная проблема была уже решена кем-то. Я поискал решении свои проблемы я не нашёл
——————————————————————————————————————————————————————————————————————————————————
Суть проблемы заключается в ERROR 035:

PHP:

.gamemodestest.pwn(13437) : error 035: argument type mismatch (argument 2)
.gamemodestest.pwn(13479) : error 035: argument type mismatch (argument 2)
.gamemodestest.pwn(33517) : error 035: argument type mismatch (argument 2)
.gamemodestest.pwn(33669) : error 035: argument type mismatch (argument 2)
.gamemodestest.pwn(33691) : error 035: argument type mismatch (argument 2)
.gamemodestest.pwn(33731) : error 035: argument type mismatch (argument 2)
.gamemodestest.pwn(33796) : error 035: argument type mismatch (argument 2)
.gamemodestest.pwn(33805) : error 035: argument type mismatch (argument 2)
.gamemodestest.pwn(33820) : error 035: argument type mismatch (argument 2)
.gamemodestest.pwn(33829) : error 035: argument type mismatch (argument 2)
.gamemodestest.pwn(33841) : error 035: argument type mismatch (argument 2)
.gamemodestest.pwn(33850) : error 035: argument type mismatch (argument 2)
.gamemodestest.pwn(33867) : error 035: argument type mismatch (argument 2)
.gamemodestest.pwn(34058) : error 035: argument type mismatch (argument 2)
.gamemodestest.pwn(34694) : error 035: argument type mismatch (argument 2)
.gamemodestest.pwn(34825) : error 035: argument type mismatch (argument 2)
.gamemodestest.pwn(36159) : error 035: argument type mismatch (argument 2)
.gamemodestest.pwn(36176) : error 035: argument type mismatch (argument 2)
.gamemodestest.pwn(36196) : error 035: argument type mismatch (argument 2)
.gamemodestest.pwn(36281) : error 035: argument type mismatch (argument 2)
.gamemodestest.pwn(36335) : error 035: argument type mismatch (argument 2)
.gamemodestest.pwn(38221) : error 035: argument type mismatch (argument 2)
.gamemodestest.pwn(38242) : error 035: argument type mismatch (argument 2)
.gamemodestest.pwn(38261) : error 035: argument type mismatch (argument 2)
.gamemodestest.pwn(38280) : error 035: argument type mismatch (argument 2)
.gamemodestest.pwn(38299) : error 035: argument type mismatch (argument 2)

Думаю нет смысла кидать все целые кмд, скину место ошибки.

PHP:

Admin_Log(playerid, stringer1, PlayerInfo[ids][pNames], gettime());
Admin_Log(playerid, stringer1, PlayerInfo[ids][pNames], gettime());
Admin_Log(playerid, stringer1, tmp, gettime());
Admin_Log(playerid, "удалил аккаунт", tmp, gettime());

И так далее. Я так понимаю ошибка заключается в gettime()), но решения я так не нашел
Надеюсь вы сможете мне помочь.


  1. 12.04.2019, 12:21


    #1

    Аватар для Paradox

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


    error 035: argument type mismatch (argument 1)

    Доброе время суток, возник такой вопрос.
    Есть дата:

    PHP код:


    enum PLAYER_MISQL
    {
         
    NAME[MAX_PLAYER_NAME 1],
         
    IP,
         .....
    }
    new 
    PLAYER_DATA[MAX_PLAYERS][PLAYER_MISQL]; 



    И есть такая вот функция:

    PHP код:


    stock GetName(playerid)
    {
         return 
    PLAYER_DATA[playerid][NAME];




    Дальше, если вставлять просто в format, то все отлично, в плане:

    PHP код:


    new msg[] = "Ваше имя %s.";
    new 
    str[sizeof(msg) + MAX_PLAYER_NAME 1];
    format(strsizeof(str), msgGetName(playerid));
    SendClientMessage(playeridCOLOR_WHITEstr); 



    А если вставлять допустим в проверку:

    PHP код:


    if(!strcmp(GetName(playerid), "Имя_Фамилия"true)) // ошибка
    {
       
    // it's ok.




    Получаем ошибку: error 035: argument type mismatch (argument 1).

    Когда если написать функцию так:

    PHP код:


    stock GetName(playerid)
    {
         new 
    name[MAX_PLAYER_NAME 1];
         
    strmid(namePLAYER_DATA[playerid][NAME], 0strlen(PLAYER_DATA[playerid][NAME]), MAX_PLAYER_NAME 1);
         return 
    name;




    Все работает нормально, что я не так делаю, или чего-то не понимаю?



  2. 12.04.2019, 14:24


    #2

    Вероятнее всего схожая проблема с этой темой.

    И я бы советовал написать макрос для GetName, а не возвращать строку. С возвращением строки ты будешь в два раза больше стэка выделять для строк, в которых отображается несколько ников игроков.

    Связаться со мной в VK можно через личные сообщения этой группы
    Заказы не принимаю


    Широко известно, что идеи стоят 0.8333 цента каждая (исходя из рыночной цены 10 центов за дюжину).
    Великих идей полно, на них нет спроса.
    Воплощение идеи в законченную игру требует долгой работы,
    таланта, терпения и креативности, не говоря уж о затратах денег, времени и ресурсов.
    Предложить идею просто, воплотить – вот в чём проблема


    Steve Pavlina



  3. 12.04.2019, 15:30


    #3

    Аватар для Paradox

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


    Цитата Сообщение от DeimoS
    Посмотреть сообщение

    Вероятнее всего схожая проблема с этой темой.

    И я бы советовал написать макрос для GetName, а не возвращать строку. С возвращением строки ты будешь в два раза больше стэка выделять для строк, в которых отображается несколько ников игроков.

    можно пример?



  4. 12.04.2019, 16:15


    #4

    1. #define GetName(%0) PLAYER_DATA[%0][NAME]

    Связаться со мной в VK можно через личные сообщения этой группы
    Заказы не принимаю


    Широко известно, что идеи стоят 0.8333 цента каждая (исходя из рыночной цены 10 центов за дюжину).
    Великих идей полно, на них нет спроса.
    Воплощение идеи в законченную игру требует долгой работы,
    таланта, терпения и креативности, не говоря уж о затратах денег, времени и ресурсов.
    Предложить идею просто, воплотить – вот в чём проблема


    Steve Pavlina



  5. 12.04.2019, 16:33


    #5

    Аватар для Paradox

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


    Цитата Сообщение от DeimoS
    Посмотреть сообщение

    1. #define GetName(%0) PLAYER_DATA[%0][NAME]

    Понял, спасибо, тема закрыта.


Fapowered
Автор темы
Аватара
Fapowered
Автор темы
Сообщения: 1
Зарегистрирован: 24 августа 2018
С нами: 4 года 5 месяцев

../library/map/spawn_ls.inc(15) : error 035: argument type mismatch (argument 10)
../library/map/spawn_ls.inc(17) : error 035: argument type mismatch (argument 10)
../library/map/spawn_ls.inc(21) : error 035: argument type mismatch (argument 10)
../library/map/spawn_ls.inc(23) : error 035: argument type mismatch (argument 10)
../library/map/spawn_ls.inc(27) : error 035: argument type mismatch (argument 10)
../library/map/spawn_ls.inc(29) : error 035: argument type mismatch (argument 10)
../library/map/spawn_ls.inc(31) : error 035: argument type mismatch (argument 10)
../library/map/spawn_ls.inc(34) : error 035: argument type mismatch (argument 10)
../library/map/spawn_ls.inc(37) : error 035: argument type mismatch (argument 10)
../library/map/spawn_ls.inc(40) : error 035: argument type mismatch (argument 10)
../library/map/spawn_ls.inc(43) : error 035: argument type mismatch (argument 10)
../library/map/spawn_ls.inc(46) : error 035: argument type mismatch (argument 10)
../library/map/spawn_ls.inc(49) : error 035: argument type mismatch (argument 10)
../library/map/spawn_ls.inc(52) : error 035: argument type mismatch (argument 10)
../library/map/spawn_ls.inc(55) : error 035: argument type mismatch (argument 10)
../library/map/spawn_ls.inc(59) : error 035: argument type mismatch (argument 10)
../library/map/spawn_ls.inc(62) : error 035: argument type mismatch (argument 10)
../library/map/spawn_ls.inc(65) : error 035: argument type mismatch (argument 10)
../library/map/spawn_ls.inc(68) : error 035: argument type mismatch (argument 10)
../library/map/spawn_ls.inc(71) : error 035: argument type mismatch (argument 10)
../library/map/spawn_ls.inc(74) : error 035: argument type mismatch (argument 10)
../library/map/spawn_ls.inc(76) : error 035: argument type mismatch (argument 10)
../library/map/spawn_ls.inc(78) : error 035: argument type mismatch (argument 10)
../library/map/spawn_ls.inc(80) : error 035: argument type mismatch (argument 10)
../library/map/spawn_ls.inc(82) : error 035: argument type mismatch (argument 10)
../library/map/spawn_ls.inc(84) : error 035: argument type mismatch (argument 10)

Compilation aborted.

Pawn compiler 3.10.20160907 Copyright (c) 1997-2006, ITB CompuPhase

26 Errors.



Sprite M
Ст. сержант
Ст. сержант
Аватара
Sprite
Ст. сержант
Сообщения: 83
Зарегистрирован: 5 июня 2013
С нами: 9 лет 8 месяцев

#2 Sprite » 27 августа 2018, 19:37

И что ты этим хотел сказать?… :grin:

После чего это появилось, где, что за мод…?




Вернуться в «Вопросы»

Кто сейчас на форуме

Сейчас этот раздел просматривают: 1 гость

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

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

  • Error 033 array must be indexed variable playerinfo
  • Error 033 array must be indexed variable pawn
  • Error 033 array must be indexed variable inputtext
  • Error 033 array must be indexed variable giveplayerid
  • Error 033 array must be indexed pawno

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

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