villr Posted June 15, 2013 Posted June 15, 2013 The thing that im trying to do and what im gonna have it to is like this, it will be a bot that says like, it was 1day and 3 hours since you last visited here. or it was 5 hours since you last visited here I have some code i tested but i wasent even sure what i was doing but here it is.. TD2 = tonumber(20130615) OD2 = tonumber(20130610) hDays = (TD2-OD2) totH = hDays*24 curH = totH/h outputChatBox(hDays.." days, "..curH.." hours "..(totH).." total hours") Anyone know how to do it? Happy Owner/Leader of SELS:RPG | Cops and Gangsters | TRUE CRIME CITY with a lot of JOBS! Scripted since summer 2010
Castillo Posted June 15, 2013 Posted June 15, 2013 I don't really understand what ur doing there, is this your whole code? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
villr Posted June 15, 2013 Author Posted June 15, 2013 That was just some test code... But what i want is to calculate how many days and hours it has passed since the player last entered. But i have no idea about how i'll should calculate it. Happy Owner/Leader of SELS:RPG | Cops and Gangsters | TRUE CRIME CITY with a lot of JOBS! Scripted since summer 2010
Castillo Posted June 15, 2013 Posted June 15, 2013 You can try with getTickCount San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
villr Posted June 15, 2013 Author Posted June 15, 2013 What i meant with my post was, im going to have an thing in Area51 that will say when you enter, it was 5hours since you last visited here, or, it was 1 day and 5 hours since you last visited here. The time will be calculated from a data that has been saved as example 2013 06 14 22 10 but im not sure how i should calculate this, i only know how to calculate the days and total hours Happy Owner/Leader of SELS:RPG | Cops and Gangsters | TRUE CRIME CITY with a lot of JOBS! Scripted since summer 2010
Castillo Posted June 15, 2013 Posted June 15, 2013 Store the tick count from when you last visted somewhere, then make a math to calculate how long it passed since last visit. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now