open.mp forum
[Pawn] [SOLVED] (warning) literal array/string passed to a non-const parameter - Printable Version

+- open.mp forum (https://forum.open.mp)
+-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
+--- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10)
+--- Thread: [Pawn] [SOLVED] (warning) literal array/string passed to a non-const parameter (/showthread.php?tid=1101)



[SOLVED] (warning) literal array/string passed to a non-const parameter - cosine - 2020-05-26

As the title said,

Right now im using the new compiler and sampctl, and having this problem with warning
PHP Code:
(warning) literal array/string passed to a non-const parameter

There's so much line getting warning, and most of them is pointing to the line with function ShowPlayerDialog.



This is one of them.

PHP Code:
showDialogResepsionis(playerid){ ? ?return ShowPlayerDialog(playerid, DIALOG_RESPSIONIS_PEMERINTAH, DIALOG_STYLE_LIST, "Pilihan tindakan pengurusan data", "KTP", "Pilih", "Batal"); }



Note : I have update to YSI 5.x and here is my depedencies

PHP Code:
"dependencies": [ "sampctl/samp-stdlib", "Southclaws/samp-logger", "pawn-lang/YSI-Includes", "zeex/samp-plugin-crashdetect:v4.19.4", "pawn-lang/[email protected]", "samp-incognito/samp-streamer-plugin:v2.9.4", "Southclaws/progress2", "pBlueG/SA-MP-MySQL:R41-4", "Southclaws/zcmd", "maddinat0r/sscanf:v2.8.3", "BigETI/pawn-memory:2.0.1" ],



RE: ShowPlayerDialog (warning) literal array/string passed to a non-const parameter - cosine - 2020-05-26

Solved.



Just realize that im using include that hook ShowPlayerDialog and set parameter with non-const string data type.

Solutions : Change all parameter with non-const string/array to const string/array.

Note : Use YSI 5.x for compiler 3.10.9 and YSI 4.x for compiler 3.10.8 or below



Thank you.