07.03.2018, 10:33
#define does not act like a normal variable
Once you #define something it is present in the whole documnet until you use #undef.
This is your problem:
Read more here: https://sampforum.blast.hk/showthread.php?tid=570933
I know it is a lot to read, but at least try to read the first few paragraphs.
Once you #define something it is present in the whole documnet until you use #undef.
This is your problem:
PHP код:
public OnFilterScriptInit()
{
#define teszt
//here you defined it
return 1;
}
public OnFilterScriptExit()
{
//if you do a check here teszt is defined at this line
#undef teszt
// after this line you no longer can use teszt because there is no longer defined
return 1;
}
CMD:teszt(playerid, params[])
{
//this doesn't work because testz was undefined.
#if defined teszt
Msg(playerid, "Work");
#else
Msg(playerid, "Don't work");
#endif
return 1;
}
I know it is a lot to read, but at least try to read the first few paragraphs.