A tricky one (funcname[])
#10

Quote:
Originally Posted by Lookin
Посмотреть сообщение
ok.
for example:
I wanted to make a timer include that made one timer work like
pawn Код:
ST(S(5), 1); // 5 seconds
rather than
pawn Код:
SetTimer(funcname[], interval, repeating)
im just using
pawn Код:
SetTimer(interval, repeating)
so that i can have multiple functions using just one timer
like this

pawn Код:
public DoSomeThingHere1()
{
    SendClientMessageToAll(LIGHT_BLUE,"MSG1");
    ST(S(5),1); //5 seconds
    return 1;
}

public DoSomeThingHere2()
{
    SendClientMessageToAll(LIGHT_BLUE,"MSG2");
    ST(S(5),1); //5 seconds
    return 1;
}
also was going to add in a question, may as well do it here. how would i make processing cmds and timers to read and write faster?
Quote:
Originally Posted by ******
Посмотреть сообщение
I'm still not clear how you want to specify which functions are called by your timer without that parameter...



There are multiple libraries for that - the most famous is probably ZCMD, but I'd say y_commands (and y_timers for timers).
Ok

public DoSomeThingHere2()
{
SendClientMessageToAll(LIGHT_BLUE,"MSG2");
ST(S(5),1); //only starts the timer in this function for the duration the function is called
return 1;
}

so that all it needs to do is count to the set amount of time (in this case S(5)) this function is used for rather than use a public and function name, all it knows is to use this function for the time set

And i didnt really plan it out or anything i was just curious if it was possible.
Reply


Messages In This Thread
A tricky one (funcname[]) - by Lookin - 13.03.2013, 07:31
Re: A tricky one (funcname[]) - by Vince - 13.03.2013, 08:03
Re: A tricky one (funcname[]) - by Dan.. - 13.03.2013, 08:04
Re: A tricky one (funcname[]) - by Sinner - 13.03.2013, 08:25
Re: A tricky one (funcname[]) - by MP2 - 13.03.2013, 08:29
Re: A tricky one (funcname[]) - by cessil - 13.03.2013, 08:58
Re: A tricky one (funcname[]) - by Lookin - 13.03.2013, 09:27
Re: A tricky one (funcname[]) - by Vince - 13.03.2013, 09:54
Re: A tricky one (funcname[]) - by Lookin - 13.03.2013, 11:15
Re: A tricky one (funcname[]) - by Lookin - 13.03.2013, 13:45

Forum Jump:


Users browsing this thread: 8 Guest(s)