Create new state machines with different automaton in a public
#1

PHP код:
forward SetTimerByTimes(functionsname[],timemin,timemax);
public 
SetTimerByTimes(functionsname[],timemin,timemax)
{
    new 
Times[3];
    
gettime(Times[0], Times[1], Times[2]);
    if((
Times[0]- timemin) > (Times[0]- timemax)){
        
newtimer SetTimerEx("Test",((Times[0] < timemin)?(((timemin-(Times[0]+1))*60*60*1000) +((60-(Times[1]+1))*60*1000)+((60-Times[2])*1000)):(((24-(Times[0]+1))*60*60*1000) +((60-(Times[1]+1))*60*1000)+((60-Times[2])*1000)+(timemin*60*60*1000))),false,"sii",functionsname,timemin,timemax);
        
state call:min;
    }else{
        
newtimer SetTimerEx("Test",((Times[0] < timemax)?(((timemax-(Times[0]+1))*60*60*1000) +((60-(Times[1]+1))*60*1000)+((60-Times[2])*1000)):(((24-(Times[0]+1))*60*60*1000) +((60-(Times[1]+1))*60*1000)+((60-Times[2])*1000)+(timemax*60*60*1000))),false,"sii",functionsname,timemin,timemax);
        
state call:max;
    }
    return 
1;

I want to create every Time when this stock-function is called a new state maschine with the name of the function
as automaton but it won't work i get still the same error
PHP код:
error 086unknown automaton "functionsname" 
i need that to call the different publics

PHP код:
forward Test(functionsname[],timemin,timemax);
public 
Test(functionsname[],timemin,timemax)<call:min>
{
    new 
Times[3];
    
gettime(Times[0], Times[1], Times[2]);
    
CallLocalFunction(functionsname,"");
    
state call:max;
    
newtimer SetTimerEx("Test",((Times[0] < timemax)?(((timemax-(Times[0]+1))*60*60*1000) +((60-(Times[1]+1))*60*1000)+((60-Times[2])*1000)):(((24-(Times[0]+1))*60*60*1000) +((60-(Times[1]+1))*60*1000)+((60-Times[2])*1000)+(timemax*60*60*1000))),false,"ii",timemin,timemax);
    return 
1;
}
public 
Test(functionsname[],timemin,timemax)<call:max>
{
    new 
Times[3];
    
gettime(Times[0], Times[1], Times[2]);
    
CallLocalFunction(functionsname,"");
    
state call:min;
    
newtimer SetTimerEx("Test",((Times[0] < timemin)?(((timemin-(Times[0]+1))*60*60*1000) +((60-(Times[1]+1))*60*1000)+((60-Times[2])*1000)):(((24-(Times[0]+1))*60*60*1000) +((60-(Times[1]+1))*60*1000)+((60-Times[2])*1000)+(timemin*60*60*1000))),false,"ii",timemin,timemax);
    return 
1;

PHP код:
SetTimerByTimes("btest",12,22); 
This publics with SetTimerEx
PHP код:
forward btest();
public 
btest()<call:min>
{
    
printf("Hallo");
    return 
1;
}
public 
btest()<call:max>
{
    
printf("By");
    return 
1;

i even know that this is a string but even i tried it with Makros but it still won't work.

Have everyone an idea to do this which is even efficient like using state
Reply


Messages In This Thread
Create new state machines with different automaton in a public - by IPrototypeI - 26.01.2013, 21:39
AW: Re: Create new state machines with different automaton in a public - by IPrototypeI - 27.01.2013, 15:40

Forum Jump:


Users browsing this thread: 1 Guest(s)