05.11.2018, 14:06
I used y_hooks before and it worked perfectly! But I decided to change my compiler (now it's 3.10.9).
https://github.com/pawn-lang/compiler
Also i updated my ysi to the latest version
Now when i add #pragma compat 1, there's 2 warnings for y_utils and when i try to use hook keyword, an error appears: Invalid function or declaration.
2 Warnings:
1) possibly a "const" array argument was intented: "ip"
2) literal array/string passed to a non-const parameter
My gamemode file beggining:
Now it's the file where error appears:
How can i fix this?
There's no errors when i don't do #pragma compat 1, but then there are manyyy more warnings. (And they're not from me, they're from y_hooks\impl.inc) and i don't want any warnings at all
https://github.com/pawn-lang/compiler
Also i updated my ysi to the latest version
Now when i add #pragma compat 1, there's 2 warnings for y_utils and when i try to use hook keyword, an error appears: Invalid function or declaration.
2 Warnings:
1) possibly a "const" array argument was intented: "ip"
2) literal array/string passed to a non-const parameter
My gamemode file beggining:
Code:
#pragma compat 1 #include <a_samp> #define FIXES_ServerVarMsg 0 #include <fixes> #undef isnull #include <YSI\YSI\y_hooks> #include <YSI\YSI_Data\y_foreach> #include <zcmd> #include <sscanf2> #include <streamer> #include <a_npc> #include <unixtodate> //tier0 - helper functions, defines... #include <MINE\tier0\utilities> #include <MINE\tier0\zdialog>
Code:
#include <YSI\YSI\y_hooks> hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) //This line is bad for some reason { new funcname[MAX_FUNC_NAME]; format(funcname, MAX_FUNC_NAME, "dialog_%d", dialogid); if(strlen(inputtext) == 0) { CallLocalFunction(funcname, "iiis", playerid, response, listitem, "\1"); } else { CallLocalFunction(funcname, "iiis", playerid, response, listitem, inputtext); } return 1; }
There's no errors when i don't do #pragma compat 1, but then there are manyyy more warnings. (And they're not from me, they're from y_hooks\impl.inc) and i don't want any warnings at all