SetTimer
#1

I want to add parametar "%d" to SetTimer function...

Here is command:

pawn Код:
CMD:test(playerid, params[])
{
    new time;
    if(sscanf(params, "i", time))return SendClientMessage(playerid, -1, "Usage: /test [minutes]");
    SetTimer("Over", %d*1000*60, false)
    return 1;
}
Can this works??

and will this Timer repet just once?

When i type command, timer goes, and after end he dont repeat again only if I type command again??
Reply
#2

Here is the example for your command:
pawn Код:
SetTimer("Over", time*1000, true);
If you want to convert minutes to miliseconds you don't need '*60'.

And if you want for timer to repeat you have to put 'true', not 'false' for repeating parameter.
Reply
#3

This should work
PHP код:
CMD:test(playeridparams[])
{
    new 
time;
    if(
sscanf(params"i"time))return SendClientMessage(playerid, -1"Usage: /test [minutes]");
    
SetTimer("Over",time*1000false);
    return 
1;

Reply
#4

Quote:
Originally Posted by ******
Посмотреть сообщение
Yes you DO need to put "* 60", otherwise "7" will only give 7 seconds, not 7 minutes.
That's right. I mixed up seconds and minutes. Thanks for the correction.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)