22.11.2012, 12:04
Hello, i wanted to know if parameters will share with other callbacks so i made this simple test script
and i got this printed.
So conclusion is, parameters are shared with other callbacks, but the questions is :
why string = TestCallBack not TestCallBack2?
Also, when i tried to add this under testcallback callback.
i got this one
so added an array size like this.
But then, i get this error.
Can someone please explain it?
pawn Код:
#include <a_samp>
main ()
{
}
public OnGameModeInit()
{
SetTimer("TestCallBack",1000,0);
SetTimer("TestCallBack2",1500,0);
return 1;
}
forward TestCallBack(string[],integer);
public TestCallBack(string[],integer)
{
integer=50;
return 1;
}
forward TestCallBack2(string[],integer);
public TestCallBack2(string[],integer)
{
printf("string=%s",string);
printf("integer=%d",integer);
return 1;
}
Код:
[15:15:34] string=TestCallBack [15:15:34] integer=50
why string = TestCallBack not TestCallBack2?
Also, when i tried to add this under testcallback callback.
pawn Код:
string="Hello";
Код:
test.pwn(15) : error 046: unknown array size (variable "string")
pawn Код:
string[10]="Hello";
Код:
test.pwn(15) : error 006: must be assigned to an array