[HELP]Timer for all ? -
Saw® - 21.01.2013
Hi , I have a variable who checks if the player spawns without doing tutorial then I start it:
pawn Код:
TuerTempsTutoriel = SetTimer("Tutoriel", 1000, true);
the Timer function:
pawn Код:
forward Tutoriel();
public Tutoriel()
{
for(new i; i<MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
TempsTutoriel[i] ++;
if(TempsTutoriel[i] == 8) // Tuto 1
{
//blabla
}
else if(TempsTutoriel[i] == 65)
{
//blabla
}
//.....other things
return 1;
}
The problem is I think that when a player spawns without doing tutorial all players do it ,(like this tutorial timer is started for everyone , So I must change it to playerid only?)
Re: [HELP]Timer for all ? -
Infinity90 - 21.01.2013
Change
pawn Код:
SetTimer("Tutoriel", 1000, true);
Too this:
pawn Код:
SetTimerEx("Tutoriel", 1000, false, "i", playerid); // the false is making it NOT Loop if you want to look it change it to true
That should work
Re: [HELP]Timer for all ? -
Saw® - 21.01.2013
Thank you ! i should also change that?
pawn Код:
forward Tutoriel();
public Tutoriel()
to :
pawn Код:
forward Tutoriel(playerid);
public Tutoriel(playerid)
or not?
Re: [HELP]Timer for all ? -
Infinity90 - 21.01.2013
yes you need to do that otherwise it will say unidentified symbol "playerid"
Re: [HELP]Timer for all ? -
DaRk_RaiN - 21.01.2013
Quote:
Originally Posted by Infinity90
Change
pawn Код:
SetTimerEx("Tutoriel", 1000, false, "i", playerid); // the false is making it NOT Loop if you want to look it change it to true
That should work
|
What are you talking about, don't teach something you have no idea what it does.
false means the timer will only run one time and stop
true means that it will keep running until the player disconnects or till you kill the timer.
Also true = 1 and false= 0
Re: [HELP]Timer for all ? -
Saw® - 21.01.2013
Thank you !
Yes I need it until I kill timer (changed false to true)
Re: [HELP]Timer for all ? -
Infinity90 - 21.01.2013
I meant repeat -_-
Re: [HELP]Timer for all ? -
Saw® - 21.01.2013
one thing , the
pawn Код:
KillTimer(TuerTempsTutoriel);
will kill the tutorial for the player only or all ?
so should I also make it like
pawn Код:
KillTimer(TuerTempsTutoriel[playerid]);
?
Re: [HELP]Timer for all ? -
DaRk_RaiN - 21.01.2013
Use the second one.BUT make sure you define it well
pawn Код:
new TuerTempsTutoriel[MAX_PLAYERS];
Re: [HELP]Timer for all ? -
Saw® - 21.01.2013
Thank you ! and also
Код:
TuerTempsTutoriel = SetTimerEx("Tutoriel", 1000, true, "i", playerid);
to
Код:
TuerTempsTutoriel[playerid] =SetTimerEx("Tutoriel", 1000, true, "i", playerid);
so this will start it only for the player.