RazorBladerz Posted April 20, 2009 Posted April 20, 2009 How do i Make people get item for every time online?? Eg.I will get item 5 of item id5 for every hour online?? isit like <?php $result = mysql_query("SELECT * FROM `updates` WHERE `name` = 'Hour'"); $result = mysql_fetch_assoc($result); $hla = time() - $result['last']; if($hla > (3600)) {Giveuser itemid=5} ?> correct me if wrong . actually i know it is wrong lol this is my first code and i have no code experience haha teach me about it Quote
Strats Posted April 20, 2009 Posted April 20, 2009 Re: Make people get item for every time online?? Lol good luck with this. Quote
Dayo Posted April 20, 2009 Posted April 20, 2009 Re: Make people get item for every time online?? make a table name loginitem in authenticate add this some where if ($ir['loginitem'] == 1) { item_add($ir['userid'], 5, 1); $db->query(UPDATE users SET loginitem=0 WHERE userid=$ir['userid']) } then in cron_day add this query UPDATE users SET loginitem=1 WHERE loginitem=0 THIS IS NOT TESTED!!! Quote
RazorBladerz Posted April 21, 2009 Author Posted April 21, 2009 Re: Make people get item for every time online?? I was thinking to add a unix timestamp and do a hour online like iftime=3600 (1hour) giveuser "itemid=5(includefile)" and do give a userid item5 . 5of it . so should it be useronline time=3600 ?? or the codembecaus i dont know how to do unix timestamps Quote
Lithium Posted April 21, 2009 Posted April 21, 2009 Re: Make people get item for every time online?? I was thinking to add a unix timestamp and do a hour online like iftime=3600 (1hour) giveuser "itemid=5(includefile)" and do give a userid item5 . 5of it . so should it be useronline time=3600 ?? or the codembecaus i dont know how to do unix timestamps Best way is Dayo's one... And unix time is measured in seconds so... 1 minute = 60 seconds; 1 hour = 60 minutes then 1 hour = 60*60 = 3600... so you are right on there as well Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.