Quick Question about Timers

Svanhild

New member
Messages
115
Points
0
Location
Queenslander
Emulator
So I've been working on this script for 48 hours now and I can't seem to get it right. The problem is that with npc timers, all players are affected. But with player timers, the problem is that, getnpctimer for player timer doesn't seem to work unless it was triggered by an initnpctimer. So my question is, how to read the current timer ticks for a player timer? My purpose is to make a message that would display how many seconds had passed, minute and hour had passed, to make it informative on how much time does the player have left before being warped out of the room.

 
As far as I remember you can't read player's timer, but can't you make a player variable that stores the time when player will be warped?

example, if player will be able to stay in the room for 2 hours, you can do something like:

warpTime = gettimetick(2) + 2 * 3600; // 3600 = 1 hour

Then, if you want to display how much time player still have:

dispbottom "You still have " + (warpTime - gettimetick(2)) + " seconds in this room";

I've not tested it, but I believe it can give you an idea of how to do it.

 
Depending on what you want to do. You could give a rental item with "*rentitem(<item id>, <time>)" and later check if the item is still in the inventory. Well depends on what exactly you want to achieve with your script.

 
Last edited:
Back
Top