Include help
#1

test.inc
pawn Код:
#if defined _test
    #endinput
#endif
#define _test

#if !defined FILTERSCRIPT
public OnGameModeInit()
#else
public OnFilterScriptInit()
#endif
{
    print("rofl");
    return 1;
}

//OnGameModeInit
#if defined _ALS_OnGameModeInit
    #undef OnGameModeInit
#else
    #define _ALS_OnGameModeInit
#endif

//OnFilterScriptInit
#if defined _ALS_OnFilterScriptInit
    #undef OnFilterScriptInit
#else
    #define _ALS_OnFilterScriptInit
#endif

//OnGameModeInit
#define OnGameModeInit forward_OnGameModeInit
forward forward_OnGameModeInit();

//OnFilterScriptInit
#define OnFilterScriptInit forward_OnFilterScriptInit
forward forward_OnFilterScriptInit();
test.pwn
pawn Код:
#define FILTERSCRIPT

#include <a_samp>
#include <test>

public OnFilterScriptInit()
{
    print("OMG");
    print("OMG");
    print("OMG");
    print("OMG");
    print("OMG");
    print("OMG");
    print("OMG");
    return 1;
}
The problem is... "rofl" get printed but "OMG", "OMG".. ect... dont get printed

so why cant i use OnFilterScript in pawno but in the include?
Reply
#2

Why are you making hooking much more complicated than it needs to be? ****** wrote a library exactly for this reason, check it out. It's part of his YSI library.

http://forum.sa-mp.com/showthread.ph...ghlight=y_hook
Reply
#3

Y_Hooks make my server lagg... idk why

Thats why im doing it on the complicated way
Reply
#4

You may be using it incorrectly, or your problem is something else. I've used the library multiple times flawlessly. You could also contact ****** if you are positive it is y_hooks causing your server to lag.
Reply
#5

Im using it like this..

pawn Код:
#if defined _test
    #endinput
#endif
#define _test

#include <YSI\y_hooks>

#if !defined FILTERSCRIPT
Hook:Test_OnGameModeInit()
#else
Hook:Test_OnFilterScriptInit()
#endif
{
    print("rofl");
    return 1;
}
EDIT: thx, ill work it out..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)