Timer problem -
kadar - 20.08.2018
Hi,
I have a timer that I'm using at my login system. The repeat function is set to false, but it is still repeating and I can't even kill the timer, because it just does not work.
Код:
LoginSpawnT[playerid] = SetTimerEx("AutoSpawn", 1000*60, false, "i", playerid);
That is the code how I create the timer. (I don't think there should be any problem with the code
)
Код:
KillTimer(LoginSpawnT[playerid]);
And that is how I'm trying to kill it.
Does anyone have any idea what is wrong with it?
Re: Timer problem -
Unkovic - 20.08.2018
Where do you set it?
Re: Timer problem -
Mirsen2 - 20.08.2018
Quote:
Originally Posted by kadar
Hi,
I have a timer that I'm using at my login system. The repeat function is set to false, but it is still repeating and I can't even kill the timer, because it just does not work.
Код:
LoginSpawnT[playerid] = SetTimerEx("AutoSpawn", 1000*60, false, "i", playerid);
That is the code how I create the timer. (I don't think there should be any problem with the code )
Код:
KillTimer(LoginSpawnT[playerid]);
And that is how I'm trying to kill it.
Does anyone have any idea what is wrong with it?
|
Idk how to solve the problem but if you ask me, use SetTimer:
Код:
SetTimer("AutoSpawn", 1000*60, false);
Idk if it's better but it's definitely easier to use, I use it in my script.
Re: Timer problem -
KinderClans - 20.08.2018
Quote:
Originally Posted by Mirsen2
Idk how to solve the problem but if you ask me, use SetTimer:
Код:
SetTimer("AutoSpawn", 1000*60, false);
Idk if it's better but it's definitely easier to use, I use it in my script.
|
SetTimer is for GLOBAL timers, it should be used for server utilities, such as saving stats each X minutes and so on.
You need SetTimerEx to make a player timer.
Re: Timer problem -
kadar - 20.08.2018
Quote:
Originally Posted by Unkovic
Where do you set it?
|
I have text draws with details after login. So I set it in a public function (using mysql_tquery) after logging in. It's supposed to spawn me automatically and kill the timer after the 60 seconds passed, but the timer keeps going on.
Re: Timer problem -
KinderClans - 20.08.2018
There is no need to set a timer to spawn automatically a player. Just use SpawnPlayer(playerid); after the player logged in.
Re: Timer problem -
kadar - 20.08.2018
Quote:
Originally Posted by KinderClans
There is no need to set a timer to spawn automatically a player. Just use SpawnPlayer(playerid); after the player logged in.
|
I am aware of that. But if i just used SpawnPlayer(playerid); I would lose one of my cool features at the login :/ That's why I need the timer to delay the spawning time.
Re: Timer problem -
KinderClans - 20.08.2018
Ok please summarize what you're trying to do so we can help you better.
From the input login password to the completed login. Summarize this.
Re: Timer problem -
kadar - 20.08.2018
Quote:
Originally Posted by KinderClans
Ok please summarize what you're trying to do so we can help you better.
From the input login password to the completed login. Summarize this.
|
So when I connect to the server login dialog shows up. I enter my password and then a few textdraws appear and show me details about my character. (eg. Name, level, helath etc.) At that point I want the gamemode to show me these datails for one minute, and then spawn me.
Edit: I solved the problem somehow
I've just deleted a timer, so now it's one less and everything works fine, but I still do not know what was wrong. I suppose there was some kind of bug.