REGISTER or LOGIN to have the annoying ads removed.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MYPS Slots Add-on
The only problem I am having is with the marquee. It is way too far over to the left and it is gone within a second. Can't read is only a problem in firefox, though. It works fine in IE! How strange!

Thanks for the great myps mod.
What do I need to modify to make the odds of winning easier for players?? I have a bunch of kids on my site and they are all about winning. Anyways, if you can point me to the correct codes and tell me what to modify, that would be great! Of course, I will try to figure it out on my own as well....

DragonLord Wrote:
labrocca Wrote:(for the images make sure to upload them to each of your themes images directory)

Why not only one slot folder with images to work with? Can't we just put a slot folder and other themes share with it?

Yes I certainly could have done that but I didn't and I gave explicit instruction on installation procedure which you didn't follow. It's actually better to use themedir for images just in case you decide to make your own graphics and have different themes installed. I make all my plugins with my own specific use in mind and I release them to the public. One of the sites I am using this on is which has 6 themes each with it's own set of graphics. Should I need to alter backgrounds or the images it's important themedir is used. Mybb has created a problem for theme designers by not using this for all images.

Quote:What do I need to modify to make the odds of winning easier for players??

If you want to make the winning easier edit the root/slots.php file.


* MyBB 1.2
* Copyright © 2007 Jesse Labrocca
* Website:
* $Id: slots.php 2702 2007-10-07 09:48:14 Labrocca $ */

define("IN_MYBB", 1);

$templatelist = "slots, error";
require_once "./global.php";

if ($mybb->user['uid'] == 0){


  $credit = $mybb->settings['slots_credit'];
  $money = $mybb->user['myps'];

if ($money <= "0" || $mybb->user['myps'] < $credit ) {
    add_breadcrumb("Slots Error");
    $title = "MYPS Slot Machine";
    $error = "Sorry but you do not have enough ". $mybb->settings['myps_name']." to play.";
    eval("\$error = \"".$templates->get("error")."\";");

if ($mybb->settings['myps_status'] != "on") {
    add_breadcrumb("Slots Error");
    $title = "MYPS Slot Machine";
    $error = "Sorry but the points system does not appear enabled.";
    eval("\$error = \"".$templates->get("error")."\";");

  $slot1 = rand(1,5);
  $slot2 = rand(1,5);
  $slot3 = rand(1,5);

  if ($slot1 == 1 && $slot2 == 1 && $slot3 == 1) {
   $money = $money+($credit*10);
    $win = "yes";
  if ($slot1 == 2 && $slot2 == 2 && $slot3 == 2) {
      $money = $money+($credit*25);
      $win = "yes";
  if ($slot1 == 3 && $slot2 == 3 && $slot3 == 3) {
    $odds = rand(1,3);
       $money = $money+($credit*50);
       $win = "yes";
  if ($slot1 == 4 && $slot2 == 4 && $slot3 == 4) {
       $money = $money + ($credit*100);
          $win = "yes";

if ($_POST['play'] == "1"){

  if ($win != "yes"){
   $marquee = "You did not win. Try again.";
   $money = $money-$credit;
   $db->query("UPDATE ".TABLE_PREFIX."users SET myps='".$money."' WHERE uid='".$mybb->user['uid']."'");

    } else {
   $marquee = "WINNER - WINNER - WINNER <embed src=\"{$theme['imgdir']}/slots/win.wav\" width=\"0\" height=\"0\" autostart=\"true\" repeat=\"false\">";
   $db->query("UPDATE ".TABLE_PREFIX."users SET myps='".$money."' WHERE uid='".$mybb->user['uid']."'");

   $marquee = "Press SPIN to begin playing.";
    $title = "MYPS Slot Machine";
    eval("\$slots = \"".$templates->get("slots")."\";");


This pretty much will make it a lot easier to win the top 2 payouts. FYI...from my testing...a player will get richer and richer with this code.

If you know php you can tweak the if statements in the original file that has the $odds randomized. The 3rd payout does a second check and pays 2 out 3 times. The top payout if win does a second check and only pays 1 out of 3 times. This is above the regular random spinning. I have yet to calculate exact odds for winning but go ahead and mess with the formula and see what you come up with. In the next version I will try to find a few ways to customize these things in admincp. For now it's fixed in the code.

Quote:I was just wondering if there was any way to make the text : "try again." or the others. Flash by more often. I barely have a chance to see them.

Unfortunately marquee is not actually standard HTML so it's iffy for each browser. You can remove the marquee and just make it flat text if you want. Look for the <marquee> html tags and maybe just make it a <span> tag instead with a class.

You can also try this:
I decided to give this one a try on my site, and I wanted to point out something. Yes, the instructions do say to upload the images to the image directory of each theme, but it doesn't state that the entire slots folder should be uploaded. Luckily, I was able to look at the source code and figure that out, or I would have been going wtf? LOL

So for any of you that can't figure it out, the path would be .../forum/images/yourtheme/slots/image.png

Also Labrocca, any thought on updating it like you said in your post? About it refreshing and then having to scroll down after every spin? Just wondering. Smile
labrocca Wrote:Yes I noticed that issue once I placed it on a site that was not the default mybb skin. I will have to change it. Probably place it on the side like a pull bar graphic.
By the way, it does the same thing in the default mybb least in FF.

I use FF and the marquee doesn't work very well, but the delay helps a bit. I also recommend just editing the message and having it repeat itself. So if they miss it the first time, they'll be sure to see it the second time. LOL
Yeah I plan to redo the layout to fix that problem. Wasn't a problem on my default install but was on my custom layouts. I might even try to ajax this or have it in a popup. Not sure really.
nice mod m8, did u manage to sort out were the page reloads and u have to scroll down Smile

You just have to change the layout a bit for that. Easy enough to do on your own.
thanks for the plugin. good job!
another good job! Keep it up! Wink
i love this

Possibly Related Threads...
Thread Author Replies Views Last Post
  MYPS Lottery v1.0 labrocca 30 18,310 Aug 20, 2008, 09:17 AM
Last Post: pad_kay
  Attachments issue related to MyPS Xtreme2damax 3 3,449 Aug 02, 2008, 03:49 AM
Last Post: labrocca
  How to add background picture GearHead 2 2,791 Jul 07, 2008, 01:56 AM
Last Post: club-gam
  Help for MYPS ! indiansword 2 2,925 May 04, 2008, 07:15 PM
Last Post: indiansword
  How to add adsense search into mybbsearch AjEe 0 1,716 Apr 15, 2008, 01:40 AM
Last Post: AjEe

Forum Jump:

Users browsing this thread: 1 Guest(s)