11.08.2015, 13:02
Today I learned that using printf with large strings will crash the server.
@test()
{
}
new a=5;
if a==5 *then print("a=5");
Today I learned that when you declare a function with a name starting with an at sign '@' character, it is automatically detected as a public function.
If you do this: PHP код:
|
Today i learned there exist an *then in Pawn, like this:
PHP код:
|
Error: Expected token: "(", but found "-identifier-" on line 14
True, the character '@' declare a public function| @test() -> public test()
|
#include <a_samp>
main()
{
@test();
}
forward @test();
@test()
{
print("test");
}
#include <a_samp>
main()
{
test();
}
forward test();
@test()
{
print("test");
}
error 004: function "test" is not implemented warning 235: public function lacks forward declaration (symbol "@test")
main() {
CallLocalFunction("@test", "");
}
@test();
@test() {
printf("test");
}
Not really, if you put the character '@' before the name, you can't call only the function name.
Example which works : PHP код:
PHP код:
Код:
error 004: function "test" is not implemented warning 235: public function lacks forward declaration (symbol "@test") |
stock printf.one() { }
#define printf. _replace_
stock printf.one() { } stock printf.two() { } stock printf.three() { }
stock _replace_one() {} stock _replace_two() {} stock _replace_three {}
#define SQL_HOST ("localhost") #define SQL_USER ("root") #define SQL_PASS ("") #define SQL_DB ("db") mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);