14.05.2015, 11:50
(
Last edited by Logofero; 15/05/2015 at 07:13 AM.
)
There are 2 files included:
test1.inc
test2.inc
gamemode:
One function debug_1();
Question: What are the methods of using directives? Condition: You can not delete function physically. One of the functions can be commented out and must operate the other
My method for some reason, causes an error:
Add: Method found. Decided:
test1.inc > If not available
test2.inc < used functions
gamemode:
Print if all included:
Print if one #include <test2> included:
test1.inc
PHP Code:
/*
// imitation lack of function
#if !defined debug_1
stock debug_1() {
print("debug file 1");
}
#endif*/
PHP Code:
#if !defined debug_1
stock debug_1() {
print("debug file 2");
}
#endif
PHP Code:
#include <a_samp>
#include <test1>
#include <test2>
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
print("sta");
debug_1();
print("eof");
}
Question: What are the methods of using directives? Condition: You can not delete function physically. One of the functions can be commented out and must operate the other
My method for some reason, causes an error:
HTML Code:
[12:35:10] sta [12:35:10] Script[gamemodes/new.amx]: Run time error 6: "Invalid instruction"
test1.inc > If not available
PHP Code:
#if !defined debug_1
#define debug_1 new_debug_1
stock debug_1() {
print("debug file 1");
}
#endif
PHP Code:
#if !defined debug_1
#define debug_1 new_debug_1
stock debug_1() {
print("debug file 2");
}
#endif
PHP Code:
#include <a_samp>
#include <test1> //faworite functions
#include <test2> //alternative functions
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
print("sta");
debug_1();
print("eof");
}
Code:
sta debug file 1 eof
Code:
sta debug file 2 eof