SetTimerEx problem
#1

Today I read the articles about timer that ****** wrote and I try to use the SetTimer function with delayed loading.
However, I got some questions and I made some testes:
Код:
#include <a_samp>

forward RunTimer(const funcname[]);

public OnGameModeInit()
{
    SetTimerEx("RunTimer",100,false,"s","message");
    SetTimerEx("RunTimer",1000,false,"s","message2");
}

public RunTimer(const funcname[])
{
	new string[128];
	format(string,sizeof(string),"%s",funcname);
	print(string);
	printf("%s",funcname);
	print(funcname);
	return 1;
}
and the first
Код:
SetTimerEx("RunTimer",100,false,"s","message");
won't work.
Both prints message2.

Seems that it's impossible to call the same function with different interval at the same time?

Also,I found that the string passed in SetTimerEx cannot be outputted directly. It must be formatted or it'll just print null string. What's the problem?

Sorry for my bad English but please help.

EDIT:
Now I found that only strings will act like that.
Passing integers will be normal.
See the testing code:
Код:
#include <a_samp>

forward RunTimer(num,string2[]);

public OnGameModeInit()
{
    SetTimerEx("RunTimer",1000,false,"ds",1,"abc");
    SetTimerEx("RunTimer",1000,false,"ds",0,"def");
}

public RunTimer(num,string2[])
{
	new string[128];
	format(string,sizeof(string),"%d %s",num,string2);
    print(string);
	return 1;
}
and it prints:
Код:
1 def
0 def
Weird...
Reply


Messages In This Thread
SetTimerEx problem - by leong124 - 02.01.2011, 05:45
Re: SetTimerEx problem - by Rachael - 02.01.2011, 05:58
Re: SetTimerEx problem - by leong124 - 02.01.2011, 06:16
Re: SetTimerEx problem - by fangoth1 - 02.01.2011, 13:42
Re: SetTimerEx problem - by Mean - 02.01.2011, 14:48
Re: SetTimerEx problem - by _rAped - 02.01.2011, 15:07
Re: SetTimerEx problem - by leong124 - 03.01.2011, 01:12
Re: SetTimerEx problem - by AirKite - 11.06.2011, 13:36

Forum Jump:


Users browsing this thread: 1 Guest(s)