shaved92bravada Posted December 19, 2008 Posted December 19, 2008 I am working on a very very advanced newspaper and I was trying to think of something that I could put in there that would catch the players eye and make them want to stay active and hopefully out of trouble. So I came up with Player of the Week!! It requires 2 new fields in the user table ( I'm sure there is an easier way.... ) and it runs off of crons.... How simple is that!!! lol I know I make it sound like WOW when its pretty simple. But hey its an idea I thought of and I take great pride in my work lol.... anyway. How it works is.... The weekly cron runs on Sunday night and randomly picks a player out of the users that were active within a certain amount of days ( forgot what I set it too, I used the timestamp to set it a while ago ) and aren't in fedjail. ( thinking of adding in mailban as well as the warning system I am using ) That way it encourages them to stay active more and to try and stay out of trouble..... Then once they are chosen for player of the week .... of course they hold the title for 7 days BUT thats not all... they are also given a reward. I have it set on mine to give them 10 donator days and a random item . You can chose which item or change $item=rand(1,30); ( 30 being the number of items in your game or the max item id you want it to go to ) 1- 30 on my game are all pretty good rewards so thats what I set it as. Anyway the good stuff SQL's ALTER TABLE `users` ADD `player_week` INT NOT NULL DEFAULT '0'; ALTER TABLE `users` ADD `pw_reward` INT NOT NULL DEFAULT '0'; open cron_day.php ADD THIS You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Then save this as cron_weekly.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. then in your cron jobs you will need to run this cron 0 20 * * 7 curl http://www.sitename.com/cron_week.php?c ... ONCODEHERE 0 is the minute 20 is the hour of the day 7 is the day of the week which 7 would be sunday that is for those who didn't know.... Now if you want to display the player of the week somewhere this is how I did it. I'm sure others will think of a better way but hey it works great with my newspaper layout I am using. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Like I said that is how I display it on mine you would prolly need to change some stuff around but here is what it looks like in the end. as always post any bugs and I will work on them. Thanks and if you like it let me know and I will keep em coming. p.s. and if ya like my newspaper I might even post it thats undecided yet. All of the articles are able to be edited directly from the the paper itself or from the admin panel, only me ( the owner ) admins, or news staff are able to edit it. The rest of the stuff is just the normal queries like top 10 etc. Also going to have an advertiser login there somewhere so anyone that advertises on my game can login and check the amount of views/clicks their add has gotten and how much longer it will run for. Quote
mentaljason Posted December 19, 2008 Posted December 19, 2008 Re: [mccode V2] Player of the week... Nice Idea, instead of a donator pack you could convert a pack just for player of the weeks, like they get an individual name colour etc... but hey t's your mod lol.... Quote
shaved92bravada Posted December 19, 2008 Author Posted December 19, 2008 Re: [mccode V2] Player of the week... well actually I just give them 10 donator days, then they get luck of the draw on the items in which donator packs are included in the list of items, in which i am getting rid of all but like 2 dp's anyway to make the game more fair for everyone. Plus this way everyone has a chance to get a dp or donator days even if they can't afford it ya know. Quote
Savager Posted December 20, 2008 Posted December 20, 2008 Re: [mccode V2] Player of the week... one of the best ideas ive seen so far. the only thing on CE that i might use. +1 thanks for posting! Quote
castle Posted December 20, 2008 Posted December 20, 2008 Re: [mccode V2] Player of the week... this is nice, but I can't get it to display the users picture, only the default picture, this is my newspaper file: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Haunted Dawg Posted December 20, 2008 Posted December 20, 2008 Re: [mccode V2] Player of the week... One thing with this mod. Even if you have so called item id's 1 - 30. What if id 15 is missing? and the random number is chosen as 15? The user get's no item. So why not just go like this. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. I am not sure if that is correct. If that does not work simply use this. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. This way. It checks if the item exist's or not and if not it just give's a default one in code 2 but in code 1 it will run the while function again. Quote
Haunted Dawg Posted December 20, 2008 Posted December 20, 2008 Re: [mccode V2] Player of the week... @ castle: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
shaved92bravada Posted December 20, 2008 Author Posted December 20, 2008 Re: [mccode V2] Player of the week... thanks for that killah I didn't even think of that..... like I said I threw this together pretty quick so I figured there would be something wrong. Glad ya'll like it though. Quote
MartialCoder0101 Posted December 20, 2008 Posted December 20, 2008 Re: [mccode V2] Player of the week... Player of the week mod. Very Nice Brotha. I was thinking more along the lines of MVP of the Week or something of that matter. Per say: I trained- 42 times this week PLayer 2-trained -18 Times this Week. I did 40 crimes this week PLayer 2- Did 39 crimes this week. Etc Etc.. Then after the week is up, It totals, and auto adds The MVP of the week, Could go into alot more detail. And If you wish to do this, Shoot me a mail, Maybe it could be a joint project mate. Quote
shaved92bravada Posted December 20, 2008 Author Posted December 20, 2008 Re: [mccode V2] Player of the week... very nice idea.... I may look into that after I get my newspaper done. My thinking was to make sure people stayed active and that could be another great way to keep people active. Quote
MartialCoder0101 Posted December 20, 2008 Posted December 20, 2008 Re: [mccode V2] Player of the week... Oh yeah, Deff... Weekly Prizes. MVP= 1 12 day DD pack, Not Attackable for $amnt days. Secondary Player= 6 day DD pack 3rd = 3 day dd pack. Something to give people high hopes to stay active during thier gameplay Quote
shaved92bravada Posted December 20, 2008 Author Posted December 20, 2008 Re: [mccode V2] Player of the week... I am also going to make one that rewards a the person that helps out the most people say in like a month. That one is going to be a little bit more tricky though. Because it is going to require the player that they helped to "vote" or "rate" this person and the person with the most at the end of the month will get a special prize as well. But I am going to have to do it somehow that people can't just have other people vote for them etc without helping. Not sure exactly on how I want to do that. My goal is to have a game where people are friendly, active, and try and stay out of trouble ya know. lol I know I am probably dreaming but still its worth a shot. Give people incentive and it helps. Bribery as i like to call it. lol Quote
castle Posted December 20, 2008 Posted December 20, 2008 Re: [mccode V2] Player of the week... thanks killah Quote
Savager Posted December 20, 2008 Posted December 20, 2008 Re: [mccode V2] Player of the week... ammount of times trained, that would cause a problem... a) be easier for donators to get b) people can just train 1 time and keep doing that c) energy refills d) bigger level players would do the 1 brave crime Quote
shaved92bravada Posted December 20, 2008 Author Posted December 20, 2008 Re: [mccode V2] Player of the week... ammount of times trained, that would cause a problem... a) be easier for donators to get b) people can just train 1 time and keep doing that c) energy refills d) bigger level players would do the 1 brave crime Good point..... I am still gonna go with my other idea for the player being the most helpful, just need to figure out how to do it to keep people from cheating ya know. Quote
redsnake420 Posted December 20, 2008 Posted December 20, 2008 Re: [mccode V2] Player of the week... ok i know i must be sounding like a total newb for saying this but if i want to make it not a random item and only 1 item and to give out more then one of that item wouldn't i edit this part You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. to this part You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. 25 being the item id and 2 being the quantity that they get right? Quote
shaved92bravada Posted December 20, 2008 Author Posted December 20, 2008 Re: [mccode V2] Player of the week... you would be correct and also to point out that atleast you asked if you had done it right now just demanded that someone do it for you. +1 to you for asking and trying...... Quote
redsnake420 Posted December 20, 2008 Posted December 20, 2008 Re: [mccode V2] Player of the week... sweet +1 to you as well for the nice add-on :-) Quote
bob324 Posted December 20, 2008 Posted December 20, 2008 Re: [mccode V2] Player of the week... ok i know i must be sounding like a total newb for saying this but if i want to make it not a random item and only 1 item and to give out more then one of that item wouldn't i edit this part You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. to this part You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. 25 being the item id and 2 being the quantity that they get right? you could just put - You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
castle Posted December 20, 2008 Posted December 20, 2008 Re: [mccode V2] Player of the week... It erases the winner by having this in your day cron: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. I moved it to the weekly cron, so the winner is displayed all week: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
shaved92bravada Posted December 20, 2008 Author Posted December 20, 2008 Re: [mccode V2] Player of the week... sry messed up on the part for the day cron You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. That should work correct. I had an = in there which set it to -1 instead of just take on off. Quote
Cyanide Posted December 22, 2008 Posted December 22, 2008 Re: [mccode v2] Player of the week... +1 without a doubt....i didnt really read over the code or anything, but i really like the idea, also, if you dont already have it in the query, use a timestamp to make sure the player that it selects is active, it would give extra incentive to be online and active. Just add this tp the query.... You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
shaved92bravada Posted December 22, 2008 Author Posted December 22, 2008 Re: [mccode v2] Player of the week... yeah its already in there, I don't think its that exact one but it makes sure they are active within the last 10 or 14 days something like that. also it checks to make sure they aren't in fed..... The way I look at it is it encourages them to stay active and out of trouble... hopefully. Plus with the item being random that you receive ya never know what you could end up with.... Quote
POG1 Posted December 22, 2008 Posted December 22, 2008 Re: [mccode v2] Player of the week... This is a very good idea and i think the user should have a coloured name so the others now who the player of the week is. You could use a function that gives a coloured name, just a simple function Quote
shaved92bravada Posted December 22, 2008 Author Posted December 22, 2008 Re: [mccode v2] Player of the week... You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. 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.