y_hooks and new compiler
#1

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:
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>
Now it's the file where error appears:
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;
}
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
Reply
#2

Ooooooo... Thanks dude Everything compiles perfectly with 5.x

Only one problem... I can't put all ysi folders into include\YSI, it forces me to put everything into \include\... Everything is not tidy in include folder now but at least my compiler works better xd Thanks

Edit: ACTUALLY I TAKE BACK MY WORDS, I directed everything to YSI folder and everything works, I used YSI\YSI\y_hooks, but I needed to use YSI\YSI_Coding\y_hooks, so it wrote something like: You need to use YSI_Coding\y_hooks, so I messed up little bit xd
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)